Changed variable names
Browse files
app.py
CHANGED
@@ -31,8 +31,8 @@ def detect_objects(model_name,url_input,image_input,threshold):
|
|
31 |
processor = MaskFormerImageProcessor.from_pretrained(model_name)
|
32 |
model = MaskFormerForInstanceSegmentation.from_pretrained(model_name)
|
33 |
|
34 |
-
target_size = (
|
35 |
-
inputs = preprocessor(images=
|
36 |
with torch.no_grad():
|
37 |
outputs = model(**inputs)
|
38 |
outputs.class_queries_logits = outputs.class_queries_logits.cpu()
|
@@ -125,7 +125,7 @@ def set_example_url(example: list) -> dict:
|
|
125 |
return gr.Textbox.update(value=example[0])
|
126 |
|
127 |
|
128 |
-
title = """<h1 id="title">
|
129 |
|
130 |
description = """
|
131 |
Links to HuggingFace Models:
|
|
|
31 |
processor = MaskFormerImageProcessor.from_pretrained(model_name)
|
32 |
model = MaskFormerForInstanceSegmentation.from_pretrained(model_name)
|
33 |
|
34 |
+
target_size = (image.shape[0], image.shape[1])
|
35 |
+
inputs = preprocessor(images=image, return_tensors="pt")
|
36 |
with torch.no_grad():
|
37 |
outputs = model(**inputs)
|
38 |
outputs.class_queries_logits = outputs.class_queries_logits.cpu()
|
|
|
125 |
return gr.Textbox.update(value=example[0])
|
126 |
|
127 |
|
128 |
+
title = """<h1 id="title">Image Segmentation with Various Models</h1>"""
|
129 |
|
130 |
description = """
|
131 |
Links to HuggingFace Models:
|