alexnasa commited on
Commit
41215b1
·
verified ·
1 Parent(s): 0915673

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -172,11 +172,11 @@ tag_model = ram(pretrained='preset/models/ram_swin_large_14m.pth',
172
  tag_model.eval()
173
  tag_model.to(device, dtype=weight_dtype)
174
 
175
- def preprocess_image(input_image: Image.Image):
176
- input_image = input_image.resize((256, 256), Image.Resampling.BILINEAR)
177
-
178
- return input_image
179
-
180
  @spaces.GPU()
181
  def process(
182
  input_image: Image.Image,
@@ -312,6 +312,10 @@ with gr.Blocks(css=css) as demo:
312
  [
313
  "preset/datasets/test_datasets/apologise.png",
314
  ],
 
 
 
 
315
  ],
316
  inputs=[
317
  input_image,
 
172
  tag_model.eval()
173
  tag_model.to(device, dtype=weight_dtype)
174
 
175
+ def preprocess_image(input_image: Image.Image) -> Image.Image:
176
+ img = input_image.copy()
177
+ img.thumbnail((256, 256), Image.Resampling.BILINEAR)
178
+ return img
179
+
180
  @spaces.GPU()
181
  def process(
182
  input_image: Image.Image,
 
312
  [
313
  "preset/datasets/test_datasets/apologise.png",
314
  ],
315
+ [
316
+ "preset/datasets/test_datasets/gummibears.png",
317
+ ],
318
+
319
  ],
320
  inputs=[
321
  input_image,