preprocessor_detection.cpp中写死了预处理时候的scale行为,和paddleDetection不一致
Created by: FibonacciSun
trt_infer 分支(master分支也是如此) inference/preprocesspr/preprocessor_detection.cpp 的single_process函数,如下 104行 对数据 /255是强制行为 而这个变换的在paddleDetection里是可配置的,有个is_scale选项
94 #pragma omp parallel for 95 for (int h = 0; h < rh; ++h) { 96 const uchar* uptr = im.ptr(h); 97 const float* fptr = im.ptr(h); 98 int im_index = 0; 99 for (int w = 0; w < rw; ++w) { 100 for (int c = 0; c < channels; ++c) { 101 int top_index = (c * rh + h) * rw + w; 102 float pixel; 103 if (_config->_feeds_size == 2) { // yolo v3 104 pixel = static_cast(uptr[im_index++]) / 255.0; 105 } else if (_config->_feeds_size == 3) { 106 pixel = fptr[im_index++]; 107 } 108 pixel = (pixel - pmean[c]) / pscale[c]; 109 data[top_index] = pixel; 110 } 111 } 112 }