MCPcopy
hub / github.com/serengil/deepface / build_index

Function build_index

deepface/api/src/modules/core/service.py:190–212  ·  view source on GitHub ↗
(
    model_name: str,
    detector_backend: str,
    align: bool,
    l2_normalize: bool,
    database_type: str,
    connection_details: str,
)

Source from the content-addressed store, hash-verified

188
189
190def build_index(
191 model_name: str,
192 detector_backend: str,
193 align: bool,
194 l2_normalize: bool,
195 database_type: str,
196 connection_details: str,
197) -> Tuple[Dict[str, Any], int]:
198 try:
199 DeepFace.build_index(
200 model_name=model_name,
201 detector_backend=detector_backend,
202 align=align,
203 l2_normalize=l2_normalize,
204 database_type=database_type,
205 connection_details=connection_details,
206 )
207 return {"message": "Index built successfully"}, 200
208 except Exception as err:
209 tb_str = traceback.format_exc()
210 logger.error(str(err))
211 logger.error(tb_str)
212 return {"error": f"Exception while building index: {str(err)} - {tb_str}"}, 400

Callers

nothing calls this directly

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected