From c133059c59bc1496e1dd7144c4068fbab92248a3 Mon Sep 17 00:00:00 2001 From: LiuCunwei Date: Fri, 31 Jul 2020 15:26:42 +0800 Subject: [PATCH] enhance: imagenet to mindrecord mapfile --- mindspore/mindrecord/tools/imagenet_to_mr.py | 8 ++++---- .../cv_to_mindrecord/ImageNet_Similar_Perf/README.md | 10 +++++----- .../mindrecord/testImageNetDataWhole/labels_map.txt | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/mindspore/mindrecord/tools/imagenet_to_mr.py b/mindspore/mindrecord/tools/imagenet_to_mr.py index 0aa870384e..59695c8734 100644 --- a/mindspore/mindrecord/tools/imagenet_to_mr.py +++ b/mindspore/mindrecord/tools/imagenet_to_mr.py @@ -35,10 +35,10 @@ class ImageNetToMR: .. code-block:: - n02119789 1 pen - n02100735 2 notebook - n02110185 3 mouse - n02096294 4 orange + n02119789 0 + n02100735 1 + n02110185 2 + n02096294 3 image_dir (str): image directory contains n02119789, n02100735, n02110185, n02096294 dir. destination (str): the MindRecord file path to transform into. diff --git a/model_zoo/utils/cv_to_mindrecord/ImageNet_Similar_Perf/README.md b/model_zoo/utils/cv_to_mindrecord/ImageNet_Similar_Perf/README.md index 8bdcb9e25d..d3bd5fdc18 100644 --- a/model_zoo/utils/cv_to_mindrecord/ImageNet_Similar_Perf/README.md +++ b/model_zoo/utils/cv_to_mindrecord/ImageNet_Similar_Perf/README.md @@ -28,12 +28,12 @@ This example provides an efficient way to generate MindRecord. Users only need t Store the downloaded ImageNet dataset in a folder. The folder contains all images and a mapping file that records labels of the images. - In the mapping file, there are three columns, which are separated by spaces. They indicate image classes, label IDs, and label names. The following is an example of the mapping file: + In the mapping file, there are three columns, which are separated by spaces. They indicate image classes and label IDs. The following is an example of the mapping file: ``` - n02119789 1 pen - n02100735 2 notbook - n02110185 3 mouse - n02096294 4 orange + n02119789 0 + n02100735 1 + n02110185 2 + n02096294 3 ``` 2. Edit run_imagenet.sh and modify the parameters diff --git a/tests/ut/data/mindrecord/testImageNetDataWhole/labels_map.txt b/tests/ut/data/mindrecord/testImageNetDataWhole/labels_map.txt index 73e9759b89..82082e1c74 100644 --- a/tests/ut/data/mindrecord/testImageNetDataWhole/labels_map.txt +++ b/tests/ut/data/mindrecord/testImageNetDataWhole/labels_map.txt @@ -1,4 +1,4 @@ -n00000005 0 data_line -n00000006 1 small_iron_box -n00000007 2 plastic_toothpicks -n00000002 3 orange +n00000005 0 +n00000006 1 +n00000007 2 +n00000002 3