Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,4 @@
|
|
1 |
from transformers import pipeline
|
2 |
-
pipe = pipeline("object-detection",model="facebook/detr-resnet-50")
|
3 |
-
output = pipe("multi-object.jpg")
|
4 |
-
print("Object Detection: ")
|
5 |
-
prettier(output)
|
6 |
|
7 |
def prettier(results):
|
8 |
for item in results:
|
@@ -10,3 +6,9 @@ def prettier(results):
|
|
10 |
label = item('label')
|
11 |
location = [round(value,2) for value in item['box'].values()]
|
12 |
print(f'Detected{label} with confidence {score} at location {location}')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from transformers import pipeline
|
|
|
|
|
|
|
|
|
2 |
|
3 |
def prettier(results):
|
4 |
for item in results:
|
|
|
6 |
label = item('label')
|
7 |
location = [round(value,2) for value in item['box'].values()]
|
8 |
print(f'Detected{label} with confidence {score} at location {location}')
|
9 |
+
|
10 |
+
pipe = pipeline("object-detection",model="facebook/detr-resnet-50")
|
11 |
+
output = pipe("multi-object.jpg")
|
12 |
+
print("Object Detection: ")
|
13 |
+
prettier(output)
|
14 |
+
|