Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,8 +31,8 @@ def get_frame_count(filepath):
|
|
| 31 |
video.release()
|
| 32 |
|
| 33 |
#LIMITS
|
| 34 |
-
|
| 35 |
-
|
| 36 |
|
| 37 |
return gr.update(maximum=frame_count)
|
| 38 |
|
|
@@ -140,12 +140,12 @@ def run_inference(prompt, video_path, condition, video_length, seed, steps):
|
|
| 140 |
|
| 141 |
# Get FPS of original video input
|
| 142 |
target_fps = get_video_dimension(video_path)[2]
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
|
| 150 |
# Count total frames according to fps
|
| 151 |
total_frames = get_video_dimension(video_path)[3]
|
|
|
|
| 31 |
video.release()
|
| 32 |
|
| 33 |
#LIMITS
|
| 34 |
+
if frame_count > 24 :
|
| 35 |
+
frame_count = 24 # limit to 24 frames to avoid cuDNN errors
|
| 36 |
|
| 37 |
return gr.update(maximum=frame_count)
|
| 38 |
|
|
|
|
| 140 |
|
| 141 |
# Get FPS of original video input
|
| 142 |
target_fps = get_video_dimension(video_path)[2]
|
| 143 |
+
if target_fps > 12 :
|
| 144 |
+
print(f"FPS is too high: {target_fps}")
|
| 145 |
+
# video_length = int((12 * video_length) / target_fps)
|
| 146 |
+
|
| 147 |
+
target_fps = 12
|
| 148 |
+
print(f"NEW INPUT FPS: {target_fps}, NEW FPS: {video_length}")
|
| 149 |
|
| 150 |
# Count total frames according to fps
|
| 151 |
total_frames = get_video_dimension(video_path)[3]
|