polejowska commited on
Commit
4b92437
1 Parent(s): 4941dcd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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.filename)
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.filename)
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.value)
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.value)
49
  mask_path = image_path.parent / (
50
  image_path.stem.replace("_HE", "_mask") + image_path.suffix
51
  )