YAD2K
YAD2K copied to clipboard
How to predict via converted yolo9000 model
I now want to work on https://github.com/philipperemy/yolo-9000
Follow the instruction, I can already
- convert the yolo2 weight (for detecting 80 classes in coco_classes.txt) to keras weight, load the yolo2 model in keras and do correct prediction.
- convert the yolo9000 weight (for detecting 9418 classes in 9k.names ) to keras weight, load the yolo9000 model in keras but I don't how to predict via this model
For yolo2 model, we know that after run
yolo2_model = load_model(MODEL_PATH.h5)
prediction = yolo2_model.predict(IMAGE_DATA)
prediction
is an (?,?,?,3,num_anchors * (num_classes + 5)) tensor
so if num_anchors=1, num_class=80
we know the prediction
's last channel is (box_x,box_y,box_w,box_h,box_confidence, <box_class_probs> )
For yolo2 (80 classes), we know <box_class_probs> is just the probabilities.
But for yolo9000, we know it is an Hierarchical Classificaiton. This is mean the output probabilities here is conditional probabilities.
P(Norfolk)=P(Norfolk|terrier)P(terrier|hunting dog)...P(animal|root)
This is why we need a tree
here.
I do know the last value mean in <box_class_probs> of yolo2_model : the absolutly probabilities for each catalogy
I don't know what the last value mean in <box_class_probs> of yolo9000_model, is it conditional probabilities?
Does anyone know the network output meaning for yolo9000?
hi @veya2ztn - any news with running yolo9k? I'm getting wrong bboxes and classification results.
I think the outputs of yolo9000 mean conditional probability based on the tree. I have completed my code for prediction, but I find that the outputs of converted yolo9000 are all zero. I don't know where's wrong. Is there some problems in yad2k.py to convert yolo9000 model?