Function
build_index
(
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 | |
| 190 | def 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
Tested by
no test coverage detected