Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,21 @@ model = snapshot_download(repo_id="akhaliq/frame-interpolation-film-style")
|
|
23 |
|
24 |
interpolator = interpolator.Interpolator(model, None)
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
def predict(frame1, frame2, times_to_interpolate):
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
input_frames = [str(frame1), str(frame2)]
|
29 |
|
|
|
23 |
|
24 |
interpolator = interpolator.Interpolator(model, None)
|
25 |
|
26 |
+
def resize(img):
|
27 |
+
basewidth = 300
|
28 |
+
img = Image.open(img)
|
29 |
+
wpercent = (basewidth/float(img.size[0]))
|
30 |
+
hsize = int((float(img.size[1])*float(wpercent)))
|
31 |
+
img = img.resize((basewidth,hsize), Image.ANTIALIAS)
|
32 |
+
return img
|
33 |
+
|
34 |
def predict(frame1, frame2, times_to_interpolate):
|
35 |
+
|
36 |
+
frame1 = resize(frame1)
|
37 |
+
frame2 = resize(frame2)
|
38 |
+
frame1 = frame1.save("test1.jpg")
|
39 |
+
frame2 = frame2.save("test2.jpg")
|
40 |
+
|
41 |
|
42 |
input_frames = [str(frame1), str(frame2)]
|
43 |
|