VeuReu commited on
Commit
b1de1ba
·
verified ·
1 Parent(s): 8fea277

Update preprocessing_router.py

Browse files
Files changed (1) hide show
  1. preprocessing_router.py +13 -0
preprocessing_router.py CHANGED
@@ -24,6 +24,8 @@ import asr_client
24
  from sklearn.cluster import KMeans
25
  from sklearn.neighbors import KNeighborsClassifier
26
 
 
 
27
 
28
  ROOT = Path("/tmp/veureu")
29
  ROOT.mkdir(parents=True, exist_ok=True)
@@ -239,6 +241,8 @@ async def finalize_casting(
239
  print("\n" + "="*50)
240
  print(f"DEBUG: RECIBIENDO PERSONAJES PARA EL VÍDEO: {video_name}")
241
  print("="*50)
 
 
242
 
243
  for idx, char in enumerate(characters):
244
  c_name = char.get("name", "Sin nombre")
@@ -249,10 +253,19 @@ async def finalize_casting(
249
  print(f" 📂 Carpeta origen: {c_folder}")
250
  print(f" 🖼️ Archivos seleccionados ({len(c_files)}):")
251
  for f in c_files:
 
 
252
  print(f" - {f}")
 
 
 
 
 
253
  print("-" * 30)
254
  print("="*50 + "\n")
255
 
 
 
256
  MEDIA_ROOT = _P("/data/media")
257
  video_hash = find_video_hash(video_name+".mp4",MEDIA_ROOT)
258
  if not video_name or not base_dir:
 
24
  from sklearn.cluster import KMeans
25
  from sklearn.neighbors import KNeighborsClassifier
26
 
27
+ from svision_client import get_face_embeddings_simple
28
+
29
 
30
  ROOT = Path("/tmp/veureu")
31
  ROOT.mkdir(parents=True, exist_ok=True)
 
241
  print("\n" + "="*50)
242
  print(f"DEBUG: RECIBIENDO PERSONAJES PARA EL VÍDEO: {video_name}")
243
  print("="*50)
244
+
245
+ casting_json = {"face_col": [], "voice_col": []}
246
 
247
  for idx, char in enumerate(characters):
248
  c_name = char.get("name", "Sin nombre")
 
253
  print(f" 📂 Carpeta origen: {c_folder}")
254
  print(f" 🖼️ Archivos seleccionados ({len(c_files)}):")
255
  for f in c_files:
256
+ emb = get_face_embeddings_simple(f)
257
+ print(emb)
258
  print(f" - {f}")
259
+ casting_json["face_col"].append({
260
+ "nombre": c_name,
261
+ "embedding": emb,
262
+ })
263
+
264
  print("-" * 30)
265
  print("="*50 + "\n")
266
 
267
+ print(casting_json)
268
+
269
  MEDIA_ROOT = _P("/data/media")
270
  video_hash = find_video_hash(video_name+".mp4",MEDIA_ROOT)
271
  if not video_name or not base_dir: