Search code examples
gradio

Drawing Bounding Boxes with Gradio


I have an YOLO Classified image with bounding boxes but how do i draw the same bounding boxes on my output image in Gradio Webapp and is there anyway for me to make the user adjust the bounding boxes in gradio?

The gr.outputs.BoundingBox and gr.outputs.ImageBoundingBox does not work in gradio newer versions.


Solution

  • Currently, drawing Bounding Boxes directly in gradio is not possible. You have to render them yourself onto the image in your python code. The drawback of this is that the user can not adjust the boxes on the UI.

    Note, there is a recent PR that has been declined. There also is a possible workaround by obtaining the bounding boxes through the cropped image.