MCPcopy Create free account
hub / github.com/amazon-science/patchcore-inspection / score

Method score

src/patchcore/patchcore.py:313–322  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

311 return x.reshape(batchsize, -1, *x.shape[1:])
312
313 def score(self, x):
314 was_numpy = False
315 if isinstance(x, np.ndarray):
316 was_numpy = True
317 x = torch.from_numpy(x)
318 while x.ndim > 1:
319 x = torch.max(x, dim=-1).values
320 if was_numpy:
321 return x.numpy()
322 return x

Callers 1

_predictMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected