Upload 4 files
Browse files- casting_loader.py +4 -4
- vision_tools.py +3 -10
casting_loader.py
CHANGED
|
@@ -34,12 +34,12 @@ except Exception as e:
|
|
| 34 |
chromadb = None # type: ignore
|
| 35 |
log.error("No se pudo importar chromadb: %s", e)
|
| 36 |
|
| 37 |
-
from
|
| 38 |
from collections import Counter
|
| 39 |
|
| 40 |
# Audio: reuse get_embedding from the existing pipeline
|
| 41 |
-
from
|
| 42 |
-
from
|
| 43 |
|
| 44 |
# Optional
|
| 45 |
try:
|
|
@@ -118,7 +118,7 @@ def aggregate_face_attributes(faces_dir: Path, out_csv: Path) -> int:
|
|
| 118 |
Usa FaceAnalyzer para extraer atributos.
|
| 119 |
"""
|
| 120 |
# Inicializa el analizador
|
| 121 |
-
|
| 122 |
analyzer = FaceAnalyzer()
|
| 123 |
|
| 124 |
rows: List[Dict[str, Any]] = []
|
|
|
|
| 34 |
chromadb = None # type: ignore
|
| 35 |
log.error("No se pudo importar chromadb: %s", e)
|
| 36 |
|
| 37 |
+
from vision_tools import FaceAnalyzer
|
| 38 |
from collections import Counter
|
| 39 |
|
| 40 |
# Audio: reuse get_embedding from the existing pipeline
|
| 41 |
+
from audio_tools import VoiceEmbedder
|
| 42 |
+
from vision_tools import FaceOfImageEmbedding
|
| 43 |
|
| 44 |
# Optional
|
| 45 |
try:
|
|
|
|
| 118 |
Usa FaceAnalyzer para extraer atributos.
|
| 119 |
"""
|
| 120 |
# Inicializa el analizador
|
| 121 |
+
# FaceAnalyzer already imported at module level
|
| 122 |
analyzer = FaceAnalyzer()
|
| 123 |
|
| 124 |
rows: List[Dict[str, Any]] = []
|
vision_tools.py
CHANGED
|
@@ -42,7 +42,7 @@ import os, base64, requests, subprocess, contextlib, time
|
|
| 42 |
from transformers import AutoProcessor, LlavaForConditionalGeneration
|
| 43 |
from PIL import Image
|
| 44 |
|
| 45 |
-
from
|
| 46 |
|
| 47 |
import cv2
|
| 48 |
|
|
@@ -51,14 +51,8 @@ try:
|
|
| 51 |
except Exception:
|
| 52 |
face_recognition = None # type: ignore
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
from libs.face_utils import FaceRecognizer as DFRecognizer
|
| 57 |
-
except Exception:
|
| 58 |
-
try:
|
| 59 |
-
from face_utils import FaceRecognizer as DFRecognizer
|
| 60 |
-
except Exception:
|
| 61 |
-
DFRecognizer = None # type: ignore
|
| 62 |
|
| 63 |
try:
|
| 64 |
from deepface import DeepFace
|
|
@@ -469,7 +463,6 @@ def process_frames(
|
|
| 469 |
|
| 470 |
# Crear embedding_model si no se pasa
|
| 471 |
if embedding_model is None:
|
| 472 |
-
from libs.vision_tools import FaceOfImageEmbedding
|
| 473 |
embedding_model = FaceOfImageEmbedding()
|
| 474 |
|
| 475 |
for idx, frame in enumerate(frames):
|
|
|
|
| 42 |
from transformers import AutoProcessor, LlavaForConditionalGeneration
|
| 43 |
from PIL import Image
|
| 44 |
|
| 45 |
+
from audio_tools import process_audio_for_video
|
| 46 |
|
| 47 |
import cv2
|
| 48 |
|
|
|
|
| 51 |
except Exception:
|
| 52 |
face_recognition = None # type: ignore
|
| 53 |
|
| 54 |
+
# FaceRecognizer not available in this deployment
|
| 55 |
+
DFRecognizer = None # type: ignore
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
try:
|
| 58 |
from deepface import DeepFace
|
|
|
|
| 463 |
|
| 464 |
# Crear embedding_model si no se pasa
|
| 465 |
if embedding_model is None:
|
|
|
|
| 466 |
embedding_model = FaceOfImageEmbedding()
|
| 467 |
|
| 468 |
for idx, frame in enumerate(frames):
|