Ssd_keras: Training_on_new_data

Created on 13 Dec 2016  路  15Comments  路  Source: rykov8/ssd_keras

Hi. @rykov8 .FIrstly, thanks for this keras port for SSD. You are amazing :)
I have been trying to train the model for hand detection. I have basically a single class then, that of a hand. I set NUM_CLASSES=2 as you specified in other issues. Can you please let me know about my input format. My data currently has the 5 tuple.:- label, x0, y0, width, height to specify the coords of the bounding box. I have generated the same corresponding to each hand image in my dataset . Do we represent our input through prior_boxes_ssd300.pkl and gt_pascal.pkl?? How exactly do i do that. What is the prior_boxes_ssd300.pkl for. It would be great if you can help me out. Thanks in advance..

Most helpful comment

I think that prior_boxes_ssd300.pkl doesn't need to be changed with datasets. Just use it to initialize BBoxUtility, like in SSD_training notebook and it should work. Don't create your own prior_boxes unless you have a good reason to modify how SSD works.

All 15 comments

@ayushchopra96 hi! I believe, that in #15 quite a lot is explained. Try to read this issue and cite some parts, that are not clear, and I'll try to explain better. Actually, for each image you should have such annotation:

[xmin, ymin, xmax, ymax, prob1] = [x0, y0, x0 + width, y0 + height, 1]

Example of prior_boxes_ssd300.pkl usage is in SSD_training notebook.

hi @rykov8 , I am working with @ayushchopra96 we are clear with gt_pascal.pkl but we are still having problem in understanding about prior_boxes_ssd300.pkl we get the idea what's the purpose of this file but how to initialise the priors for any other dataset. Please explain it would be a great if you help. Thanks in advance.

Hi @primebuilder, I think the prior_boxes_ssd300.pkl contains what the paper calls "default boxes". Just leave the file as it is and it should work.

hi @lunardog , We were applying this on different data set so we want to know how to initialise these priors and @rykov8 which data set you have used to train the model. Can you provide us the data set for a demo run to understand it completely. Thanks for early reply. :)

I think that prior_boxes_ssd300.pkl doesn't need to be changed with datasets. Just use it to initialize BBoxUtility, like in SSD_training notebook and it should work. Don't create your own prior_boxes unless you have a good reason to modify how SSD works.

@lunardog thanks for your comments. Actually, you're totally right, prior_boxes depend on the net architecture and don't depend on the dataset. Unfortunately, I cannot make my dataset public because of NDA, but @primebuilder @ayushchopra96 you don't really need it to understand what happens.

Hi.. @rykov8 . We trained the model on our data.. Pretty much overfit it the first time around.(loss less that 1%). But when we test the same on an image from the train data itself. The model does not make any predictions.. ie. the results list is empty for the data.
Another issue we had if needed to scale the values before creating gt_pascal? .ie. Do we actually divide the our xmin ymin xmax ymax by 300 for all out entries?

@primebuilder Can you please advice where should I store images for my training dataset?

@primebuilder
@rykov8
@ayushchopra96
hi!
how to generate gt_pascal.pkl ?
I've been searching for 2 days and still no answer..
what tool did you use to generate such files (from XML?)
the data from gt_pascal.pkl looks like that:
{u'frame04303.png': array([[ 0.35078125, 0.43472222, 0.67734375, 0.68194444, 1. ,
0. , 0. ]])
how to generate such a row?

@adamzurada
modify the get_data_from_XML.py with your dataset classes and execute it

Hi @rykov8,
Thanks so much for your work!
I am trying to train SSD on MS-COCO dataset. I created the ground truth according to your gt file format, and the training procedure can execute successfully. However, the loss is very large, initially around 245 and will finally fixed at around 190. I then tried to train with VOC2007, and the loss is only 4~0.6... Is it possible for COCO to have such a large loss?

In addition, after training the model with COCO data, I cannot use the trained model. The error is
RuntimeWarning: overflow encountered in exp decode_bbox_height = np.exp(mbox_loc[:, 3] * variances[:, 3]), which occurs at
results = bbox_util.detection_out(preds)
and will make the result an empty array [ ]. Any idea why will this happen?

Thanks in advance!

Hello @sklin93,
a possible problem that you could be having is that you are not pre-processing the box dimensions correctly. Have you looked at how is done in the get_data_from_XML.py? Have you normalized the x_min, y_min, x_max, y_max dimensions?

Hi @oarriaga,
Exactly! Solved, thank you!!

@sklin93

If you don't mind, could you share your code for training on the MSCOCO dataset?

Thanks.

Hi @rykov8,
Could you please let me know how to make prior_boxes_ssd512.pkl file?

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

emillion92 picture emillion92  路  4Comments

eric82714 picture eric82714  路  4Comments

fortunto2 picture fortunto2  路  11Comments

natlachaman picture natlachaman  路  6Comments

MrXu picture MrXu  路  5Comments