polejowska commited on
Commit
dfd9053
·
1 Parent(s): 0f361d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -27,10 +27,11 @@ def make_prediction(img, feature_extractor, model):
27
  def detect_objects(model_name, attention_heads_num, image_input, threshold, display_mask=False, img_input_mask=None):
28
  if "CONDITIONAL-DETR" in model_name:
29
  model_repo = f"polejowska/cdetr-r50-cd45rb-all-4ah"
30
- model = DetrForObjectDetection.from_pretrained(model_repo)
31
  else:
32
  model_repo = f"polejowska/detr-r50-cd45rb-all-{str(attention_heads_num)}ah"
33
- model = ConditionalDetrForObjectDetection.from_pretrained(model_repo)
 
34
 
35
  feature_extractor = AutoFeatureExtractor.from_pretrained(model_repo)
36
 
 
27
  def detect_objects(model_name, attention_heads_num, image_input, threshold, display_mask=False, img_input_mask=None):
28
  if "CONDITIONAL-DETR" in model_name:
29
  model_repo = f"polejowska/cdetr-r50-cd45rb-all-4ah"
30
+ model = ConditionalDetrForObjectDetection.from_pretrained(model_repo)
31
  else:
32
  model_repo = f"polejowska/detr-r50-cd45rb-all-{str(attention_heads_num)}ah"
33
+ model = DetrForObjectDetection.from_pretrained(model_repo)
34
+
35
 
36
  feature_extractor = AutoFeatureExtractor.from_pretrained(model_repo)
37