Spaces:
Sleeping
Sleeping
stphtan94117
commited on
Commit
·
2d4ae78
1
Parent(s):
6dd03df
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ def yolo(im):
|
|
32 |
results = model(im, size=1280) # inference
|
33 |
results.render() # updates results.imgs with boxes and labels
|
34 |
|
35 |
-
df = results.pandas().xyxy[0].sort_values('xmin')['name'].
|
36 |
res = json.loads(df)
|
37 |
|
38 |
return [Image.fromarray(results.ims[0]), res]
|
|
|
32 |
results = model(im, size=1280) # inference
|
33 |
results.render() # updates results.imgs with boxes and labels
|
34 |
|
35 |
+
df = results.pandas().xyxy[0].sort_values('xmin')[['name']].to_json(orient="records") # 可以把[['name']]刪除即可顯示全部
|
36 |
res = json.loads(df)
|
37 |
|
38 |
return [Image.fromarray(results.ims[0]), res]
|