gender_age_estimation_mxnet icon indicating copy to clipboard operation
gender_age_estimation_mxnet copied to clipboard

@ghimiredhikura hi,

Open NOON47 opened this issue 4 years ago • 2 comments

@ghimiredhikura hi,

hi.. I can convert [ssr2_megaage_1_1/model-0000.params, ssr2_megaage_1_1/model-symbol.json] model to ncnn format. : ssr2_megaage_1_1_ncnn.zip

Now, the problem is at inference time, the predicted output is just garbage value! Following is my ncnn inference script syntex

    ncnn::Mat img_out;
    ncnn::Extractor ex = net.create_extractor();
    ncnn::Mat img_ncnn = ncnn::Mat::from_pixels_resize(img_face_tile.data,
        ncnn::Mat::PIXEL_RGB, img_face_tile.cols, img_face_tile.rows, 64, 64);

    ex.input("data", img_ncnn); 
    int stage_num[] = {3, 3, 3};
    ex.input("stage_num0", stage_num[0]);
    ex.input("stage_num1", stage_num[1]);
    ex.input("stage_num2", stage_num[2]);

    ex.extract("underscorencnn_40_mulscalar16", img_out);
    cout << "Age: " << img_out[0] << endl;
    output - Age:   7.72762e+27

Any help please?

Best, Deepak

hi ,i got you way to convert model with ncnn sucess and use you code and model test width ncnn,but got the wrong result : gender = -0.675681 age = -7.11803 . what is the problem?

Originally posted by @NOON47 in https://github.com/wayen820/gender_age_estimation_mxnet/issues/22#issuecomment-718605270

NOON47 avatar Oct 30 '20 01:10 NOON47

this problem have been solved!!!! the ncnn code must be like this: ncnn::Mat im_info(1,3); im_info[0] = 0; im_info[1] = 1; im_info[2] = 2; ex.input("data", in); ex.input("stage_num0", im_info); ex.input("stage_num1", im_info); ex.input("stage_num2", im_info);

NOON47 avatar Oct 31 '20 10:10 NOON47

@NOON47 good job

Tomhouxin avatar Dec 22 '20 03:12 Tomhouxin