Spaces:
Running on Zero
Running on Zero
Fixed spaces CUDA
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import cv2
|
| 2 |
import gradio as gr
|
| 3 |
import numpy as np
|
|
@@ -68,6 +69,7 @@ def generate_visual_attribution(model, preprocess, rgb_image, query_string, grid
|
|
| 68 |
return output_image
|
| 69 |
|
| 70 |
# 3. Main Pipeline Execution
|
|
|
|
| 71 |
def process_video_and_query(video_path, query_string, sample_rate_sec=1):
|
| 72 |
if not video_path:
|
| 73 |
return None, "Please upload a video file."
|
|
@@ -200,4 +202,4 @@ with gr.Blocks(title="Zero-Shot Video Safety Auditor") as demo:
|
|
| 200 |
)
|
| 201 |
|
| 202 |
if __name__ == "__main__":
|
| 203 |
-
demo.launch()
|
|
|
|
| 1 |
+
import spaces
|
| 2 |
import cv2
|
| 3 |
import gradio as gr
|
| 4 |
import numpy as np
|
|
|
|
| 69 |
return output_image
|
| 70 |
|
| 71 |
# 3. Main Pipeline Execution
|
| 72 |
+
@spaces.GPU
|
| 73 |
def process_video_and_query(video_path, query_string, sample_rate_sec=1):
|
| 74 |
if not video_path:
|
| 75 |
return None, "Please upload a video file."
|
|
|
|
| 202 |
)
|
| 203 |
|
| 204 |
if __name__ == "__main__":
|
| 205 |
+
demo.launch(ssr_mode=False)
|