Update app.py
Browse files
app.py
CHANGED
@@ -198,7 +198,7 @@ def infer():
|
|
198 |
transform = T.ToPILImage()
|
199 |
|
200 |
# convert the tensor to PIL image using above transform
|
201 |
-
img = transform(frames[
|
202 |
img = img.resize((960, 520))
|
203 |
# display the PIL image
|
204 |
#img.show()
|
@@ -230,7 +230,9 @@ def infer():
|
|
230 |
print(res)
|
231 |
res = Image.fromarray(res)
|
232 |
res.save('wraped.jpg')
|
233 |
-
|
|
|
|
|
234 |
####################################
|
235 |
# Bonus: Creating GIFs of predicted flows
|
236 |
# ---------------------------------------
|
@@ -259,4 +261,4 @@ def infer():
|
|
259 |
# ffmpeg -f image2 -framerate 30 -i predicted_flow_%d.jpg -loop -1 flow.gif
|
260 |
|
261 |
|
262 |
-
gr.Interface(fn=infer, inputs=[], outputs=[gr.Textbox(), gr.Image(), gr.Files(), gr.Image(), gr.Image()]).launch()
|
|
|
198 |
transform = T.ToPILImage()
|
199 |
|
200 |
# convert the tensor to PIL image using above transform
|
201 |
+
img = transform(frames[101])
|
202 |
img = img.resize((960, 520))
|
203 |
# display the PIL image
|
204 |
#img.show()
|
|
|
230 |
print(res)
|
231 |
res = Image.fromarray(res)
|
232 |
res.save('wraped.jpg')
|
233 |
+
image4 = Image.blend(res,frame1pil,0.5)
|
234 |
+
image4.save("output2.jpg")
|
235 |
+
return "done", "predicted_flow.jpg", ["flofile.flo"], 'frame_input.jpg', 'wraped.jpg', "output2.jpg"
|
236 |
####################################
|
237 |
# Bonus: Creating GIFs of predicted flows
|
238 |
# ---------------------------------------
|
|
|
261 |
# ffmpeg -f image2 -framerate 30 -i predicted_flow_%d.jpg -loop -1 flow.gif
|
262 |
|
263 |
|
264 |
+
gr.Interface(fn=infer, inputs=[], outputs=[gr.Textbox(), gr.Image(), gr.Files(), gr.Image(), gr.Image(), gr.Image()]).launch()
|