fffiloni commited on
Commit
6a04784
1 Parent(s): f48b93c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -34,7 +34,7 @@ def create_video(frames, fps):
34
  return 'movie.mp4'
35
 
36
 
37
- def infer(prompt,video_in):
38
  break_vid = get_frames(video_in)
39
 
40
  frames_list= break_vid[0]
@@ -42,7 +42,7 @@ def infer(prompt,video_in):
42
  result_frames = []
43
 
44
  for i in frames_list:
45
- pix2pix_img = pix2pix(prompt,5.5,1.5,i,15,"",512,512,123456,fn_index=0)
46
  images = [os.path.join(pix2pix_img[0], img) for img in os.listdir(pix2pix_img[0])]
47
  result_frames.append(images[0])
48
 
@@ -53,16 +53,16 @@ def infer(prompt,video_in):
53
 
54
  with gr.Blocks(css='style.css') as demo:
55
  with gr.Column(elem_id="col-container"):
56
- prompt = gr.Textbox(placeholder="enter prompt")
57
- video_inp = gr.Video(source="upload", type="filepath")
58
- video_out = gr.Video()
59
-
60
- submit_btn = gr.Button("go")
 
 
 
61
 
62
- inputs = [
63
- prompt,
64
- video_inp
65
- ]
66
  outputs = [video_out]
67
 
68
  submit_btn.click(infer, inputs, outputs)
 
34
  return 'movie.mp4'
35
 
36
 
37
+ def infer(prompt,video_in, seed_in):
38
  break_vid = get_frames(video_in)
39
 
40
  frames_list= break_vid[0]
 
42
  result_frames = []
43
 
44
  for i in frames_list:
45
+ pix2pix_img = pix2pix(prompt,5.5,1.5,i,15,"",512,512,seed_in,fn_index=0)
46
  images = [os.path.join(pix2pix_img[0], img) for img in os.listdir(pix2pix_img[0])]
47
  result_frames.append(images[0])
48
 
 
53
 
54
  with gr.Blocks(css='style.css') as demo:
55
  with gr.Column(elem_id="col-container"):
56
+ with gr.Row():
57
+ with gr.Column():
58
+ prompt = gr.Textbox(placeholder="enter prompt")
59
+ video_inp = gr.Video(source="upload", type="filepath")
60
+ seed_inp = Number(value=123456)
61
+ with gr.Column():
62
+ video_out = gr.Video()
63
+ submit_btn = gr.Button("Generate Pix2Pix video")
64
 
65
+ inputs = [prompt,video_inp,seed_inp]
 
 
 
66
  outputs = [video_out]
67
 
68
  submit_btn.click(infer, inputs, outputs)