George Rey commited on
Commit
09052ae
·
1 Parent(s): 77c028f

upgrade gradio version

Browse files
Files changed (4) hide show
  1. .gitignore +1 -0
  2. app.py +13 -11
  3. img1A_512x512.jpg +0 -0
  4. img1B_512x512.jpg +0 -0
.gitignore CHANGED
@@ -1,2 +1,3 @@
1
  .idea
 
2
 
 
1
  .idea
2
+ __pycache__
3
 
app.py CHANGED
@@ -40,22 +40,24 @@ with gr.Blocks() as demo:
40
  with gr.Row() as image_pair:
41
  with gr.Column() as image_A:
42
  image_A = gr.Image(
43
- shape=(512, 512),
44
  label="Image A",
45
- value="https://picsum.photos/seed/4/512/512",
46
- interactive = False)
47
- bt_image_A_better = gr.Button(value="Left image is better", label="Image A is better", )
48
- bt_image_A_better.click(set_image_A_better)
 
49
 
50
- with gr.Column() as image_B:
51
  image_B = gr.Image(
52
- shape=(512, 512),
53
  label="Image B",
54
- value="https://picsum.photos/seed/4/512/512/?blur=2",
55
- interactive = False
56
  )
57
- bt_image_B_better = gr.Button(value="Right image is better", label="Image B is better")
58
- bt_image_B_better.click(set_image_B_better)
 
59
 
60
  if __name__ == "__main__":
61
  demo.launch(show_api=False)
 
40
  with gr.Row() as image_pair:
41
  with gr.Column() as image_A:
42
  image_A = gr.Image(
43
+ height=512, width=512,
44
  label="Image A",
45
+ value="img1A_512x512.jpg",
46
+ interactive=False)
47
+ with gr.Row():
48
+ bt_image_A_better = gr.Button(value="Left image is better")
49
+ bt_image_A_better.click(set_image_A_better)
50
 
51
+ with gr.Column(min_width=512) as image_B:
52
  image_B = gr.Image(
53
+ height=512, width=512,
54
  label="Image B",
55
+ value="img1A_512x512.jpg",
56
+ interactive=False
57
  )
58
+ with gr.Row():
59
+ bt_image_B_better = gr.Button(value="Right image is better",)
60
+ bt_image_B_better.click(set_image_B_better)
61
 
62
  if __name__ == "__main__":
63
  demo.launch(show_api=False)
img1A_512x512.jpg ADDED
img1B_512x512.jpg ADDED