seifbenayed commited on
Commit
9c3f062
·
1 Parent(s): f8e7da8
Files changed (1) hide show
  1. app.py +20 -0
app.py CHANGED
@@ -520,6 +520,26 @@ def auto_install_dependencies():
520
  print(f"Error installing dependencies: {e}")
521
  return False
522
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
523
  def create_gradio_interface():
524
  # Define a theme
525
  theme = gr.themes.Soft(
 
520
  print(f"Error installing dependencies: {e}")
521
  return False
522
 
523
+ def check_model_paths(damage_path, deepfake_path):
524
+ """Check if model paths are valid and exist"""
525
+ output = ["## Path Verification Results\n"]
526
+
527
+ # Check damage model
528
+ if os.path.exists(damage_path):
529
+ file_size = os.path.getsize(damage_path) / (1024 * 1024) # Size in MB
530
+ output.append(f"✅ **Damage model:** Found at {damage_path} ({file_size:.2f} MB)")
531
+ else:
532
+ output.append(f"❌ **Damage model:** NOT found at {damage_path}")
533
+
534
+ # Check deepfake model
535
+ if os.path.exists(deepfake_path):
536
+ file_size = os.path.getsize(deepfake_path) / (1024 * 1024) # Size in MB
537
+ output.append(f"✅ **ViT deepfake model:** Found at {deepfake_path} ({file_size:.2f} MB)")
538
+ else:
539
+ output.append(f"❌ **ViT deepfake model:** NOT found at {deepfake_path}")
540
+
541
+ return "\n".join(output)
542
+
543
  def create_gradio_interface():
544
  # Define a theme
545
  theme = gr.themes.Soft(