stphtan94117 commited on
Commit
1f182c3
·
1 Parent(s): a12d4a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -35,17 +35,17 @@ def yolo(im):
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]
39
- return [Image.fromarray(results.ims[0])]
40
 
41
 
42
 
43
 
44
 
45
  inputs = gr.inputs.Image(type='pil', label="Original Image")
46
- # outputs = [gr.outputs.Image(type="pil", label="Output Image"),
47
- # gr.outputs.JSON(label="Output JSON")]
48
- outputs = gr.outputs.Image(type="pil", label="Output Image")
49
 
50
  title = "TW_plate_number"
51
  description = "TW_plate_number"
 
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]
39
+ # return [Image.fromarray(results.ims[0])]
40
 
41
 
42
 
43
 
44
 
45
  inputs = gr.inputs.Image(type='pil', label="Original Image")
46
+ outputs = [gr.outputs.Image(type="pil", label="Output Image"),
47
+ gr.outputs.JSON(label="Output JSON")]
48
+ # outputs = gr.outputs.Image(type="pil", label="Output Image")
49
 
50
  title = "TW_plate_number"
51
  description = "TW_plate_number"