ixarchakos commited on
Commit
4d6431f
·
verified ·
1 Parent(s): 7b2c75c

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -47,7 +47,7 @@ vae_processor = diffusers.image_processor.VaeImageProcessor(
47
 
48
 
49
  def mask_generation(image, processor, model, category):
50
- inputs = processor(images=image, return_tensors="pt")
51
  outputs = model(**inputs)
52
  logits = outputs.logits.cpu()
53
 
@@ -98,7 +98,7 @@ def process(
98
  image = image_data["background"]
99
  processor = SegformerImageProcessor.from_pretrained("sayeed99/segformer_b3_clothes")
100
  model = AutoModelForSemanticSegmentation.from_pretrained("sayeed99/segformer_b3_clothes")
101
- model.to('cpu')
102
 
103
  # preprocess image
104
  image = image.convert("RGB").resize((image_width, image_height))
 
47
 
48
 
49
  def mask_generation(image, processor, model, category):
50
+ inputs = processor(images=image, return_tensors="pt").to("cuda")
51
  outputs = model(**inputs)
52
  logits = outputs.logits.cpu()
53
 
 
98
  image = image_data["background"]
99
  processor = SegformerImageProcessor.from_pretrained("sayeed99/segformer_b3_clothes")
100
  model = AutoModelForSemanticSegmentation.from_pretrained("sayeed99/segformer_b3_clothes")
101
+ model.to("cuda")
102
 
103
  # preprocess image
104
  image = image.convert("RGB").resize((image_width, image_height))