forked from mindspore-Ecosystem/mindspore
Address PR9677 comments
This commit is contained in:
parent
2441059642
commit
5e1a730461
|
@ -68,7 +68,7 @@ Status MindDataEager::LoadImageFromDir(const std::string &image_dir, std::vector
|
|||
// Check target directory
|
||||
dataset::Path image_dir_(image_dir);
|
||||
if (!image_dir_.Exists() || !image_dir_.IsDirectory()) {
|
||||
std::string err_msg = "Target directory: " + image_dir + " does not exist or not a dir.";
|
||||
std::string err_msg = "Target directory: " + image_dir + " does not exist or not a directory.";
|
||||
MS_LOG(ERROR) << err_msg;
|
||||
return Status(StatusCode::FAILED, err_msg);
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ class MindDataEager {
|
|||
/// \brief Function to read images from local directory
|
||||
/// \param[inout] image_dir Target directory which contains images
|
||||
/// \param[output] images Vector of image Tensor
|
||||
/// \return Return error status if encounters exception
|
||||
/// \return Status The status code returned
|
||||
static Status LoadImageFromDir(const std::string &image_dir, std::vector<std::shared_ptr<Tensor>> *images);
|
||||
|
||||
/// \brief Callable function to execute the TensorOperation in eager mode
|
||||
|
|
|
@ -29,9 +29,9 @@ class TestDE : public ST::Common {
|
|||
TestDE() {}
|
||||
};
|
||||
|
||||
TEST_F(TestDE, Test1) {
|
||||
TEST_F(TestDE, ResNetPreprocess) {
|
||||
std::vector<std::shared_ptr<Tensor>> images;
|
||||
MindDataEager::LoadImageFromDir("/home/eager/apple", &images);
|
||||
MindDataEager::LoadImageFromDir("/home/workspace/mindspore_dataset/imagenet/imagenet_original/val/n01440764", &images);
|
||||
|
||||
MindDataEager Compose({Decode(),
|
||||
Resize({224, 224}),
|
||||
|
|
|
@ -24,7 +24,7 @@ else
|
|||
echo "BUILD_PATH = $BUILD_PATH"
|
||||
fi
|
||||
|
||||
cd ${BUILD_PATH}/mindspore/tests/cxx_st2
|
||||
cd ${BUILD_PATH}/mindspore/tests/cxx_st
|
||||
|
||||
export LD_LIBRARY_PATH=${BUILD_PATH}/mindspore/googletest/googlemock/gtest:${PROJECT_PATH}/mindspore:${PROJECT_PATH}/mindspore/lib:$LD_LIBRARY_PATH
|
||||
export PYTHONPATH=${PROJECT_PATH}/tests/ut/cpp/python_input:$PYTHONPATH:${PROJECT_PATH}
|
||||
|
|
Loading…
Reference in New Issue