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.
()
| 85 | |
| 86 | |
| 87 | def _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 | |
| 106 | class _FakeContext: |
no test coverage detected