Spaces:
Sleeping
Sleeping
Anne Marthe Sophie Ngo Bibinbe
commited on
Commit
·
065a535
1
Parent(s):
064eb52
promptTrack installed
Browse files- app.py +4 -10
- requirements.txt +6 -6
app.py
CHANGED
@@ -159,12 +159,9 @@ import gradio as gr
|
|
159 |
import shutil
|
160 |
import os
|
161 |
import subprocess
|
162 |
-
import gradio as gr
|
163 |
-
import shutil
|
164 |
-
import os
|
165 |
import sys
|
166 |
# Run the .bat file before launching the app
|
167 |
-
try:
|
168 |
import PromptTrack
|
169 |
except ImportError:
|
170 |
print("PromptTrack not found. Installing...")
|
@@ -178,10 +175,7 @@ except ImportError:
|
|
178 |
|
179 |
|
180 |
from PromptTrack import PromptTracker
|
181 |
-
|
182 |
-
#initialize PromptTrack
|
183 |
-
|
184 |
-
tracker = PromptTracker()
|
185 |
def process_video(video_path, prompt):
|
186 |
detection_threshold=0.3
|
187 |
track_thresh=0.4
|
@@ -192,8 +186,8 @@ def process_video(video_path, prompt):
|
|
192 |
output_file = video_path.split('mp4')[0]+"_mot_.json" # Tracking result
|
193 |
output_file_2 = video_path.split('mp4')[0]+"_object_detection.json" # detection results
|
194 |
|
195 |
-
|
196 |
-
tracker.detect_objects(video_file, prompt=prompt, nms_threshold=0.8, detection_threshold=detection_threshold, detector="OWL-VITV2")
|
197 |
tracker.process_mot(video_file, fixed_parc=True, track_thresh=track_thresh, match_thresh=match_thresh, frame_rate=25, max_time_lost=max_time_lost, nbr_frames_fixing=nbr_frames_fixing)
|
198 |
tracker.read_video_with_mot(video_file, fps=25)
|
199 |
"""
|
|
|
159 |
import shutil
|
160 |
import os
|
161 |
import subprocess
|
|
|
|
|
|
|
162 |
import sys
|
163 |
# Run the .bat file before launching the app
|
164 |
+
"""try:
|
165 |
import PromptTrack
|
166 |
except ImportError:
|
167 |
print("PromptTrack not found. Installing...")
|
|
|
175 |
|
176 |
|
177 |
from PromptTrack import PromptTracker
|
178 |
+
tracker = PromptTracker()"""
|
|
|
|
|
|
|
179 |
def process_video(video_path, prompt):
|
180 |
detection_threshold=0.3
|
181 |
track_thresh=0.4
|
|
|
186 |
output_file = video_path.split('mp4')[0]+"_mot_.json" # Tracking result
|
187 |
output_file_2 = video_path.split('mp4')[0]+"_object_detection.json" # detection results
|
188 |
|
189 |
+
video_file = video_path
|
190 |
+
"""tracker.detect_objects(video_file, prompt=prompt, nms_threshold=0.8, detection_threshold=detection_threshold, detector="OWL-VITV2")
|
191 |
tracker.process_mot(video_file, fixed_parc=True, track_thresh=track_thresh, match_thresh=match_thresh, frame_rate=25, max_time_lost=max_time_lost, nbr_frames_fixing=nbr_frames_fixing)
|
192 |
tracker.read_video_with_mot(video_file, fps=25)
|
193 |
"""
|
requirements.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
1 |
|
2 |
+
accelerate
|
3 |
+
diffusers
|
4 |
+
invisible_watermark
|
5 |
+
torch
|
6 |
+
transformers
|
7 |
+
xformers
|