Trying to understand the code so I have to do this in parts
Browse files
app.py
CHANGED
@@ -71,6 +71,12 @@ def segment_images(model_name,url_input,image_input,threshold):
|
|
71 |
if "detr" in model_name:
|
72 |
pass
|
73 |
elif "maskformer" in model_name.lower():
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
pass
|
75 |
else:
|
76 |
raise NameError("Model is not implemented")
|
|
|
71 |
if "detr" in model_name:
|
72 |
pass
|
73 |
elif "maskformer" in model_name.lower():
|
74 |
+
# Load the processor and model
|
75 |
+
processor = MaskFormerForInstanceSegmentation.from_pretrained(model_name)
|
76 |
+
print(type(processor))
|
77 |
+
model = MaskFormerForInstanceSegmentation.from_pretrained(model_name)
|
78 |
+
|
79 |
+
inputs = processor(images=image, return_tensors="pt")
|
80 |
pass
|
81 |
else:
|
82 |
raise NameError("Model is not implemented")
|