Coder Social home page Coder Social logo

shoumikchow / bbox-visualizer Goto Github PK

View Code? Open in Web Editor NEW
374.0 6.0 29.0 8.83 MB

Make drawing and labeling bounding boxes easy as cake

Home Page: https://bbox-visualizer.readthedocs.io

License: MIT License

Python 88.59% Makefile 11.41%
computer-vision computer-vision-tools cv labeling data-labeling object-detection object-recognition bboxes python3 deep-learning

bbox-visualizer's People

Contributors

dependabot[bot] avatar imgbotapp avatar nefelipar avatar ryoo72 avatar sc0v0ne avatar shoumikchow 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  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bbox-visualizer's Issues

Single function for drawing box which will take labelling style as parameter

Is your feature request related to a problem? Please describe.
When I tried using this package, I found it annoying to draw the box first and then decide on a labelling method. And it was again inconsistent incase of draw_flag_with_label().

Describe the solution you'd like
I had a suggestion, I think it would be easier and very pythonic if we could pass the labelling style as an argument to a function.
Like this,

def draw_box(image, bbox, labelling_method="regular")
     ...

and the labelling_method argument can take regular, t-style, flag.

Additional context
None

Expand examples using jupyter notebooks

How are you @shoumikchow ? I found your project through Hacktoberfest2023, I liked your project I wanted to be able to contribute, initially my first contribution would be to expand the library's examples using the jupyter notebook, so anyone interested in using it can carry out a test using these examples.

I chose to rename the folder to examples, because I have a few more contributions in mind, I want to develop this for documentation along with code.

Describe the solution you'd like
I updated the folder name for examples, I kept your previous scripts so the user has both options. Expand the code to Jupyter notebooks showing step by step, I added some prints to show the user that it maintains the same type of data and each result also adds the box to the image.

[BUG]

\AppData\Local\Programs\Python\Python311\Lib\site-packages\bbox_visualizer\bbox_visualizer.py", line 34, in draw_rectangle
output = img.copy()
^^^^^^^^
AttributeError: 'str' object has no attribute 'copy'

image

i coulndt solve this.

bbox=(100, 100, 200, 200) img = bbv.draw_rectangle(img_path, bbox)

Update docs and readme

Add a new step in the documentation and reduce the size of the images in the readme, to make it more uniform

no bounding boxes in the saved image

Thanks for the sharing.

I used cv2 to read and save a PNG image, and used the bbv.draw_rectangle to draw rectangles on this image. The code is listed below, and I found there is no bounding boxes in the saved image.

import cv2
import bbox_visualizer as bbv

img=cv2.imread('.\\xxx\\xx.png')
bbxes = [[ 583,  172,  620,  207], [ 599,  166,  629,  198], [1015,  193, 1241,  374], [ 739,  173,  884,  286], [ 666 , 165 , 728  ,220], [ 641 , 170 , 667 , 194]]

for bbx in bbxes:
      bbv.draw_rectangle(img, bbx)

cv2.imwrite('.\\xx\\xxxx.png', img)

I also found that, if I use the bbv.add_label() function for the same img and bbx, there will be labels in the saved image, but still no bounding boxes.

I'm using cv2-version-4.4, could you help me with this problem?

draw_rectangle returns a new image [BUG]

Describe the bug
All of the functions modify the passed image (numpy array). While the draw_rectangle function creates a copy of the passed img called output, adds the rectangles to it and returns that. Therefore the examples given in the README do not in fact draw a rectangle.

Expected behavior
Either all functions need to return a new image, or draw_rectangle needs to modify the passed image.

Version
0.1.0

Handle bounding boxes on the edge properly

Labels on the edge of the box aren't handled properly.
If an object detection model detects an image at the edge of the frame, there is a chance that some portions of a bounding box is outside the frame itself. That is, some of xmin, xmax, ymin, ymax might be negative or larger than the image dimension itself. In cases like these, OpenCV handles it by not drawing the bounding box at all.

Ideally, it should draw the lines that are outside the image dimensions along the edge.

Init tests bbox

Add tests to bbox, improving its performance and matching its outputs

I'm working on this test branch that I created in the fork

[ENHANCEMENT] Is there a way to change the color of the bounding box?

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when I can't change the color of the bounding box.

Describe the solution you'd like
Possibility to change the color of the bounding box.

Script manipulation labels

Create file manipulation labels:

  • Drop label
  • Add label
  • Rename label

Me create new branch in my fork, initialize development this issue

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.