davisking / dlib

A toolkit for making real world machine learning and data analysis applications in C++
http://dlib.net
Boost Software License 1.0
13.51k stars 3.37k forks source link

how to change the cell size of the 5 HOG filters #1060

Closed coolsworder closed 6 years ago

coolsworder commented 6 years ago

the below comment indicates the cell size is 8, i am wonder how can i change the cell size bigger? please help me thanks very much

/* It is built out of 5 HOG filters. A front looking, left looking, right looking, front looking but rotated left, and finally a front looking but rotated right one.

    Moreover, here is the training log and parameters used to generate the filters:
    The front detector:
        trained on mirrored set of labeled_faces_in_the_wild/frontal_faces.xml
        upsampled each image by 2:1
        used pyramid_down<6> 
        loss per missed target: 1
        epsilon: 0.05
        padding: 0
        detection window size: 80 80
        C: 700
        nuclear norm regularizer: 9
        cell_size: 8
        num filters: 78
        num images: 4748
        Train detector (precision,recall,AP): 0.999793 0.895517 0.895368 
        singular value threshold: 0.15

    The left detector:
        trained on labeled_faces_in_the_wild/left_faces.xml
        upsampled each image by 2:1
        used pyramid_down<6> 
        loss per missed target: 2
        epsilon: 0.05
        padding: 0
        detection window size: 80 80
        C: 250
        nuclear norm regularizer: 8
        cell_size: 8
        num filters: 63
        num images: 493
        Train detector (precision,recall,AP): 0.991803  0.86019 0.859486 
        singular value threshold: 0.15

    The right detector:
        trained left-right flip of labeled_faces_in_the_wild/left_faces.xml
        upsampled each image by 2:1
        used pyramid_down<6> 
        loss per missed target: 2
        epsilon: 0.05
        padding: 0
        detection window size: 80 80
        C: 250
        nuclear norm regularizer: 8
        cell_size: 8
        num filters: 66
        num images: 493
        Train detector (precision,recall,AP): 0.991781  0.85782 0.857341 
        singular value threshold: 0.19

    The front-rotate-left detector:
        trained on mirrored set of labeled_faces_in_the_wild/frontal_faces.xml
        upsampled each image by 2:1
        used pyramid_down<6> 
        rotated left 27 degrees
        loss per missed target: 1
        epsilon: 0.05
        padding: 0
        detection window size: 80 80
        C: 700
        nuclear norm regularizer: 9
        cell_size: 8
        num images: 4748
        singular value threshold: 0.12

    The front-rotate-right detector:
        trained on mirrored set of labeled_faces_in_the_wild/frontal_faces.xml
        upsampled each image by 2:1
        used pyramid_down<6> 
        rotated right 27 degrees
        loss per missed target: 1
        epsilon: 0.05
        padding: 0
        detection window size: 80 80
        C: 700
        nuclear norm regularizer: 9
        cell_size: 8
        num filters: 89
        num images: 4748
        Train detector (precision,recall,AP):        1 0.897369 0.897369 
        singular value threshold: 0.15
*/
coolsworder commented 6 years ago

also, can I change the detection window size of these five HOG filters? I just want to use filters to detect people face

davisking commented 6 years ago

No. If you want to change it you should train a new model. Although I don't think any of that is a good idea. Really you should resize your image instead of resizing the HOG filters.

coolsworder commented 6 years ago

thanks davisking