csgaobb commited on
Commit
6b40055
·
1 Parent(s): 7705c32

fix the resize pre-process

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -70,10 +70,10 @@ def process_image(prompt_img, query_img, options):
70
  query_img = pil_to_tensor(query_img).float() / 255.0
71
  prompt_img = pil_to_tensor(prompt_img).float() / 255.0
72
 
73
- if query_img.shape[1] != img_size:
74
- resize_trans = K.augmentation.Resize([img_size, img_size], return_transform=True)
75
- query_img = resize_trans(query_img)[0]
76
- prompt_img = resize_trans(prompt_img)[0]
77
 
78
 
79
  test_data = {
@@ -110,6 +110,8 @@ examples = [
110
  ["images/134.png", "images/000.png", "model-256"],
111
  ["images/036.png", "images/024.png", "model-256"],
112
  ["images/178.png", "images/003.png", "model-256"],
 
 
113
  ]
114
 
115
  # Gradio interface layout
 
70
  query_img = pil_to_tensor(query_img).float() / 255.0
71
  prompt_img = pil_to_tensor(prompt_img).float() / 255.0
72
 
73
+ # Resize image
74
+ resize_trans = K.augmentation.Resize([img_size, img_size], return_transform=True)
75
+ query_img = resize_trans(query_img)[0]
76
+ prompt_img = resize_trans(prompt_img)[0]
77
 
78
 
79
  test_data = {
 
110
  ["images/134.png", "images/000.png", "model-256"],
111
  ["images/036.png", "images/024.png", "model-256"],
112
  ["images/178.png", "images/003.png", "model-256"],
113
+ ["images/img1-02.jpg", "images/img1-03.jpg", "model-256"]
114
+ ["images/img2-03.jpg", "images/img2-03.jpg", "model-256"]
115
  ]
116
 
117
  # Gradio interface layout