Moved some code that was in the way
Browse files
app.py
CHANGED
@@ -57,8 +57,6 @@ def visualize_prediction(pil_img, output_dict, threshold=0.7, id2label=None):
|
|
57 |
|
58 |
def detect_objects(model_name,url_input,image_input,threshold):
|
59 |
|
60 |
-
#Extract model and feature extractor
|
61 |
-
feature_extractor = AutoFeatureExtractor.from_pretrained(model_name)
|
62 |
|
63 |
if 'yolov8' in model_name:
|
64 |
# Working on getting this to work, another approach
|
@@ -77,6 +75,9 @@ def detect_objects(model_name,url_input,image_input,threshold):
|
|
77 |
|
78 |
return render, ""
|
79 |
else:
|
|
|
|
|
|
|
80 |
if 'detr' in model_name:
|
81 |
|
82 |
model = DetrForObjectDetection.from_pretrained(model_name)
|
|
|
57 |
|
58 |
def detect_objects(model_name,url_input,image_input,threshold):
|
59 |
|
|
|
|
|
60 |
|
61 |
if 'yolov8' in model_name:
|
62 |
# Working on getting this to work, another approach
|
|
|
75 |
|
76 |
return render, ""
|
77 |
else:
|
78 |
+
|
79 |
+
#Extract model and feature extractor
|
80 |
+
feature_extractor = AutoFeatureExtractor.from_pretrained(model_name)
|
81 |
if 'detr' in model_name:
|
82 |
|
83 |
model = DetrForObjectDetection.from_pretrained(model_name)
|