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

Function get_sampler

bin/run_patchcore.py:322–328  ·  view source on GitHub ↗
(device)

Source from the content-addressed store, hash-verified

320@click.option("--percentage", "-p", type=float, default=0.1, show_default=True)
321def sampler(name, percentage):
322 def get_sampler(device):
323 if name == "identity":
324 return patchcore.sampler.IdentitySampler()
325 elif name == "greedy_coreset":
326 return patchcore.sampler.GreedyCoresetSampler(percentage, device)
327 elif name == "approx_greedy_coreset":
328 return patchcore.sampler.ApproximateGreedyCoresetSampler(percentage, device)
329
330 return ("get_sampler", get_sampler)
331

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected