mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-22 13:47:29 +02:00
Ensure doesn't fail due to missing dir
This commit is contained in:
parent
060659044e
commit
3d605b75a6
@ -30,6 +30,9 @@ router = APIRouter(tags=[Tags.events])
|
||||
def get_faces():
|
||||
face_dict: dict[str, list[str]] = {}
|
||||
|
||||
if not os.path.exists(FACE_DIR):
|
||||
return JSONResponse(status_code=200, content={})
|
||||
|
||||
for name in os.listdir(FACE_DIR):
|
||||
face_dir = os.path.join(FACE_DIR, name)
|
||||
|
||||
|
@ -506,6 +506,7 @@ class FaceRealTimeProcessor(RealTimeProcessorApi):
|
||||
if self.config.face_recognition.save_attempts:
|
||||
# write face to library
|
||||
folder = os.path.join(FACE_DIR, "train")
|
||||
os.makedirs(folder, exist_ok=True)
|
||||
new_file = os.path.join(
|
||||
folder, f"{id}-{sub_label}-{score}-{face_score}.webp"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user