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/
|
.huggingface/
|
||||||
.cache/huggingface
|
.cache/huggingface
|
||||||
|
|
||||||
|
.immich_config.json
|
||||||
# Python-generated files
|
# Python-generated files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[oc]
|
*.py[oc]
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ Unified embedding interface for faces and objects.
|
|||||||
import contextlib
|
import contextlib
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import warnings
|
||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@@ -89,6 +90,10 @@ def get_face_embedding(img_pil: Image.Image) -> np.ndarray | None:
|
|||||||
try:
|
try:
|
||||||
# InsightFace expects BGR cv2 image
|
# InsightFace expects BGR cv2 image
|
||||||
img_bgr = cv2.cvtColor(np.asarray(img_pil), cv2.COLOR_RGB2BGR)
|
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)
|
faces = app.get(img_bgr)
|
||||||
|
|
||||||
if not faces:
|
if not faces:
|
||||||
|
|||||||
Reference in New Issue
Block a user