djl234 commited on
Commit
98bb1c0
·
1 Parent(s): 6112cd4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -67,7 +67,7 @@ def sepia(opt,img1):
67
  #result_list=[result_list[i].resize((w_list[i], h_list[i]), Image.BILINEAR) for i in range(5)]
68
  #img1,img2,img3,img4,img5=result_list#test('cpu',net,img_list,5,224)
69
  #white=(torch.ones(img1.shape[0],2,3)*255).numpy().astype(np.uint8)
70
-
71
  output=cv2.imread('bike'+opt.replace(':','_')+'.png')
72
  output=cv2.resize(output,(output.shape[1]*256//output.shape[0],256))
73
  return output[:,:,::-1]#np.concatenate([img1,white,img2,white,img3,white,img4,white,img5],axis=1)
@@ -81,7 +81,7 @@ with gr.Blocks() as demo:
81
  #drop1 = gr.Dropdown(["cat", "dog", "bird"], label="Animal", info="Will add more animals later!")
82
 
83
  #checklist1 = gr.CheckboxGroup(["4:3", "3:4", "16:9"], label="Shape", info="The shape of cropped image")
84
- radio2 = gr.Radio(["9:16", "3:4","1:1","4:3", "16:9"], value="3:4",label="Shape", info="The shape of cropped image")
85
  #radio1 = gr.Radio(["park", "zoo", "road"], label="Location", info="Where did they go?")
86
  src_img1 = gr.Image()
87
  bottom1 = gr.Button(label="cropping component")
 
67
  #result_list=[result_list[i].resize((w_list[i], h_list[i]), Image.BILINEAR) for i in range(5)]
68
  #img1,img2,img3,img4,img5=result_list#test('cpu',net,img_list,5,224)
69
  #white=(torch.ones(img1.shape[0],2,3)*255).numpy().astype(np.uint8)
70
+ name='bike'+opt.replace(':','_')+'.png'
71
  output=cv2.imread('bike'+opt.replace(':','_')+'.png')
72
  output=cv2.resize(output,(output.shape[1]*256//output.shape[0],256))
73
  return output[:,:,::-1]#np.concatenate([img1,white,img2,white,img3,white,img4,white,img5],axis=1)
 
81
  #drop1 = gr.Dropdown(["cat", "dog", "bird"], label="Animal", info="Will add more animals later!")
82
 
83
  #checklist1 = gr.CheckboxGroup(["4:3", "3:4", "16:9"], label="Shape", info="The shape of cropped image")
84
+ radio2 = gr.Radio(["9:16", "3:4","1:1","4:3", "16:9","circle"], value="3:4",label="Shape", info="The shape of cropped image")
85
  #radio1 = gr.Radio(["park", "zoo", "road"], label="Location", info="Where did they go?")
86
  src_img1 = gr.Image()
87
  bottom1 = gr.Button(label="cropping component")