Spaces:
Running
on
Zero
Running
on
Zero
Update utils/video_process.py
Browse files- utils/video_process.py +4 -1
utils/video_process.py
CHANGED
@@ -19,7 +19,7 @@ from models.av_mossformer2_tse.faceDetector.s3fd import S3FD
|
|
19 |
|
20 |
from .decode import decode_one_audio_AV_MossFormer2_TSE_16K
|
21 |
|
22 |
-
|
23 |
|
24 |
def process_tse(args, model, device, data_reader, output_wave_dir):
|
25 |
video_args = args_param()
|
@@ -162,6 +162,7 @@ def scene_detect(video_args):
|
|
162 |
sys.stderr.write('%s - scenes detected %d\n'%(video_args.videoFilePath, len(sceneList)))
|
163 |
return sceneList
|
164 |
|
|
|
165 |
def inference_video(video_args):
|
166 |
# GPU: Face detection, output is the list contains the face location and score in this frame
|
167 |
DET = S3FD(device=video_args.device)
|
@@ -181,6 +182,7 @@ def inference_video(video_args):
|
|
181 |
pickle.dump(dets, fil)
|
182 |
return dets
|
183 |
|
|
|
184 |
def bb_intersection_over_union(boxA, boxB, evalCol = False):
|
185 |
# CPU: IOU Function to calculate overlap between two image
|
186 |
xA = max(boxA[0], boxB[0])
|
@@ -268,6 +270,7 @@ def crop_video(video_args, track, cropFile):
|
|
268 |
return {'track':track, 'proc_track':dets}
|
269 |
|
270 |
|
|
|
271 |
def evaluate_network(files, video_args, args):
|
272 |
|
273 |
est_sources = []
|
|
|
19 |
|
20 |
from .decode import decode_one_audio_AV_MossFormer2_TSE_16K
|
21 |
|
22 |
+
import spaces
|
23 |
|
24 |
def process_tse(args, model, device, data_reader, output_wave_dir):
|
25 |
video_args = args_param()
|
|
|
162 |
sys.stderr.write('%s - scenes detected %d\n'%(video_args.videoFilePath, len(sceneList)))
|
163 |
return sceneList
|
164 |
|
165 |
+
@spaces.GPU(duration=100)
|
166 |
def inference_video(video_args):
|
167 |
# GPU: Face detection, output is the list contains the face location and score in this frame
|
168 |
DET = S3FD(device=video_args.device)
|
|
|
182 |
pickle.dump(dets, fil)
|
183 |
return dets
|
184 |
|
185 |
+
|
186 |
def bb_intersection_over_union(boxA, boxB, evalCol = False):
|
187 |
# CPU: IOU Function to calculate overlap between two image
|
188 |
xA = max(boxA[0], boxB[0])
|
|
|
270 |
return {'track':track, 'proc_track':dets}
|
271 |
|
272 |
|
273 |
+
@spaces.GPU(duration=100)
|
274 |
def evaluate_network(files, video_args, args):
|
275 |
|
276 |
est_sources = []
|