Darknet: How to change the bounding box thickness and label with the demo

Created on 11 Aug 2018  路  6Comments  路  Source: pjreddie/darknet

Hey,

Anybody know how to make the bounding box thinner and label smaller in the example app displayed with opencv. Cheers J Also when I run the example app the video runs at the same frame rate that the detector is working (7 fps in my case on 750ti), but ive seen other examples where the video frame rate is correct even when the detection fps is low like 7-8.

Im new so please forgive me asking for help here.

Most helpful comment

hi @Kingbadger3d,

You can modify image.c in function draw_detections_cv_v3 line 464 to fit your need. For instance mine is two times thiner than the original :
int width = show_img->height * .003;

In the same function you can modify other display parameters such as font size.

All 6 comments

Yeah, write yourself a program to call Yolo and use the results to draw your own bounding box. Example here: https://github.com/PeterQuinn925/Squirrel/blob/master/sort_photos.py

Thanks Peter, Hahaha I like the squirrel deterrent app I was thinking of doing something simular with video detection to alert of grey squirels in red squirel zones.

Would it be possible to do this directly in the C / demo framework or do you think python would be better, also how easy would it be to port your script to work on video in/webcam.

Thanks for the help mate

I don't know how easy it would be in the C/demo framework. I am much better with Python than with C, so I ran with that.

In terms of getting it to read from a webcam - trivial. You just need to use opencv to read the webcam into an image instead of reading from a file. Something like (but not exactly):

cam = cv2.VideoCapture(0)
s,img = cam.read()

There are tons of examples for getting images from webcams using OpenCV2.

hi @Kingbadger3d,

You can modify image.c in function draw_detections_cv_v3 line 464 to fit your need. For instance mine is two times thiner than the original :
int width = show_img->height * .003;

In the same function you can modify other display parameters such as font size.

Dear mathieuorhan,
Can you tell me how to modify the program so that the label of the predict bounding box does not display?

hi @Kingbadger3d,

You can modify image.c in function draw_detections_cv_v3 line 464 to fit your need. For instance mine is two times thiner than the original :
int width = show_img->height * .003;

In the same function you can modify other display parameters such as font size.

Thank you for your answer. I had to run make again after modifying image.c.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

job2003 picture job2003  路  3Comments

Vikalp-Reorder picture Vikalp-Reorder  路  3Comments

bujingdexin picture bujingdexin  路  3Comments

ghost picture ghost  路  4Comments

arianaa30 picture arianaa30  路  3Comments