Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
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
82
def
_encode(img: np.ndarray) -> str:
83
_, buf = cv2.imencode(
".jpg"
, img)
84
return
base64.b64encode(buf.tobytes()).decode(
"ascii"
)
85
86
87
def
_load_insightface_samples() -> dict[str, str]:
Callers
2
_load_insightface_samples
Function · 0.85
setUpClass
Method · 0.85
Calls
1
decode
Method · 0.80
Tested by
no test coverage detected