YannisK commited on
Commit
301fdb0
·
1 Parent(s): 2ece78a
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -93,7 +93,7 @@ def generate_matching_superfeatures(im1, im2, scale_id=6, threshold=50, sf_ids='
93
  fin_img = []
94
  img1rsz = np.copy(im1_cv)
95
  print('im1:', im1.size)
96
- print(img1rsz.shape)
97
  for j, att in enumerate(all_att_bin1):
98
  att = cv2.resize(att, im1.size, interpolation=cv2.INTER_NEAREST)
99
  # att = cv2.resize(att, imgz[i].shape[:2][::-1], interpolation=cv2.INTER_CUBIC)
@@ -109,6 +109,8 @@ def generate_matching_superfeatures(im1, im2, scale_id=6, threshold=50, sf_ids='
109
  fin_img.append(img1rsz)
110
 
111
  img2rsz = np.copy(im2_cv)
 
 
112
  for j, att in enumerate(all_att_bin2):
113
  att = cv2.resize(att, im2.size, interpolation=cv2.INTER_NEAREST)
114
  # att = cv2.resize(att, imgz[i].shape[:2][::-1], interpolation=cv2.INTER_CUBIC)
@@ -171,8 +173,10 @@ css = ".input_image, .input_image {height: 600px !important; width: 600px !impor
171
  iface = gr.Interface(
172
  fn=generate_matching_superfeatures,
173
  inputs=[
174
- gr.inputs.Image(shape=(1024, 1024), type="pil", label="First Image"),
175
- gr.inputs.Image(shape=(1024, 1024), type="pil", label="Second Image"),
 
 
176
  gr.inputs.Slider(minimum=0, maximum=6, step=1, default=2, label="Scale"),
177
  gr.inputs.Slider(minimum=1, maximum=255, step=25, default=100, label="Binarization Threshold"),
178
  gr.inputs.Textbox(lines=1, default="", label="Super-feature IDs to show", optional=True)],
 
93
  fin_img = []
94
  img1rsz = np.copy(im1_cv)
95
  print('im1:', im1.size)
96
+ print('img1rsz:', img1rsz.shape)
97
  for j, att in enumerate(all_att_bin1):
98
  att = cv2.resize(att, im1.size, interpolation=cv2.INTER_NEAREST)
99
  # att = cv2.resize(att, imgz[i].shape[:2][::-1], interpolation=cv2.INTER_CUBIC)
 
109
  fin_img.append(img1rsz)
110
 
111
  img2rsz = np.copy(im2_cv)
112
+ print('im2:', im2.size)
113
+ print('img2rsz:', img2rsz.shape)
114
  for j, att in enumerate(all_att_bin2):
115
  att = cv2.resize(att, im2.size, interpolation=cv2.INTER_NEAREST)
116
  # att = cv2.resize(att, imgz[i].shape[:2][::-1], interpolation=cv2.INTER_CUBIC)
 
173
  iface = gr.Interface(
174
  fn=generate_matching_superfeatures,
175
  inputs=[
176
+ # gr.inputs.Image(shape=(1024, 1024), type="pil", label="First Image"),
177
+ # gr.inputs.Image(shape=(1024, 1024), type="pil", label="Second Image"),
178
+ gr.inputs.Image(type="pil", label="First Image"),
179
+ gr.inputs.Image(type="pil", label="Second Image"),
180
  gr.inputs.Slider(minimum=0, maximum=6, step=1, default=2, label="Scale"),
181
  gr.inputs.Slider(minimum=1, maximum=255, step=25, default=100, label="Binarization Threshold"),
182
  gr.inputs.Textbox(lines=1, default="", label="Super-feature IDs to show", optional=True)],