Spaces:
Sleeping
Sleeping
Got stuff confused
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import torch
|
|
| 6 |
import pathlib
|
| 7 |
from PIL import Image
|
| 8 |
|
| 9 |
-
from transformers import DetrFeatureExtractor, DetrForSegmentation,
|
| 10 |
from transformers.models.detr.feature_extraction_detr import rgb_to_id
|
| 11 |
|
| 12 |
|
|
@@ -72,7 +72,7 @@ def segment_images(model_name,url_input,image_input,threshold):
|
|
| 72 |
pass
|
| 73 |
elif "maskformer" in model_name.lower():
|
| 74 |
# Load the processor and model
|
| 75 |
-
processor =
|
| 76 |
print(type(processor))
|
| 77 |
model = MaskFormerForInstanceSegmentation.from_pretrained(model_name)
|
| 78 |
|
|
|
|
| 6 |
import pathlib
|
| 7 |
from PIL import Image
|
| 8 |
|
| 9 |
+
from transformers import DetrFeatureExtractor, DetrForSegmentation, MaskFormerFeatureExtractor, MaskFormerForInstanceSegmentation
|
| 10 |
from transformers.models.detr.feature_extraction_detr import rgb_to_id
|
| 11 |
|
| 12 |
|
|
|
|
| 72 |
pass
|
| 73 |
elif "maskformer" in model_name.lower():
|
| 74 |
# Load the processor and model
|
| 75 |
+
processor = MaskFormerFeatureExtractor.from_pretrained(model_name)
|
| 76 |
print(type(processor))
|
| 77 |
model = MaskFormerForInstanceSegmentation.from_pretrained(model_name)
|
| 78 |
|