fix: suppress scikit-image FutureWarning during face processing and add .immich_config.json to gitignore.
This commit is contained in:
@@ -6,6 +6,7 @@ yolov9c.pt
|
||||
.huggingface/
|
||||
.cache/huggingface
|
||||
|
||||
.immich_config.json
|
||||
# Python-generated files
|
||||
__pycache__/
|
||||
*.py[oc]
|
||||
|
||||
@@ -8,6 +8,7 @@ Unified embedding interface for faces and objects.
|
||||
import contextlib
|
||||
import logging
|
||||
import os
|
||||
import warnings
|
||||
|
||||
import cv2
|
||||
import numpy as np
|
||||
@@ -89,6 +90,10 @@ def get_face_embedding(img_pil: Image.Image) -> np.ndarray | None:
|
||||
try:
|
||||
# InsightFace expects BGR cv2 image
|
||||
img_bgr = cv2.cvtColor(np.asarray(img_pil), cv2.COLOR_RGB2BGR)
|
||||
|
||||
# Suppress scikit-image FutureWarning from InsightFace's face_align.py
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings("ignore", message=".*estimate.*is deprecated", category=FutureWarning)
|
||||
faces = app.get(img_bgr)
|
||||
|
||||
if not faces:
|
||||
|
||||
Reference in New Issue
Block a user