Browse Source

fix dataset lite build with convert tool

tags/v1.1.0
xulei2020 5 years ago
parent
commit
9a1d3b09b6
4 changed files with 16 additions and 3 deletions
  1. +1
    -1
      cmake/package_lite.cmake
  2. +3
    -2
      mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/image_process.cc
  3. +6
    -0
      mindspore/lite/CMakeLists.txt
  4. +6
    -0
      mindspore/lite/test/CMakeLists.txt

+ 1
- 1
cmake/package_lite.cmake View File

@@ -67,7 +67,7 @@ if (BUILD_MINDDATA STREQUAL "lite_cv")
install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv DESTINATION ${MIND_DATA_INC_DIR} COMPONENT ${COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${MIND_DATA_LIB_DIR} COMPONENT ${COMPONENT_NAME})
else ()
install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv DESTINATION ${MIND_DATA_INC_DIR_RUN_X86} COMPONENT ${COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv DESTINATION ${MIND_DATA_INC_DIR_RUN_X86} COMPONENT ${RUN_X86_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${MIND_DATA_LIB_DIR_RUN_X86} COMPONENT ${RUN_X86_COMPONENT_NAME})
endif ()
endif ()


+ 3
- 2
mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/image_process.cc View File

@@ -620,11 +620,11 @@ static void PadWithConstant(const LiteMat &src, LiteMat &dst, const int top, con
}

bool ExtractChannel(const LiteMat &src, LiteMat &dst, int col) {
if (src.IsEmpty() || col < 0 || col > src.dims_ - 1) {
if (src.IsEmpty() || col < 0 || col > src.channel_ - 1) {
return false;
}
(void)dst.Init(src.width_, src.height_, 1, src.data_type_);
if (src.data_type_ == LDataType::FLOAT32) {
(void)dst.Init(src.width_, src.height_, 1, src.data_type_);
const float *src_start_p = src;
float *dst_start_p = dst;
for (int h = 0; h < src.height_; h++) {
@@ -638,6 +638,7 @@ bool ExtractChannel(const LiteMat &src, LiteMat &dst, int col) {
}
return true;
} else if (src.data_type_ == LDataType::UINT8) {
(void)dst.Init(src.width_, src.height_, 1, src.data_type_);
const uint8_t *src_start_p = src;
uint8_t *dst_start_p = dst;
for (int h = 0; h < src.height_; h++) {


+ 6
- 0
mindspore/lite/CMakeLists.txt View File

@@ -168,6 +168,12 @@ if (PLATFORM_ARM64)
endif ()
endif ()

if (PLATFORM_ARM32 OR PLATFORM_ARM64)
if (ENABLE_CONVERTER)
set(BUILD_MINDDATA "off")
endif()
endif()

if (BUILD_MINDDATA STREQUAL "lite" OR BUILD_MINDDATA STREQUAL "full")
# add sentencepiece dependency
# include(${TOP_DIR}/cmake/external_libs/sentencepiece.cmake)


+ 6
- 0
mindspore/lite/test/CMakeLists.txt View File

@@ -88,6 +88,12 @@ if (SUPPORT_GPU)
${LITE_DIR}/src/runtime/kernel/opencl/utils.cc
)
endif()

if (PLATFORM_ARM32 OR PLATFORM_ARM64)
if (ENABLE_CONVERTER)
set(BUILD_MINDDATA "off")
endif()
endif()
### minddata lite
if (BUILD_MINDDATA STREQUAL "lite")
# include_directories(${CCSRC_DIR}/minddata)


Loading…
Cancel
Save