Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,9 +6,9 @@ import torch
|
|
6 |
|
7 |
def object_count(picture):
|
8 |
|
9 |
-
feature_extractor = DetrFeatureExtractor.from_pretrained("facebook/detr-resnet-
|
10 |
encoding = feature_extractor(picture, return_tensors="pt")
|
11 |
-
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-
|
12 |
outputs = model(**encoding)
|
13 |
# keep only predictions of queries with 0.9+ confidence (excluding no-object class)
|
14 |
probas = outputs.logits.softmax(-1)[0, :, :-1]
|
|
|
6 |
|
7 |
def object_count(picture):
|
8 |
|
9 |
+
feature_extractor = DetrFeatureExtractor.from_pretrained("facebook/detr-resnet-101-dc5")
|
10 |
encoding = feature_extractor(picture, return_tensors="pt")
|
11 |
+
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-101-dc5")
|
12 |
outputs = model(**encoding)
|
13 |
# keep only predictions of queries with 0.9+ confidence (excluding no-object class)
|
14 |
probas = outputs.logits.softmax(-1)[0, :, :-1]
|