allanzelener / YAD2K

YAD2K: Yet Another Darknet 2 Keras
Other
2.72k stars 881 forks source link

How to predict via converted yolo9000 model #158

Open veya2ztn opened 5 years ago

veya2ztn commented 5 years ago

I now want to work on https://github.com/philipperemy/yolo-9000

Follow the instruction, I can already

  1. 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.
  2. 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, )

For yolo2 (80 classes), we know 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 of yolo2_model : the absolutly probabilities for each catalogy

I don't know what the last value mean in of yolo9000_model, is it conditional probabilities?

Does anyone know the network output meaning for yolo9000?

zeevikal commented 5 years ago

hi @veya2ztn - any news with running yolo9k? I'm getting wrong bboxes and classification results.

c6376315qqso commented 4 years ago

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?