Closed wurstcase closed 7 years ago
I didn't do that.
But you can do it by using 2 ways:
Detect and do Hierarchical classification by using Yolo 9000 - page 6: https://arxiv.org/pdf/1612.08242v1.pdf
hierarchy_predictions()
-function: https://github.com/AlexeyAB/darknet/blob/71a9929af6c3d3ffb9527bb921c5cc4a20971ff6/src/region_layer.c#L350hierarchy_predictions()
called from get_region_boxes()
which called from here: https://github.com/AlexeyAB/darknet/blob/71a9929af6c3d3ffb9527bb921c5cc4a20971ff6/src/detector.c#L479
( I didn't test it on windows-fork hasn't Yolo 9000 yet.)Or you can use Yolo v2, and you should change function draw_detections()
: https://github.com/AlexeyAB/darknet/blob/71a9929af6c3d3ffb9527bb921c5cc4a20971ff6/src/image.c#L180
int class = max_index(probs[i], classes);
this line get 1 object with maximum probs[i]
- porbability of object (confidence): https://github.com/AlexeyAB/darknet/blob/71a9929af6c3d3ffb9527bb921c5cc4a20971ff6/src/image.c#L185
Instead of this - You should change implementation of function draw_detections()
to draw both class and subclass. Yolo v2 has no concepts such as class and subclass - you should implement it by yourself. To draw call with highes porb
and then draw subclass (with highest prob
) of this class.
Thank you Alexey for the quick response and input on this matter. I think i gonna try yolo9000 and see if this works out otherwise there is still option 2 :)
Hi,Alexey!I hava an very important problem to ask you .I transplanted yolo from linux to windows by myself。The demo and test is good .It can work well.But when I use the yolo train voc data ,the process is normal,and many .weights in my backup folder. The problem is that I use the weights test every image,it cant detect anything.then I make the thresh 0,it also detect nothing ..I use yours darknet,it is good .So I want to know you what code did you change make darknet work well ? My english is poor,so Please forgive me for improper expression
@csaimd The main fixes for training - is the replacement of rand
-functions, you can find it in commits: https://github.com/AlexeyAB/darknet/commits/master
Thank you Alexey for the quick response.I hava followed your tips to change the rand-function in data.c.Then training the voc data.however the results is terrible because it is the same as the last result.I download the code from the https://github.com/pjreddie/darknet and not change anything.This problem makes me craze!!!!
@csaimd if you use cudnn, the version of cuda&cudnn should be match.
@AlexeyAB, I am trying to do the same thing as @wurstcase described above using Yolo-v3. I am planning to have 2 classes identifying the same object (for eg., car, Lamborghini - both of them will identify the same bounding box but appear with different class names in the annotation). So my question is while detecting, can I ask the detector to draw the bounding boxes only for cars OR draw them only for Lamborghini's? Is my approach ok?, if so, could you please tell me which part of the code should I change for Yolo-v3 to do this?
@kmsravindra
For example, if class id for car = 4.
if (dets[i].prob[j] > best_class_prob && (j == 4)) {
if (dets[i].prob[j] > thresh && (j == 4)) {
Thank you. I will check this out.
Just a quick question about multiclass detection. Can i make for example 3 classes where 1 class combines images of the two other classes so that i get a specialized detection ? Like for example make a class car with photos of cars and 2 specialized classes with Lamborghini and Ferari so that my output would be something like: 90% car 75% Lamborghini with practically nearly identical bounding boxes. Is this possible and is this the way you qould do something like that ?