fffiloni commited on
Commit
3e582f1
·
1 Parent(s): fe57f32

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -128,9 +128,9 @@ def infer():
128
  diffused_img = generate_images(pil2diff_img, prompt)
129
  print(f"DIFFUSED IMG: {diffused_img[1]}")
130
 
131
- diffused_img[1].save("input1.jpg")
132
 
133
- input_frame_1 = read_image(str("input1.jpg"), ImageReadMode.UNCHANGED)
134
  print(f"FRAME 1: {input_frame_1}")
135
  input_frame_2 = read_image(str("./frame2.jpg"), ImageReadMode.UNCHANGED)
136
  print(f"FRAME 1: {input_frame_2}")
@@ -265,7 +265,7 @@ def infer():
265
  blend2 = Image.blend(res,blend2,0.5)
266
  blend2.save("blended2.jpg")
267
 
268
- return "done", "predicted_flow.jpg", ["flofile.flo"], 'raw_frame2.jpg', 'wraped.jpg', "blended2.jpg"
269
  ####################################
270
  # Bonus: Creating GIFs of predicted flows
271
  # ---------------------------------------
@@ -294,4 +294,4 @@ def infer():
294
  # ffmpeg -f image2 -framerate 30 -i predicted_flow_%d.jpg -loop -1 flow.gif
295
 
296
 
297
- gr.Interface(fn=infer, inputs=[], outputs=[gr.Textbox(), gr.Image(), gr.Files(), gr.Image(), gr.Image(), gr.Image()]).launch()
 
128
  diffused_img = generate_images(pil2diff_img, prompt)
129
  print(f"DIFFUSED IMG: {diffused_img[1]}")
130
 
131
+ diffused_img[1].save("diffused_input1.jpg")
132
 
133
+ input_frame_1 = read_image(str("diffused_input1.jpg"), ImageReadMode.UNCHANGED)
134
  print(f"FRAME 1: {input_frame_1}")
135
  input_frame_2 = read_image(str("./frame2.jpg"), ImageReadMode.UNCHANGED)
136
  print(f"FRAME 1: {input_frame_2}")
 
265
  blend2 = Image.blend(res,blend2,0.5)
266
  blend2.save("blended2.jpg")
267
 
268
+ return "done", "predicted_flow.jpg", ["flofile.flo"], "diffused_input1.jpg", 'raw_frame2.jpg', 'wraped.jpg', "blended2.jpg"
269
  ####################################
270
  # Bonus: Creating GIFs of predicted flows
271
  # ---------------------------------------
 
294
  # ffmpeg -f image2 -framerate 30 -i predicted_flow_%d.jpg -loop -1 flow.gif
295
 
296
 
297
+ gr.Interface(fn=infer, inputs=[], outputs=[gr.Textbox(), gr.Image(label="flow"), gr.Files(), gr.Image(label="diffused input"), gr.Image(), gr.Image(label="wraped flow to img2"), gr.Image(label="blended result to diffuse")]).launch()