Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -155,9 +155,10 @@ def video_clip(program,fps,qual,model_name,denoise_strength,face_enhance,outscal
|
|
| 155 |
def gif_clip(program,fps,qual,model_name,denoise_strength,face_enhance,outscale):
|
| 156 |
_=None
|
| 157 |
fps=float(fps)
|
|
|
|
| 158 |
if program == 'imageio':
|
| 159 |
-
print (f"adjusting fps from: {fps} to: {fps
|
| 160 |
-
|
| 161 |
new_video_in = str(f"{uid}-clip.mp4")
|
| 162 |
capture = cv2.VideoCapture(new_video_in)
|
| 163 |
frame_count = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
|
|
@@ -189,7 +190,7 @@ def gif_clip(program,fps,qual,model_name,denoise_strength,face_enhance,outscale)
|
|
| 189 |
else:
|
| 190 |
clip = ImageSequenceClip(fbox, fps = fps)
|
| 191 |
yield _,_,"Writing GIF"
|
| 192 |
-
clip.to_gif(f"{uid}/clip_gif.gif",program=program)
|
| 193 |
#clip.speedx(2).to_gif(f"{uid}/clip_gif.gif",program=program)
|
| 194 |
out = f"{uid}/clip_gif.gif"
|
| 195 |
yield out,out,"GIF Complete"
|
|
|
|
| 155 |
def gif_clip(program,fps,qual,model_name,denoise_strength,face_enhance,outscale):
|
| 156 |
_=None
|
| 157 |
fps=float(fps)
|
| 158 |
+
|
| 159 |
if program == 'imageio':
|
| 160 |
+
print (f"NOT adjusting fps from: {fps} to: {fps*2}")
|
| 161 |
+
|
| 162 |
new_video_in = str(f"{uid}-clip.mp4")
|
| 163 |
capture = cv2.VideoCapture(new_video_in)
|
| 164 |
frame_count = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
|
|
|
|
| 190 |
else:
|
| 191 |
clip = ImageSequenceClip(fbox, fps = fps)
|
| 192 |
yield _,_,"Writing GIF"
|
| 193 |
+
clip.to_gif(f"{uid}/clip_gif.gif",fps=fps, program=program)
|
| 194 |
#clip.speedx(2).to_gif(f"{uid}/clip_gif.gif",program=program)
|
| 195 |
out = f"{uid}/clip_gif.gif"
|
| 196 |
yield out,out,"GIF Complete"
|