Hacker News new | ask | show | jobs
by nom 2095 days ago
Can someone explain to me why I would need a library to draw bounding boxes with a label? I don't understand why this is a hard problem that warrants a library. There isn't even any 'fiddly math' in there.

I seriously don't get it. Have we become so incapable that we can't draw rectangles and labels anymore by our self?

2 comments

You are correct that you do not need this library to draw bounding boxes with a label. You can use OpenCV or Pillow to draw it.

However, positioning the label to be exactly above the bounding box can be a little finicky. This just takes care of the math that you'd have to do to place it right above the box. I agree that I am not doing something revolutionary with the math here, but these functions are something that I've had to use over and over again and thought it would be nice to package the whole thing. This library abstracts everything behind two main functions.

There are also a few different visualizations that you can use.

Thanks for your thoughtful reply. I guess I have more of a problem with this hitting the front page of HN than with you publishing it. If you use it a lot and abstract it into a library, that's fine, we all do that. But it looks like people are interested in it and I don't understand why.

Don't get me wrong, I like that you published it and I encourage it as much as I can. But if someone is capable of running complex object detection algorithms, they surely can position a label correctly without the need for another library?! This is just a couple of lines of code you can write without even thinking much about it.

Maybe I'm just out of touch, but it's so weird to me that people out there might find this useful.

Same reason I might use tippy.js for popup boxes. I know I could make it myself, and make it just as well as the tippy authors have designed it, but why waste my time doing that when I know they've already thought through all of the problems that I can't even expect until I'm already in the thick of it?
Sure it's not like I haven't used libraries in the 20 years I've been coding. If it solves the complex problem I am facing, I will use it. But have you looked at the code in question? It is not complex. It is code you write in 20 minutes.
I don't understand the hate. I don't have to solve P=NP to post on HN. If I did solve something complicated, I'd be publishing a paper, not posting here. I thought this is something that might help the community. If people are upvoting it, it's because they think it might help them - save 20 minutes if nothing else.

Either way, your comments might be against HN guidelines [1].

[1] https://news.ycombinator.com/showhn.html

I find it interesting, nom, that you could be adept at using object detection algorithms and still not detect the reason why people are interested in reading this article.
It's not about capability, but efficiency. This seems handy enough for me to adopt into custom labeling tools I wrote using cv2 and PIL, etc.
No doubt that this is handy as a reference. But it's on the frontpage of HN and i don't understand why. If you look at the code it evokes memories of left-pad. Rendering a label and a box is not complicated, this library only serves the creator.

Instead of down votes, I hope someone can answer my questions.