Spaces:
Runtime error
Runtime error
polejowska
commited on
Commit
•
4941dcd
1
Parent(s):
87bc0df
Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ def make_prediction(img, feature_extractor, model):
|
|
29 |
def detect_objects(model_name, image_input, threshold, display_mask=False):
|
30 |
feature_extractor = AutoFeatureExtractor.from_pretrained(MODELS_REPO[model_name])
|
31 |
|
32 |
-
print(image_input)
|
33 |
|
34 |
if "DETR" in model_name:
|
35 |
model = DetrForObjectDetection.from_pretrained(MODELS_REPO[model_name])
|
@@ -45,7 +45,7 @@ def detect_objects(model_name, image_input, threshold, display_mask=False):
|
|
45 |
mask_pil_image = None
|
46 |
if display_mask:
|
47 |
# get image path
|
48 |
-
image_path = pathlib.Path(image_input)
|
49 |
mask_path = image_path.parent / (
|
50 |
image_path.stem.replace("_HE", "_mask") + image_path.suffix
|
51 |
)
|
|
|
29 |
def detect_objects(model_name, image_input, threshold, display_mask=False):
|
30 |
feature_extractor = AutoFeatureExtractor.from_pretrained(MODELS_REPO[model_name])
|
31 |
|
32 |
+
print(image_input.filename)
|
33 |
|
34 |
if "DETR" in model_name:
|
35 |
model = DetrForObjectDetection.from_pretrained(MODELS_REPO[model_name])
|
|
|
45 |
mask_pil_image = None
|
46 |
if display_mask:
|
47 |
# get image path
|
48 |
+
image_path = pathlib.Path(image_input.filename)
|
49 |
mask_path = image_path.parent / (
|
50 |
image_path.stem.replace("_HE", "_mask") + image_path.suffix
|
51 |
)
|