forked from huawei/mindspore2022
!21299 fix codex warning
Merge pull request !21299 from luoyang/issues2
This commit is contained in:
commit
ed5fa7ba73
|
|
@ -4,8 +4,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -fPIC -std=c++17")
|
|||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-compare")
|
||||
|
||||
set(MS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/mindspore-lite-1.2.0-linux-x64/runtime")
|
||||
set(LITECV_DIR "${CMAKE_CURRENT_SOURCE_DIR}/mindspore-lite-1.2.0-linux-x64/runtime/include/dataset")
|
||||
set(MS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/mindspore-lite-1.3.0-linux-x64/runtime")
|
||||
set(LITECV_DIR "${CMAKE_CURRENT_SOURCE_DIR}/mindspore-lite-1.3.0-linux-x64/runtime/include/dataset")
|
||||
|
||||
include_directories(${MS_DIR} ${LITECV_DIR})
|
||||
|
||||
|
|
|
|||
|
|
@ -58,16 +58,26 @@ int main(int argc, char **argv) {
|
|||
auto executor = Execute(decode);
|
||||
executor(image, &image);
|
||||
|
||||
LiteMat lite_mat_rgb(image.Shape()[1], image.Shape()[0], image.Shape()[2], const_cast<void *>(image.Data().get()),
|
||||
LDataType::UINT8);
|
||||
constexpr int32_t image_h = 0;
|
||||
constexpr int32_t image_w = 1;
|
||||
constexpr int32_t image_c = 2;
|
||||
LiteMat lite_mat_rgb(image.Shape()[image_w], image.Shape()[image_h], image.Shape()[image_c],
|
||||
const_cast<void *>(image.Data().get()), LDataType::UINT8);
|
||||
std::cout << "lite_mat_rgb: height=" << lite_mat_rgb.height_ << ", width=" << lite_mat_rgb.width_ << std::endl;
|
||||
LiteMat lite_mat_resize;
|
||||
|
||||
ResizeBilinear(lite_mat_rgb, lite_mat_resize, 256, 256);
|
||||
LiteMat lite_mat_resize;
|
||||
constexpr target_size = 256;
|
||||
ResizeBilinear(lite_mat_rgb, lite_mat_resize, target_size, target_size);
|
||||
std::cout << "lite_mat_resize: height=" << lite_mat_resize.height_ << ", width=" << lite_mat_resize.width_
|
||||
<< std::endl;
|
||||
|
||||
LiteMat lite_mat_pad;
|
||||
Pad(lite_mat_resize, lite_mat_pad, 30, 30, 10, 10, PaddBorderType::PADD_BORDER_CONSTANT, 255, 255, 255);
|
||||
constexpr int32_t pad_top = 30;
|
||||
constexpr int32_t pad_bottom = 30;
|
||||
constexpr int32_t pad_left = 10;
|
||||
constexpr int32_t pad_right = 10;
|
||||
constexpr int32_t pad_color = 255;
|
||||
Pad(lite_mat_resize, lite_mat_pad, pad_top, pad_bottom, pad_left, pad_right, PaddBorderType::PADD_BORDER_CONSTANT,
|
||||
pad_color, pad_color, pad_color);
|
||||
std::cout << "lite_mat_pad: height=" << lite_mat_pad.height_ << ", width=" << lite_mat_pad.width_ << std::endl;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue