MCPcopy Index your code
hub / github.com/mudler/LocalAI / setUpClass

Method setUpClass

backend/python/insightface/test.py:240–255  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

238class OnnxDirectEngineTest(unittest.TestCase):
239 @classmethod
240 def setUpClass(cls):
241 cls.samples = _load_insightface_samples()
242 cls.model_dir = _prepare_opencv_models_dir()
243 if cls.model_dir is None:
244 raise unittest.SkipTest("OpenCV Zoo ONNX files could not be downloaded")
245 cls.harness = _Harness(BackendServicer())
246 load = cls.harness.load(
247 [
248 "engine:onnx_direct",
249 "detector_onnx:face_detection_yunet_2023mar.onnx",
250 "recognizer_onnx:face_recognition_sface_2021dec.onnx",
251 ],
252 model_path=cls.model_dir,
253 )
254 if not load.success:
255 raise unittest.SkipTest(f"LoadModel failed: {load.message}")
256
257 def test_detect_finds_face(self):
258 res = self.harness.detect(self.samples["t1"])

Callers

nothing calls this directly

Calls 5

BackendServicerClass · 0.90
_HarnessClass · 0.85
loadMethod · 0.45

Tested by

no test coverage detected