Spaces:
Runtime error
Runtime error
Commit
Β·
c382687
1
Parent(s):
04f2345
V0
Browse files
app.py
CHANGED
|
@@ -587,7 +587,7 @@ def create_gradio_interface():
|
|
| 587 |
|
| 588 |
with gr.Blocks(title="Car Damage & Deepfake Detector", theme=theme) as app:
|
| 589 |
gr.Markdown("""
|
| 590 |
-
# π Car Damage
|
| 591 |
|
| 592 |
Upload a car image to:
|
| 593 |
1. Detect damaged areas
|
|
@@ -596,45 +596,6 @@ def create_gradio_interface():
|
|
| 596 |
*This app requires both damage detection and deepfake models to be installed.*
|
| 597 |
""")
|
| 598 |
|
| 599 |
-
# System status indicator
|
| 600 |
-
with gr.Row():
|
| 601 |
-
damage_model_status = gr.Label(label="Damage Model", value="Checking...", elem_id="damage-status")
|
| 602 |
-
deepfake_model_status = gr.Label(label="Deepfake Model", value="Checking...", elem_id="deepfake-status")
|
| 603 |
-
detectron2_status = gr.Label(label="Detectron2", value="Checking...", elem_id="detectron2-status")
|
| 604 |
-
|
| 605 |
-
# Update system status
|
| 606 |
-
def update_system_status():
|
| 607 |
-
status = {
|
| 608 |
-
"damage_model": "Not Found",
|
| 609 |
-
"deepfake_model": "Not Found",
|
| 610 |
-
"deepfake_cfg": "Not Found",
|
| 611 |
-
"detectron2": "Not Installed"
|
| 612 |
-
}
|
| 613 |
-
|
| 614 |
-
# Check model files
|
| 615 |
-
if os.path.exists(DEFAULT_DAMAGE_MODEL_PATH):
|
| 616 |
-
status["damage_model"] = "Available β
"
|
| 617 |
-
else:
|
| 618 |
-
status["damage_model"] = "Not Found β"
|
| 619 |
-
|
| 620 |
-
if os.path.exists(DEFAULT_DEEPFAKE_MODEL_PATH):
|
| 621 |
-
status["deepfake_model"] = "Available β
"
|
| 622 |
-
else:
|
| 623 |
-
status["deepfake_model"] = "Not Found β"
|
| 624 |
-
|
| 625 |
-
if os.path.exists(DEFAULT_DEEPFAKE_CFG_PATH):
|
| 626 |
-
status["deepfake_cfg"] = "Available β
"
|
| 627 |
-
else:
|
| 628 |
-
status["deepfake_cfg"] = "Not Found β"
|
| 629 |
-
|
| 630 |
-
# Check Detectron2
|
| 631 |
-
if DETECTRON2_AVAILABLE:
|
| 632 |
-
status["detectron2"] = "Installed β
"
|
| 633 |
-
else:
|
| 634 |
-
status["detectron2"] = "Not Installed β"
|
| 635 |
-
|
| 636 |
-
return status["damage_model"], status["deepfake_model"], status["detectron2"]
|
| 637 |
-
|
| 638 |
# Main Interface Tab
|
| 639 |
with gr.Tab("Analyze Image"):
|
| 640 |
with gr.Row():
|
|
@@ -918,13 +879,6 @@ def create_gradio_interface():
|
|
| 918 |
outputs=paths_result
|
| 919 |
)
|
| 920 |
|
| 921 |
-
# Update system status on load
|
| 922 |
-
app.load(
|
| 923 |
-
fn=update_system_status,
|
| 924 |
-
inputs=[],
|
| 925 |
-
outputs=[damage_model_status, deepfake_model_status, detectron2_status]
|
| 926 |
-
)
|
| 927 |
-
|
| 928 |
return app
|
| 929 |
|
| 930 |
if __name__ == "__main__":
|
|
|
|
| 587 |
|
| 588 |
with gr.Blocks(title="Car Damage & Deepfake Detector", theme=theme) as app:
|
| 589 |
gr.Markdown("""
|
| 590 |
+
# π Car Damage fraud Detector
|
| 591 |
|
| 592 |
Upload a car image to:
|
| 593 |
1. Detect damaged areas
|
|
|
|
| 596 |
*This app requires both damage detection and deepfake models to be installed.*
|
| 597 |
""")
|
| 598 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 599 |
# Main Interface Tab
|
| 600 |
with gr.Tab("Analyze Image"):
|
| 601 |
with gr.Row():
|
|
|
|
| 879 |
outputs=paths_result
|
| 880 |
)
|
| 881 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 882 |
return app
|
| 883 |
|
| 884 |
if __name__ == "__main__":
|