Update app.py
Browse files
app.py
CHANGED
@@ -4,18 +4,20 @@ import tempfile
|
|
4 |
from Fight_detec_func import fight_detec
|
5 |
from objec_detect_yolo import detection
|
6 |
|
7 |
-
def analyze_video(
|
8 |
-
# Save uploaded file to temp location
|
9 |
-
def analyze_video(video_file):
|
10 |
temp_dir = "/tmp"
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
19 |
|
20 |
# Clean up
|
21 |
os.remove(video_path)
|
|
|
4 |
from Fight_detec_func import fight_detec
|
5 |
from objec_detect_yolo import detection
|
6 |
|
7 |
+
def analyze_video(video_path):
|
|
|
|
|
8 |
temp_dir = "/tmp"
|
9 |
+
output_path = os.path.join(temp_dir, "output.mp4")
|
10 |
+
|
11 |
+
# Call your fight and object detection functions
|
12 |
+
fight_result = fight_detection(video_path)
|
13 |
+
crime_result, annotated_video_path = Crime(video_path)
|
14 |
+
|
15 |
+
return {
|
16 |
+
"Fight": fight_result,
|
17 |
+
"Crime": crime_result,
|
18 |
+
"Output Video": annotated_video_path
|
19 |
+
}
|
20 |
+
|
21 |
|
22 |
# Clean up
|
23 |
os.remove(video_path)
|