ssd_keras icon indicating copy to clipboard operation
ssd_keras copied to clipboard

What is prior_boxes_ssd300.pkl? Is there anyone knowing this?

Open KevinYuk opened this issue 8 years ago • 9 comments

After read all the issues here, still don't know what prior_boxes_ssd300.pkl is.

KevinYuk avatar Mar 10 '17 02:03 KevinYuk

Hello @KevinYuk, the file prior_boxes_ssd300.pkl contains 7308 bounding boxes. Every box contains x_min, y_min, x_max, y_max, variance_1, variance_2, variance_3, variance_4. This bounding boxes are referred in the paper as prior boxes. All boxes dimensions are normalized and should have a similar aspects as the ones depcited in the next figure

However, looking at @rykov8 s implementation the bounding boxes were not entirely created using the equations described in the paper; instead, they were based on their actual caffe implementation.

oarriaga avatar Mar 10 '17 09:03 oarriaga

It's also the same as model.predict(img)[0, :, -8:]. No need to get it from the pickle file.

tachim avatar Mar 10 '17 21:03 tachim

Hi @oarriaga,

Thanks very much for your clarification. I thought prior box is the label information of the dataset, but now it seems that it is not. I found that the final layer output of SSD topology is "predictions (Merge) (None, 7308, 33)". Why it's 7308? I have change the network from SSD(vgg) to SSD(resnet), the final layer output is "predictions (Merge) (None, 5166, 33)". How could I get a new prior_boxes_ssd300.pkl contains 5166 bounding boxes?

Thanks a lot.

KevinYuk avatar Mar 13 '17 01:03 KevinYuk

Hi @tachim,

Many thanks for your comments. You said that no need to get it from the pickle file. Can you give me more details? Below is the code from SSD_trainning.py:

preds = model.predict(inputs, batch_size=1, verbose=1)
results = bbox_util.detection_out(preds)

How to change the code to avoid to get prior box info from the pickle file?

Thanks a lot.

KevinYuk avatar Mar 13 '17 01:03 KevinYuk

@KevinYuk i suggest reading my comment more carefully

tachim avatar Mar 13 '17 06:03 tachim

@tachim , as you said for using priors we can use model.predict(img)[0, :, -8:] , that can be done without any prior training of network, right??

janismdhanbad avatar Oct 13 '17 09:10 janismdhanbad

Yes.

tachim avatar Oct 13 '17 18:10 tachim

I understand why the output shape has 7308 but why 33? where this coming from ?

adelsalehali1982 avatar Oct 20 '17 23:10 adelsalehali1982

https://gist.github.com/codingPingjun/aa54be7993ca6b2d484cccf5a2c5c3d4

JJZHK avatar Dec 21 '17 07:12 JJZHK