From 0c45b9c0331e730dcf92e28a7428c0694bc27ccf Mon Sep 17 00:00:00 2001 From: sxj731533730 Date: Wed, 27 Oct 2021 09:31:43 +0800 Subject: [PATCH] Update tm_retinaface.cpp (#1189) --- examples/tm_retinaface.cpp | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/examples/tm_retinaface.cpp b/examples/tm_retinaface.cpp index 0a4eccef..9db67b11 100644 --- a/examples/tm_retinaface.cpp +++ b/examples/tm_retinaface.cpp @@ -345,39 +345,7 @@ static void generate_proposals(std::vector& anchors, int feat_stride, con } } -int get_input_data(const char* image_file, const int& max_size, const int& target_size, std::vector& image_data, - Size2i& ori_size, Size2i& dst_size, float& scale) -{ - image img = imread(image_file); - - ori_size.width = img.w; - ori_size.height = img.h; - - img = image_permute(img); - - int im_size_min = std::min(img.h, img.w); - int im_size_max = std::max(img.h, img.w); - - scale = float(target_size) / float(im_size_min); - - if (scale * (float)im_size_max > (float)max_size) - scale = float(max_size) / float(im_size_max); - - dst_size.width = (int)round((float)img.w * scale); - dst_size.height = (int)round((float)img.h * scale); - image resImg = resize_image(img, dst_size.width, dst_size.height); - int img_size = dst_size.height * dst_size.width * 3; - - image_data.resize(img_size); - - memcpy(image_data.data(), resImg.data, img_size * sizeof(float)); - - free_image(img); - free_image(resImg); - - return img_size; -} int get_input_data(const char* image_file, std::vector& image_data, Size2i& size) { -- GitLab