polejowska commited on
Commit
87bc0df
1 Parent(s): c4ccf70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -29,6 +29,8 @@ 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
  if "DETR" in model_name:
33
  model = DetrForObjectDetection.from_pretrained(MODELS_REPO[model_name])
34
  model_details = "DETR details"
@@ -43,7 +45,7 @@ def detect_objects(model_name, image_input, threshold, display_mask=False):
43
  mask_pil_image = None
44
  if display_mask:
45
  # get image path
46
- image_path = pathlib.Path(image_input.name)
47
  mask_path = image_path.parent / (
48
  image_path.stem.replace("_HE", "_mask") + image_path.suffix
49
  )
 
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])
36
  model_details = "DETR details"
 
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
  )