Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nalepae/bounding-box
Bounding Box is a library to plot pretty bounding boxes with a simple Python API.
https://github.com/nalepae/bounding-box
bounding-boxes computer-vision python visualization
Last synced: 11 days ago
JSON representation
Bounding Box is a library to plot pretty bounding boxes with a simple Python API.
- Host: GitHub
- URL: https://github.com/nalepae/bounding-box
- Owner: nalepae
- License: bsd-3-clause
- Created: 2019-06-13T19:08:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-14T21:28:57.000Z (6 months ago)
- Last Synced: 2024-10-16T00:41:49.706Z (26 days ago)
- Topics: bounding-boxes, computer-vision, python, visualization
- Language: Python
- Homepage:
- Size: 3.63 MB
- Stars: 95
- Watchers: 2
- Forks: 18
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bounding Box
**Bounding Box** is a library to plot pretty bounding boxes with a simple Python API.*Please notice this lib does **not** do object detection for you, but only helps to display pretty bounding boxes with a carefully chosen set of colors.*
**WARNING:** Version 1.0 of this library is not yet released. API breaking changes could still occur!
Please see below some examples of bounding boxes plotted with this library.
## Installation
`$ pip install bounding-box [--user]`## API
First, you have to import `bounding_box`:
```python
from bounding_box import bounding_box as bb
```Then, just add the bounding box on an image.
```python
bb.add(image, left, top, right, bottom, label, color)
```This method takes 5 mandatory parameters:
- `image`: A numpy array, channel last (ie. height x width x colors) with
channels in **BGR** order (same as **openCV** format).
- `left`: A integer representing the left side of the bounding box.
- `top`: A integer representing the top side of the bounding box.
- `right`: A integer representing the right side of the bounding box.
- `bottom`: A integer representing the bottom side of the bounding box.This method takes also 2 optional parameters:
- `label`: A string representing the label of the bounding box.
If not specified, then no label is displayed.
- `color`: A string representing the color of the bounding box.
Possible values are: `navy`, `blue`, `aqua`, `teal`, `olive`, `green`,
`lime`, `yellow`, `orange`, `red`, `maroon`, `fuchsia`, `purple`,
`black`, `gray` ,`silver`.
If `label` is specified and `color` is not, then a color depending
on the `label` is randomly chosen.
If neither `color` and `label` is specified then the bounding box
color is defaulted to `green`.## Examples
The script to plot exemples of this **README** is available
[here](https://github.com/nalepae/bounding-box/blob/master/docs/examples.py).To run it, go in top level of this git repository then write:
```bash
python docs/examples.py
```If you run `examples.py` in an other directory it won't work.