This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0G5187: input format for char recognition

Part Number: MSPM0G5187

hi,

tvmgen_default.h from LENET5, the input format is as below.

/* Input feature normalization parameters:

 *   input_int = clip(((int32_t)((input_float + bias) * scale)) >> shift, min, max)

 *   where (min, max) = (-128, 127) if int8 type, (0, 255) if uint8 type

 */

#define TVMGEN_DEFAULT_BIAS_LEN 1

#define TVMGEN_DEFAULT_SCALE_LEN 1

#define TVMGEN_DEFAULT_SHIFT_LEN 1

extern const float tvmgen_default_bias_data[] __attribute__((weak)) = {-0.710783};

extern const int32_t tvmgen_default_scale_data[] __attribute__((weak)) = {229};

extern const int32_t tvmgen_default_shift_data[] __attribute__((weak)) = {2};

 

so, the input data format is float.

normally, the data from image sensor is 8bit(0-255). It takes time to do convert. If don't convert format as mentioned in tvmgen_default.h, what happen?

Or how to input the image with 8bit format?

 

BR,

frank

 

 

 

 

 

  • Hello Frank,

    Let me check with our internal team and after I get response, I will go back to reply to you

    Best Regards,

    Janz Bai

  • hi Janz,

    any update?

    BR,

    frank

  • Hello Frank,

    I am waiting for our internal team who is responsible for AI function response. When I get response, I will reply to you as soon as possible.

    BR,

    Janz Bai

    Janz,

    reply from Akshat, 

    Yes this example works on float, the reason we kept it with float and not int8 was to show BYOM workflow
    with this example where Lenet5 is a pretrained model expecting float as input and can be offloaded to NPU.

     

    We can find a way to support both flows.
    Yes this can be managed by “skip_normalize=true” flag from NNC, but will have model retraining as well
    as the range to data changes between float and int8

    BR,

    frank