Spaces:
Running
Running
AMontiB
commited on
Commit
Β·
b3a3661
1
Parent(s):
a721e26
fix: add Gradio version compatibility and create .slugignore
Browse files- .slugignore +12 -0
- app.py +8 -1
.slugignore
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Exclude large files and directories not needed for Spaces
|
| 2 |
+
split.json
|
| 3 |
+
demo_images/
|
| 4 |
+
*.pt
|
| 5 |
+
*.pth
|
| 6 |
+
*.ckpt
|
| 7 |
+
*.safetensors
|
| 8 |
+
test_result*.json
|
| 9 |
+
__pycache__/
|
| 10 |
+
*.pyc
|
| 11 |
+
.DS_Store
|
| 12 |
+
.git
|
app.py
CHANGED
|
@@ -94,7 +94,14 @@ def predict(image_path, detector_name):
|
|
| 94 |
os.remove(output_path)
|
| 95 |
|
| 96 |
# Create Gradio Interface
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
gr.Markdown("# π Deepfake Detection Library")
|
| 99 |
gr.Markdown("""
|
| 100 |
Upload an image and select a detector to check if it's real or fake.
|
|
|
|
| 94 |
os.remove(output_path)
|
| 95 |
|
| 96 |
# Create Gradio Interface
|
| 97 |
+
# Use theme only if gradio version supports it
|
| 98 |
+
try:
|
| 99 |
+
demo = gr.Blocks(title="Deepfake Detection", theme=gr.themes.Soft())
|
| 100 |
+
except TypeError:
|
| 101 |
+
# Older gradio version doesn't support theme parameter
|
| 102 |
+
demo = gr.Blocks(title="Deepfake Detection")
|
| 103 |
+
|
| 104 |
+
with demo:
|
| 105 |
gr.Markdown("# π Deepfake Detection Library")
|
| 106 |
gr.Markdown("""
|
| 107 |
Upload an image and select a detector to check if it's real or fake.
|