!45959 update comment for ImageNetToMR api

Merge pull request !45959 from guozhijian/code_docs_imagenet_to_mr
This commit is contained in:
i-robot 2022-11-25 03:27:23 +00:00 committed by Gitee
commit 685b659d24
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 6 additions and 3 deletions

View File

@ -4,7 +4,7 @@
将ImageNet数据集转换为MindRecord格式数据集。
参数:
- **map_file** (str) - 标签映射文件的路径。映射文件内容如下:
- **map_file** (str) - 标签映射文件的路径。该文件可通过命令: `ls -l [image_dir] | grep -vE "总用量|total|\." | awk -F " " '{print $9, NR-1;}' > [file_path]` 生成,其中 `image_dir` 为ImageNet数据集的目录路径 `file_path` 为生成的 `map_file` 文件 。 `map_file` 文件内容示例如下:
.. code-block::

View File

@ -27,11 +27,14 @@ __all__ = ['ImageNetToMR']
class ImageNetToMR:
"""
r"""
A class to transform from imagenet to MindRecord.
Args:
map_file (str): The map file that indicates label. The map file content should be like this:
map_file (str): The map file that indicates label. This file can be generated by command
`ls -l [image_dir] | grep -vE "total|\." | awk -F " " '{print $9, NR-1;}' > [file_path]` , where `image_dir`
is image directory contains n02119789, n02100735, n02110185 and n02096294 directory and `file_path` is
the generated `map_file` . An example of `map_file` is as below:
.. code-block::