Metadata-Version: 2.1
Name: plotbbox
Version: 0.1.0
Summary: A package to plot pretty bounding boxes for object detection task
Home-page: https://github.com/developer0hye/plotbbox
Author: Yonghye Kwon
Author-email: developer.0hye@gmail.com
License: UNKNOWN
Keywords: object-detection,bounding-box,bbox,box
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Education
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: opencv-python
Requires-Dist: Pillow

# plotbbox
A package to plot pretty bounding boxes for object detection task

<p align="center"><img src=https://raw.githubusercontent.com/developer0hye/plotbbox/master/figures/figure_1_examples.png width="85%"></p>

![](https://raw.githubusercontent.com/developer0hye/plotbbox/master/figures/figure_1_examples.png)
![](https://raw.githubusercontent.com/mconigliaro/smtptester/master/screenshots/smtptester-gui.png)

# 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)
```


