philipperemy / yolo-9000

YOLO9000: Better, Faster, Stronger - Real-Time Object Detection. 9000 classes!
Apache License 2.0
1.18k stars 309 forks source link

How to predict via converted yolo9000 model #35

Open veya2ztn opened 5 years ago

veya2ztn commented 5 years ago

Follow the instruction, I can already

  1. convert the yolo2 weight (for detecting 80 classes) to keras weight, load the yolo2 model in keras and do correct prediction.
  2. convert the yolo9000 weight (for detecting 9418 classes) 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?