Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py
Browse files
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(
|
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))
|