aolko commited on
Commit
3cc1e25
1 Parent(s): 980f584

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -1,6 +1,4 @@
1
  import gradio as gr
2
- import torch
3
- from torchvision import transforms
4
  from PIL import Image
5
  import requests
6
  from diffusers import StableDiffusionPipeline
@@ -32,11 +30,7 @@ def merge_tags(tags1, tags2):
32
  # Gradio app functions
33
  def process_image(image, mode):
34
  # Convert the image to a format suitable for the models
35
- transform = transforms.Compose([
36
- transforms.Resize((256, 256)),
37
- transforms.ToTensor()
38
- ])
39
- image = transform(image).unsqueeze(0)
40
 
41
  if mode == "Anime":
42
  is_anime, similar_images, original_tags = check_anime_image(image)
 
1
  import gradio as gr
 
 
2
  from PIL import Image
3
  import requests
4
  from diffusers import StableDiffusionPipeline
 
30
  # Gradio app functions
31
  def process_image(image, mode):
32
  # Convert the image to a format suitable for the models
33
+ image = image.resize((256, 256))
 
 
 
 
34
 
35
  if mode == "Anime":
36
  is_anime, similar_images, original_tags = check_anime_image(image)