https://github.com/developer0hye/plotbbox
A package to plot pretty bounding boxes for object detection task
https://github.com/developer0hye/plotbbox
bounding-box bounding-boxes centernet coco efficientdet fcos object-detection plot plot-bbox rcnn ssd visualisation visualization voc yolo
Last synced: 5 months ago
JSON representation
A package to plot pretty bounding boxes for object detection task
- Host: GitHub
- URL: https://github.com/developer0hye/plotbbox
- Owner: developer0hye
- License: mit
- Created: 2021-02-25T12:11:30.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-26T14:05:59.000Z (almost 5 years ago)
- Last Synced: 2025-08-28T00:37:19.161Z (6 months ago)
- Topics: bounding-box, bounding-boxes, centernet, coco, efficientdet, fcos, object-detection, plot, plot-bbox, rcnn, ssd, visualisation, visualization, voc, yolo
- Language: Python
- Homepage: https://github.com/developer0hye
- Size: 19.2 MB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# plotbbox
A package to plot pretty bounding boxes for object detection task

# Install
```python
pip install plotbbox
```
# Example Usage
```python
import cv2
from plotbbox import plotBBox
img = cv2.imread("your_img.png")
label_table = {0: "person", 1: "car"}
color_table = {0: [0, 255, 0], 1: [0, 0, 255]} # order: b, g, r
bboxes = your_detection_algorithm(img) # Shape: (N, 5), [:, 0]: class index, [:, 1:]: xmin, ymin, xmax, ymax
for bbox in bboxes:
class_idx = bbox[0]
xmin, ymin, xmax, ymax = bbox[1:]
plotBBox(img,
xmin, ymin, xmax, ymax, color=color_table[class_idx], thickness=1,
label=label_table[class_idx]) # plot bounding box on img
cv2.imwrite("bboxes_plotted_your_img.png", img)
```
Read [docs/example.py](https://github.com/developer0hye/plotbbox/blob/main/docs/example.py) and run for more details!