Upload 2 files
Browse files- api.py +3 -3
- character_detection.py +2 -2
api.py
CHANGED
|
@@ -114,9 +114,9 @@ async def process_video(
|
|
| 114 |
async def create_initial_casting(
|
| 115 |
background_tasks: BackgroundTasks,
|
| 116 |
video: UploadFile = File(...),
|
| 117 |
-
max_groups: int = Form(default=
|
| 118 |
min_cluster_size: int = Form(default=3),
|
| 119 |
-
voice_max_groups: int = Form(default=
|
| 120 |
voice_min_cluster_size: int = Form(default=3),
|
| 121 |
max_frames: int = Form(default=100),
|
| 122 |
):
|
|
@@ -726,7 +726,7 @@ def serve_scene_file(video_name: str, scene_id: str, filename: str):
|
|
| 726 |
@app.post("/detect_scenes")
|
| 727 |
async def detect_scenes(
|
| 728 |
video: UploadFile = File(...),
|
| 729 |
-
max_groups: int = Form(default=
|
| 730 |
min_cluster_size: int = Form(default=3),
|
| 731 |
frame_interval_sec: float = Form(default=0.5),
|
| 732 |
):
|
|
|
|
| 114 |
async def create_initial_casting(
|
| 115 |
background_tasks: BackgroundTasks,
|
| 116 |
video: UploadFile = File(...),
|
| 117 |
+
max_groups: int = Form(default=3),
|
| 118 |
min_cluster_size: int = Form(default=3),
|
| 119 |
+
voice_max_groups: int = Form(default=3),
|
| 120 |
voice_min_cluster_size: int = Form(default=3),
|
| 121 |
max_frames: int = Form(default=100),
|
| 122 |
):
|
|
|
|
| 726 |
@app.post("/detect_scenes")
|
| 727 |
async def detect_scenes(
|
| 728 |
video: UploadFile = File(...),
|
| 729 |
+
max_groups: int = Form(default=3),
|
| 730 |
min_cluster_size: int = Form(default=3),
|
| 731 |
frame_interval_sec: float = Form(default=0.5),
|
| 732 |
):
|
character_detection.py
CHANGED
|
@@ -303,7 +303,7 @@ class CharacterDetector:
|
|
| 303 |
|
| 304 |
return analysis_path
|
| 305 |
|
| 306 |
-
def detect_characters(self, max_groups: int =
|
| 307 |
*, start_offset_sec: float = 3.0, extract_every_sec: float = 0.5) -> Tuple[List[Dict], Path, np.ndarray, List[Dict[str, Any]]]:
|
| 308 |
"""
|
| 309 |
Pipeline completo de detecci贸n de personajes con clustering jer谩rquico.
|
|
@@ -338,7 +338,7 @@ class CharacterDetector:
|
|
| 338 |
|
| 339 |
# Funci贸n de conveniencia para usar en el API
|
| 340 |
def detect_characters_from_video(video_path: str, output_base: str,
|
| 341 |
-
max_groups: int =
|
| 342 |
video_name: str = None,
|
| 343 |
*, start_offset_sec: float = 3.0, extract_every_sec: float = 0.5) -> Dict[str, Any]:
|
| 344 |
"""
|
|
|
|
| 303 |
|
| 304 |
return analysis_path
|
| 305 |
|
| 306 |
+
def detect_characters(self, max_groups: int = 3, min_cluster_size: int = 3,
|
| 307 |
*, start_offset_sec: float = 3.0, extract_every_sec: float = 0.5) -> Tuple[List[Dict], Path, np.ndarray, List[Dict[str, Any]]]:
|
| 308 |
"""
|
| 309 |
Pipeline completo de detecci贸n de personajes con clustering jer谩rquico.
|
|
|
|
| 338 |
|
| 339 |
# Funci贸n de conveniencia para usar en el API
|
| 340 |
def detect_characters_from_video(video_path: str, output_base: str,
|
| 341 |
+
max_groups: int = 3, min_cluster_size: int = 3,
|
| 342 |
video_name: str = None,
|
| 343 |
*, start_offset_sec: float = 3.0, extract_every_sec: float = 0.5) -> Dict[str, Any]:
|
| 344 |
"""
|