GithubHelp home page GithubHelp logo

nalepae / bounding-box Goto Github PK

View Code? Open in Web Editor NEW
94.0 2.0 18.0 3.71 MB

Bounding Box is a library to plot pretty bounding boxes with a simple Python API.

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
python visualization bounding-boxes computer-vision

bounding-box's Introduction

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.

Latest Release latest release
License license

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:

from bounding_box import bounding_box as bb

Then, just add the bounding box on an image.

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.

To run it, go in top level of this git repository then write:

python docs/examples.py

If you run examples.py in an other directory it won't work.

bounding-box's People

Contributors

nalepae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bounding-box's Issues

Remove cv2 dependency

i wanted to use bounding-box in AWS Lambda. Due to Lambdas size limits the 80 MB cv2 keep me from using this library. Maybe there is an alternative to cv2.

Otherwise, thanks for sharing your work!

Provision to apply opacity.

There should be provision to change the opacity of the boxes. This is useful when we have multiple objects in the image overlapping over each other.

circular bounding box

Hello author, I would like to ask how to implement the circular bounding box in the yolo object detection algorithm?

Possibility to set bbox color

Great tool but I would use if it was able to accept bounding boxes' desired colors. It would be an excellent improvement.

Add a thickness argument to bounding_box

Could you add the ability to change the thickness of the frame in the add function?

def add(image, left, top, right, bottom, label=None, color=None):
    ....
    _cv2.rectangle(image, (left, top), (right, bottom), color, 2) <# 2

Show Chinese

What should i do if my label are Chinese? It doesn't display properly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.