stphtan94117 commited on
Commit
2d4ae78
·
1 Parent(s): 6dd03df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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'].tolist() # 可以把[['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]