AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.75k stars 7.96k forks source link

How can I Hide the Confidence or Prediction metrics in the bounding boxes? #8155

Open PIjarihd opened 3 years ago

PIjarihd commented 3 years ago

If something doesn’t work for you, then show 2 screenshots:

  1. screenshots of your issue
  2. screenshots with such information
    ./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights data/dog.jpg
    CUDA-version: 10000 (10000), cuDNN: 7.4.2, CUDNN_HALF=1, GPU count: 1
    CUDNN_HALF=1
    OpenCV version: 4.2.0
    0 : compute_capability = 750, cudnn_half = 1, GPU: GeForce RTX 2070
    net.optimized_memory = 0
    mini_batch = 1, batch = 8, time_steps = 1, train = 0
    layer   filters  size/strd(dil)      input                output
    0 conv     32       3 x 3/ 1    608 x 608 x   3 ->  608 x 608 x  32 0.639 BF

If you do not get an answer for a long time, try to find the answer among Issues with a Solved label: https://github.com/AlexeyAB/darknet/issues?q=is%3Aopen+is%3Aissue+label%3ASolved

PIjarihd commented 3 years ago

I want to hide the confidence score which come along with the label. How can I do that?

stephanecharette commented 3 years ago

I don't think there is a command-line option to do what you're asking.

If you use the DarkHelp C++ API, you can toggle the names_include_percentage setting: https://www.ccoderun.ca/darkhelp/api/classDarkHelp.html#ad23b58d26aed92e80f64e1023236c4b1

But again, this is not part of the CLI, it is a setting made available in the API.

PIjarihd commented 3 years ago

names_include_percentage Thank you for your response. However, in which file should I make this change? I have cloned the YOLOv4 repo. Please tell me the filename in which this change should be made.

stephanecharette commented 3 years ago

None. This change would go into your source code if you were using the DarkHelp C++ API.

If you don't want to write your own C++ application then another option is to use the DarkHelp Server. In which case you'd set this in the .json configuration file. See the following:

You can find instructions on building DarkHelp (which includes DarkHelp Server) for both Linux and Windows here: https://github.com/stephanecharette/DarkHelp/

PIjarihd commented 3 years ago

@stephanecharette Though I do not know much about YOLOv4 and the files it contains, I think You are complicating the simple task. Like changing the font size, there must be something small to hide the prediction percentage also. In YOLOv5, I did it by making default=True in the statement parser.add_argument('--hide-conf', default=True, action='store_true', help='hide confidences'). @AlexeyAB How can I hide the percentage in YOLOv4? Thank You in advance.

stephanecharette commented 3 years ago

DarkHelp supports all the things you say: changing the font type, changing font size, changing colours, hiding the percentage, hiding the label on small objects, even setting the amount of background shading. I don't complicate things, I specifically wrote DarkHelp to make things simpler. Note that all of these settings are also available in the JSON configuration file for DarkHelp Server as described on that web page.

PIjarihd commented 3 years ago

DarkHelp supports all the things you say: changing the font type, changing font size, changing colours, hiding the percentage, hiding the label on small objects, even setting the amount of background shading. I don't complicate things, I specifically wrote DarkHelp to make things simpler. Note that all of these settings are also available in the JSON configuration file for DarkHelp Server as described on that web page.

I am new to all these. Can I send the YOLO output to C# GUI using DarkHelp? Is that easy here? If that is, please tell me how.

Also, I am trying to find solution editing the files within the YOLOv4 Darknet folder. So, if you know the procedure to do so, please help me with that also. And thank you so much for your response, Sir.

lsd1994 commented 3 years ago

comment this https://github.com/AlexeyAB/darknet/blob/aef928cc0c0394f9e07232e037ea191b18ab3431/src/image.c#L439

PIjarihd commented 3 years ago

comment this

https://github.com/AlexeyAB/darknet/blob/aef928cc0c0394f9e07232e037ea191b18ab3431/src/image.c#L439

Should I comment this while training? Or does it work at testing even when I did not comment while training? I tried to test after commenting that line, it is still same.

lsd1994 commented 3 years ago

You should recompile darknet and try.

KfirdausMT commented 2 years ago

@PIjarihd are able to solve this? @lsd1994 what you mean by recompile darknet? Facing the same issue here

KfirdausMT commented 2 years ago

DarkHelp supports all the things you say: changing the font type, changing font size, changing colours, hiding the percentage, hiding the label on small objects, even setting the amount of background shading. I don't complicate things, I specifically wrote DarkHelp to make things simpler. Note that all of these settings are also available in the JSON configuration file for DarkHelp Server as described on that web page.

Is darkhelp an editor for darknet or another platform that need to be compiled?

stephanecharette commented 2 years ago

Click on the links or do a google search. Should be easy to find.

stephanecharette commented 2 years ago

The class structure has changed in the year since I replied with those links. Thus, the generated doxygen pages have changed as well. New URLs are: