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

Function _load_insightface_samples

backend/python/insightface/test.py:87–103  ·  view source on GitHub ↗

Return {'t1': , 't2': } from insightface.data.get_image. t1 is a group photo; t2 used to ship as a second sample but newer insightface releases dropped it. We fall back to `Tom_Hanks_54745` (also bundled) as a distinct second face.

()

Source from the content-addressed store, hash-verified

85
86
87def _load_insightface_samples() -> dict[str, str]:
88 """Return {'t1': <b64>, 't2': <b64>} from insightface.data.get_image.
89
90 t1 is a group photo; t2 used to ship as a second sample but newer
91 insightface releases dropped it. We fall back to `Tom_Hanks_54745`
92 (also bundled) as a distinct second face.
93 """
94 from insightface.data import get_image as ins_get_image
95
96 try:
97 second = ins_get_image("t2")
98 except AssertionError:
99 second = ins_get_image("Tom_Hanks_54745")
100 return {
101 "t1": _encode(ins_get_image("t1")),
102 "t2": _encode(second),
103 }
104
105
106class _FakeContext:

Callers 2

setUpClassMethod · 0.85
setUpClassMethod · 0.85

Calls 1

_encodeFunction · 0.85

Tested by

no test coverage detected