Update app.py
Browse files
app.py
CHANGED
|
@@ -252,7 +252,7 @@ def _get_face_embedding_casting(image: Image.Image) -> list[dict] | None:
|
|
| 252 |
|
| 253 |
except Exception as e:
|
| 254 |
print(f"Face embedding failed: {e}")
|
| 255 |
-
return
|
| 256 |
|
| 257 |
@spaces.GPU
|
| 258 |
def _get_face_embedding(
|
|
@@ -306,7 +306,7 @@ def _get_face_embedding(
|
|
| 306 |
|
| 307 |
except Exception as e:
|
| 308 |
print(f"Face embedding failed: {e}")
|
| 309 |
-
return
|
| 310 |
|
| 311 |
@spaces.GPU
|
| 312 |
def _get_scenes_extraction(
|
|
@@ -396,7 +396,7 @@ def _get_scenes_extraction(
|
|
| 396 |
|
| 397 |
except Exception as e:
|
| 398 |
print("Error in scenes_extraction:", e)
|
| 399 |
-
return
|
| 400 |
|
| 401 |
@spaces.GPU
|
| 402 |
def _get_image_list_description(
|
|
@@ -598,7 +598,11 @@ def _get_ocr_characters_to_image(
|
|
| 598 |
|
| 599 |
except Exception as e:
|
| 600 |
print(f"OCR error: {e}")
|
| 601 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
| 602 |
|
| 603 |
# Final structured output with metadata, faces, and OCR
|
| 604 |
informacion_image_completo = {
|
|
@@ -1197,5 +1201,5 @@ with gr.Blocks(title="Salamandra Vision 7B 路 ZeroGPU", css=custom_css,theme=gr.
|
|
| 1197 |
concurrency_limit=1
|
| 1198 |
)
|
| 1199 |
|
| 1200 |
-
demo.queue(max_size=16).launch(show_error=True,share=True
|
| 1201 |
|
|
|
|
| 252 |
|
| 253 |
except Exception as e:
|
| 254 |
print(f"Face embedding failed: {e}")
|
| 255 |
+
return []
|
| 256 |
|
| 257 |
@spaces.GPU
|
| 258 |
def _get_face_embedding(
|
|
|
|
| 306 |
|
| 307 |
except Exception as e:
|
| 308 |
print(f"Face embedding failed: {e}")
|
| 309 |
+
return []
|
| 310 |
|
| 311 |
@spaces.GPU
|
| 312 |
def _get_scenes_extraction(
|
|
|
|
| 396 |
|
| 397 |
except Exception as e:
|
| 398 |
print("Error in scenes_extraction:", e)
|
| 399 |
+
return [], []
|
| 400 |
|
| 401 |
@spaces.GPU
|
| 402 |
def _get_image_list_description(
|
|
|
|
| 598 |
|
| 599 |
except Exception as e:
|
| 600 |
print(f"OCR error: {e}")
|
| 601 |
+
return {"id": informacion_image_dict["index"],
|
| 602 |
+
"start": informacion_image_dict["start"],
|
| 603 |
+
"end": informacion_image_dict["end"],
|
| 604 |
+
"faces": faces_detected,
|
| 605 |
+
"ocr": ""}
|
| 606 |
|
| 607 |
# Final structured output with metadata, faces, and OCR
|
| 608 |
informacion_image_completo = {
|
|
|
|
| 1201 |
concurrency_limit=1
|
| 1202 |
)
|
| 1203 |
|
| 1204 |
+
demo.queue(max_size=16).launch(show_error=True,share=True)
|
| 1205 |
|