!45959 update comment for ImageNetToMR api
Merge pull request !45959 from guozhijian/code_docs_imagenet_to_mr
This commit is contained in:
commit
685b659d24
|
@ -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::
|
||||
|
||||
|
|
|
@ -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::
|
||||
|
||||
|
|
Loading…
Reference in New Issue