MCPcopy Create free account
hub / github.com/OAID/Tengine / get_input_data_ssd

Function get_input_data_ssd

tests/bin/mt_mssd.cpp:66–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64};
65
66void get_input_data_ssd(std::string& image_file, float* input_data, int img_h, int img_w)
67{
68 image img = imread(image_file.c_str());
69
70 image resImg = resize_image(img, img_w, img_h);
71 resImg = rgb2bgr_premute(resImg);
72 float* img_data = ( float* )resImg.data;
73 int hw = img_h * img_w;
74
75 float mean[3] = {127.5, 127.5, 127.5};
76 for(int c = 0; c < 3; c++)
77 {
78 for(int h = 0; h < img_h; h++)
79 {
80 for(int w = 0; w < img_w; w++)
81 {
82 input_data[c * hw + h * img_w + w] = 0.007843 * (*img_data - mean[c]);
83 img_data++;
84 }
85 }
86 }
87}
88
89void post_process_ssd(std::string& image_file, float threshold, float* outdata, int num, const std::string& save_name)
90{

Callers 1

run_testFunction · 0.70

Calls 4

imreadFunction · 0.85
resize_imageFunction · 0.85
rgb2bgr_premuteFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected