ajcasagrande commited on
Commit
afc4808
·
verified ·
1 Parent(s): aa46ad4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -22,11 +22,11 @@ def predict_image(img, conf_threshold, iou_threshold, model_name):
22
  )
23
 
24
  for r in results:
25
- im_array1 = r.plot(img=img.copy(), labels=False, line_width=2)
26
  im1 = Image.fromarray(im_array1[..., ::-1])
27
 
28
  for r in results:
29
- im_array2 = r.plot(img=img.copy(), line_width=2)
30
  im2 = Image.fromarray(im_array2[..., ::-1])
31
 
32
  # Calculate the dimensions for the output image
@@ -34,7 +34,7 @@ def predict_image(img, conf_threshold, iou_threshold, model_name):
34
  total_width = im1.width
35
 
36
  # Create a blank image with the combined height
37
- im = Image.new("RGB", (total_width, total_height))
38
 
39
  # Paste the images one above the other
40
  im.paste(im1, (0, 0))
@@ -53,10 +53,10 @@ iface = gr.Interface(
53
  ],
54
  outputs=gr.Image(type="pil", label="Result"),
55
  title="RC Race Vision YOLO11 Gradio Application 🚀",
56
- description="Upload images of RC Race Cars for inference. Currently supports 1/8th Buggies, and 1/10th Scale Buggies, Stadium Trucks, and Short Course Trucks. Not intended to work with close-up shots, works better on a wide view of the cars on a track.",
57
  examples=[
58
- # ["rc1.jpg", 0.25, 0.45],
59
- # ["rc2.jpg", 0.25, 0.45],
60
  ],
61
  )
62
  iface.launch(share=True)
 
22
  )
23
 
24
  for r in results:
25
+ im_array1 = r.plot(img=img.copy(), labels=False, line_width=4)
26
  im1 = Image.fromarray(im_array1[..., ::-1])
27
 
28
  for r in results:
29
+ im_array2 = r.plot(img=img.copy(), line_width=4, font_size=10)
30
  im2 = Image.fromarray(im_array2[..., ::-1])
31
 
32
  # Calculate the dimensions for the output image
 
34
  total_width = im1.width
35
 
36
  # Create a blank image with the combined height
37
+ im = Image.new("BGR", (total_width, total_height))
38
 
39
  # Paste the images one above the other
40
  im.paste(im1, (0, 0))
 
53
  ],
54
  outputs=gr.Image(type="pil", label="Result"),
55
  title="RC Race Vision YOLO11 Gradio Application 🚀",
56
+ description="Upload images of RC Race Cars for inference. \nCurrently supports 1/8th Buggies, and 1/10th Scale Buggies, Stadium Trucks, and Short Course Trucks.\nNot intended to work with close-up shots, works better on a wide view of the cars on a track.",
57
  examples=[
58
+ ["rc1.jpg", 0.25, 0.8],
59
+ ["rc2.jpg", 0.25, 0.8],
60
  ],
61
  )
62
  iface.launch(share=True)