seemk / FastHumanDetection

Human detection in depth images using histograms of oriented gradients
MIT License
29 stars 8 forks source link

How to prepare the dataset to train a model? #3

Open leavessnow26 opened 6 years ago

leavessnow26 commented 6 years ago

Hi,

I am interested in this project! I want to ask how to prepare the dataset to train a model on windows, such as "RGB-D People Dataset ", must use SQLite database? can you give me a detailed explain?

Thanks.

seemk commented 6 years ago

Hi,

sadly I did not have an annotated dataset when I made this project, so I created a tool to label the depth images myself (tools/ui.cpp). It runs the first pass of the detection (fhd_run_pass) which produces a list of depth images (64x128 width x height pixels each) and from these candidates you can select the correct ones. All the 64x128 depth images and their corresponding HOG descriptors will be inserted to the candidate SQLite database and the training (fhd_train.cpp) is done on this database.

So to answer your question, the annotated regions in the "RGB-D People Dataset" will need to be scaled to a 64x128 box and the box's HOG will need to be calculated. At the moment there is no such tool, I could refactor the codebase a bit and expose the scaling and HOG calculation functions and write an example how to import a labelled dataset.

Or, if you're interested I can share my training sets with you (around 20K+ labelled images in the correct format for training) which I've used for a robotics project . I HOPE I still have them on my home PC, I'll have access to it later today.

On another note, I've found that a simple convolutional network that takes the candidate depth images instead of this project's depth->HOG->classifier outperforms the HOG based algorithm, but is slower on a CPU (around ~30 ms on an i5).

leavessnow26 commented 6 years ago

HI!

Thanks for your detailed reply! I'll be very grateful to you if you could refactor the codebase a bit and expose the scaling and HOG calculation functions and write an example how to import a labelled dataset. And can you share your training set and testing set to me? And I will try simple convolutional network.

Thanks.

seemk commented 6 years ago

The training set I used is available at https://drive.google.com/file/d/1ML1T6-ggJ4NSy0ZXzLrPyz-ighDGKPPx (~1.7 GB).

It contains 5574 pictures of humans and 49587 negative pictures. The database consists of 64x128 depth images (16 bytes unsigned) their HOG descriptors and the labels.

For the convnet I used this model: https://gitlab.com/TTYRobotiklubi/Follower/blob/master/Software/Tracker/convnet/train.lua

The convnet folder in that repository contains other support code to convert the SQLite DB to Torch tensors.

If you want to go the HOG way then the classifier can be trained via fhd_ui under the "Training" button. I didn't bother to add a file select dialog to it so you'll have to just enter the input database name and the output classifier names.

rachillesf commented 4 years ago

Hi, thanks for sharing the dataset.

I'm having an error to open this dataset with fhd_ui that says it cannot locate the table "depth_frames". After that no frame is displayed and I cannot visualize the data.

Is there a way to fix this?

Thanks,