MCPcopy
hub / github.com/mudler/LocalAI / _encode

Function _encode

backend/python/insightface/test.py:82–84  ·  view source on GitHub ↗
(img: np.ndarray)

Source from the content-addressed store, hash-verified

80
81
82def _encode(img: np.ndarray) -> str:
83 _, buf = cv2.imencode(".jpg", img)
84 return base64.b64encode(buf.tobytes()).decode("ascii")
85
86
87def _load_insightface_samples() -> dict[str, str]:

Callers 2

setUpClassMethod · 0.85

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected