Code Monkey home page Code Monkey logo

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

Watchers

 avatar

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.