mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-18 17:14:26 +03:00
Formatting
This commit is contained in:
parent
c9445ac3f5
commit
585a2b2f93
@ -50,7 +50,9 @@ async def register_face(request: Request, name: str, file: UploadFile):
|
|||||||
@router.post("/faces/train/{name}/classify")
|
@router.post("/faces/train/{name}/classify")
|
||||||
def train_face(name: str, body: dict = None):
|
def train_face(name: str, body: dict = None):
|
||||||
json: dict[str, any] = body or {}
|
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):
|
if not training_file or not os.path.isfile(training_file):
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
|
|||||||
@ -165,7 +165,9 @@ class FaceClassificationModel:
|
|||||||
self.landmark_detector = cv2.face.createFacemarkLBF()
|
self.landmark_detector = cv2.face.createFacemarkLBF()
|
||||||
|
|
||||||
if os.path.isfile("/config/model_cache/facedet/landmarkdet.yaml"):
|
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 = (
|
self.recognizer: cv2.face.LBPHFaceRecognizer = (
|
||||||
cv2.face.LBPHFaceRecognizer_create(
|
cv2.face.LBPHFaceRecognizer_create(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user