Update app.py
Browse files
app.py
CHANGED
@@ -41,10 +41,10 @@ def do_interpolation(frame1, frame2, times_to_interpolate):
|
|
41 |
def get_frames(video_in, step, name):
|
42 |
frames = []
|
43 |
#resize the video
|
44 |
-
|
45 |
-
cframes = int(
|
46 |
-
cfps = int(
|
47 |
-
print(f'
|
48 |
|
49 |
#clip = VideoFileClip(video_in)
|
50 |
|
@@ -61,7 +61,7 @@ def get_frames(video_in, step, name):
|
|
61 |
#print("video resized to 1024 height")
|
62 |
|
63 |
# Opens the Video file with CV2
|
64 |
-
cap =
|
65 |
|
66 |
fps = cap.get(cv2.CAP_PROP_FPS)
|
67 |
print("video fps: " + str(fps))
|
@@ -170,7 +170,7 @@ with gr.Blocks() as demo:
|
|
170 |
file_output = gr.File()
|
171 |
|
172 |
gr.Examples(
|
173 |
-
examples=[["./examples/
|
174 |
fn=infer,
|
175 |
inputs=[video_input,interpolation,fps_output],
|
176 |
outputs=[video_output,file_output],
|
|
|
41 |
def get_frames(video_in, step, name):
|
42 |
frames = []
|
43 |
#resize the video
|
44 |
+
cap = cv2.VideoCapture(video_in)
|
45 |
+
cframes = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
|
46 |
+
cfps = int(cap.get(cv2.CAP_PROP_FPS))
|
47 |
+
print(f'frames: {cframes}, fps: {cfps}')
|
48 |
|
49 |
#clip = VideoFileClip(video_in)
|
50 |
|
|
|
61 |
#print("video resized to 1024 height")
|
62 |
|
63 |
# Opens the Video file with CV2
|
64 |
+
#cap = cv2.VideoCapture("video_resized.mp4")
|
65 |
|
66 |
fps = cap.get(cv2.CAP_PROP_FPS)
|
67 |
print("video fps: " + str(fps))
|
|
|
170 |
file_output = gr.File()
|
171 |
|
172 |
gr.Examples(
|
173 |
+
examples=[["./examples/no_framerate.mp4", 1, 8]],
|
174 |
fn=infer,
|
175 |
inputs=[video_input,interpolation,fps_output],
|
176 |
outputs=[video_output,file_output],
|