Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,9 +12,6 @@ def predict_suspicious_activity(image):
|
|
12 |
results_img = results[0].plot()
|
13 |
return Image.fromarray(results_img)
|
14 |
|
15 |
-
# Create a temporary directory for examples if needed
|
16 |
-
os.makedirs("examples", exist_ok=True)
|
17 |
-
|
18 |
# Create Gradio interface with reliable example images
|
19 |
interface = gr.Interface(
|
20 |
fn=predict_suspicious_activity,
|
@@ -45,12 +42,12 @@ interface = gr.Interface(
|
|
45 |
css=".footer {margin-top: 20px; padding: 15px; border-top: 1px solid #eee; text-align: center; color: #666;} footer {visibility: hidden}"
|
46 |
)
|
47 |
|
48 |
-
#
|
49 |
-
|
|
|
50 |
share=True,
|
51 |
server_port=7860,
|
52 |
show_api=False,
|
53 |
-
enable_queue=True,
|
54 |
favicon_path="https://raw.githubusercontent.com/ultralytics/assets/main/logo-Ultralytics.svg",
|
55 |
analytics_enabled=False
|
56 |
)
|
|
|
12 |
results_img = results[0].plot()
|
13 |
return Image.fromarray(results_img)
|
14 |
|
|
|
|
|
|
|
15 |
# Create Gradio interface with reliable example images
|
16 |
interface = gr.Interface(
|
17 |
fn=predict_suspicious_activity,
|
|
|
42 |
css=".footer {margin-top: 20px; padding: 15px; border-top: 1px solid #eee; text-align: center; color: #666;} footer {visibility: hidden}"
|
43 |
)
|
44 |
|
45 |
+
# Correct way to enable queue in newer Gradio versions
|
46 |
+
# Call .queue() before .launch()
|
47 |
+
interface.queue().launch(
|
48 |
share=True,
|
49 |
server_port=7860,
|
50 |
show_api=False,
|
|
|
51 |
favicon_path="https://raw.githubusercontent.com/ultralytics/assets/main/logo-Ultralytics.svg",
|
52 |
analytics_enabled=False
|
53 |
)
|