Formatting

This commit is contained in:
Nicolas Mowen 2025-01-02 15:25:43 -07:00
parent c9445ac3f5
commit 585a2b2f93
2 changed files with 6 additions and 2 deletions

View File

@ -50,7 +50,9 @@ async def register_face(request: Request, name: str, file: UploadFile):
@router.post("/faces/train/{name}/classify")
def train_face(name: str, body: dict = None):
json: dict[str, any] = body or {}
training_file = os.path.join(FACE_DIR, f"train/{sanitize_filename(json.get("training_file", ""))}")
training_file = os.path.join(
FACE_DIR, f"train/{sanitize_filename(json.get("training_file", ""))}"
)
if not training_file or not os.path.isfile(training_file):
return JSONResponse(

View File

@ -165,7 +165,9 @@ class FaceClassificationModel:
self.landmark_detector = cv2.face.createFacemarkLBF()
if os.path.isfile("/config/model_cache/facedet/landmarkdet.yaml"):
self.landmark_detector.loadModel("/config/model_cache/facedet/landmarkdet.yaml")
self.landmark_detector.loadModel(
"/config/model_cache/facedet/landmarkdet.yaml"
)
self.recognizer: cv2.face.LBPHFaceRecognizer = (
cv2.face.LBPHFaceRecognizer_create(