器件型号: MSPM0G5187
您好、
tvmgen_default.h 从 LENET5 开始、输入格式如下。
/*输入功能归一化参数:
* input_int = clip ((int32_t)((INPUT_float + bias)* scale))>> shift、min、max)
* 其中 (min、max)=(–128,127) 如果是 int8 类型、则为 (0255) 如果是 uint8 类型
*/
#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};
因此、输入数据格式为浮点。
通常、来自图像传感器的数据为 8 位 (0-255)。 进行转换需要时间。 如果没有如 tvmgen_default.h 中所述转换格式、会发生什么情况?
或者如何以 8 位格式输入图像?
BR、
Frank