Spaces:
Runtime error
Runtime error
yiyixuxu
commited on
Commit
·
f238f1a
1
Parent(s):
9d4b51e
testing
Browse files
app.py
CHANGED
|
@@ -61,6 +61,7 @@ def process_video_parallel(video, skip_frames, dest_path, num_processes, process
|
|
| 61 |
break
|
| 62 |
filename =f"{dest_path}/{count}.jpg"
|
| 63 |
cv2.imwrite(filename, frame)
|
|
|
|
| 64 |
count += skip_frames # Skip 300 frames i.e. 10 seconds for 30 fps
|
| 65 |
cap.release()
|
| 66 |
|
|
@@ -87,7 +88,7 @@ def vid2frames(url, sampling_interval=1, ext='mp4'):
|
|
| 87 |
print(f'video saved at: {video}, fps:{fps}, skip_frames: {skip_frames}')
|
| 88 |
# extract video frames at given sampling interval with multiprocessing -
|
| 89 |
print('extracting frames...')
|
| 90 |
-
n_workers = min(os.cpu_count(),
|
| 91 |
# testing..
|
| 92 |
cap = cv2.VideoCapture(video)
|
| 93 |
print(f'video: {video}; isOpen? : {cap.isOpened()}')
|
|
|
|
| 61 |
break
|
| 62 |
filename =f"{dest_path}/{count}.jpg"
|
| 63 |
cv2.imwrite(filename, frame)
|
| 64 |
+
print(f"saved {filename}")
|
| 65 |
count += skip_frames # Skip 300 frames i.e. 10 seconds for 30 fps
|
| 66 |
cap.release()
|
| 67 |
|
|
|
|
| 88 |
print(f'video saved at: {video}, fps:{fps}, skip_frames: {skip_frames}')
|
| 89 |
# extract video frames at given sampling interval with multiprocessing -
|
| 90 |
print('extracting frames...')
|
| 91 |
+
n_workers = min(os.cpu_count(), 1)
|
| 92 |
# testing..
|
| 93 |
cap = cv2.VideoCapture(video)
|
| 94 |
print(f'video: {video}; isOpen? : {cap.isOpened()}')
|