Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_44025039
mindspore
提交
9401e7d9
M
mindspore
项目概览
weixin_44025039
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9401e7d9
编写于
8月 11, 2020
作者:
Y
yanghaitao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix doc
上级
f92735d1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
14 deletion
+12
-14
mindspore/dataset/engine/datasets.py
mindspore/dataset/engine/datasets.py
+12
-14
未找到文件。
mindspore/dataset/engine/datasets.py
浏览文件 @
9401e7d9
...
@@ -1301,17 +1301,6 @@ class Dataset:
...
@@ -1301,17 +1301,6 @@ class Dataset:
return
self
.
children
[
0
].
get_repeat_count
()
return
self
.
children
[
0
].
get_repeat_count
()
return
1
return
1
def
get_class_indexing
(
self
):
"""
Get the class index.
Return:
Dict, A str-to-int mapping from label name to index.
"""
if
self
.
children
:
return
self
.
children
[
0
].
get_class_indexing
()
raise
NotImplementedError
(
"Dataset {} has not supported api get_class_indexing yet."
.
format
(
type
(
self
)))
def
reset
(
self
):
def
reset
(
self
):
"""Reset the dataset for next epoch."""
"""Reset the dataset for next epoch."""
...
@@ -1448,7 +1437,7 @@ class MappableDataset(SourceDataset):
...
@@ -1448,7 +1437,7 @@ class MappableDataset(SourceDataset):
sizes (Union[list[int], list[float]]): If a list of integers [s1, s2, …, sn] is
sizes (Union[list[int], list[float]]): If a list of integers [s1, s2, …, sn] is
provided, the dataset will be split into n datasets of size s1, size s2, …, size sn
provided, the dataset will be split into n datasets of size s1, size s2, …, size sn
respectively. If the sum of all sizes does not equal the original dataset size, an
respectively. If the sum of all sizes does not equal the original dataset size, an
an
error will occur.
error will occur.
If a list of floats [f1, f2, …, fn] is provided, all floats must be between 0 and 1
If a list of floats [f1, f2, …, fn] is provided, all floats must be between 0 and 1
and must sum to 1, otherwise an error will occur. The dataset will be split into n
and must sum to 1, otherwise an error will occur. The dataset will be split into n
Datasets of size round(f1*K), round(f2*K), …, round(fn*K) where K is the size of the
Datasets of size round(f1*K), round(f2*K), …, round(fn*K) where K is the size of the
...
@@ -1543,7 +1532,16 @@ class DatasetOp(Dataset):
...
@@ -1543,7 +1532,16 @@ class DatasetOp(Dataset):
"""
"""
# No need for __init__ since it is the same as the super's init
# No need for __init__ since it is the same as the super's init
def
get_class_indexing
(
self
):
"""
Get the class index.
Return:
Dict, A str-to-int mapping from label name to index.
"""
if
self
.
children
:
return
self
.
children
[
0
].
get_class_indexing
()
raise
NotImplementedError
(
"Dataset {} has not supported api get_class_indexing yet."
.
format
(
type
(
self
)))
class
BucketBatchByLengthDataset
(
DatasetOp
):
class
BucketBatchByLengthDataset
(
DatasetOp
):
"""
"""
...
@@ -2506,7 +2504,7 @@ class ImageFolderDatasetV2(MappableDataset):
...
@@ -2506,7 +2504,7 @@ class ImageFolderDatasetV2(MappableDataset):
The generated dataset has two columns ['image', 'label'].
The generated dataset has two columns ['image', 'label'].
The shape of the image column is [image_size] if decode flag is False, or [H,W,C]
The shape of the image column is [image_size] if decode flag is False, or [H,W,C]
otherwise.
otherwise.
The type of the image tensor is uint8. The label is just a scalar
uint64
The type of the image tensor is uint8. The label is just a scalar
int32
tensor.
tensor.
This dataset can take in a sampler. sampler and shuffle are mutually exclusive. Table
This dataset can take in a sampler. sampler and shuffle are mutually exclusive. Table
below shows what input args are allowed and their expected behavior.
below shows what input args are allowed and their expected behavior.
...
@@ -2578,7 +2576,7 @@ class ImageFolderDatasetV2(MappableDataset):
...
@@ -2578,7 +2576,7 @@ class ImageFolderDatasetV2(MappableDataset):
>>> # 2) read all samples (image files) from folder cat and folder dog with label 0 and 1
>>> # 2) read all samples (image files) from folder cat and folder dog with label 0 and 1
>>> imagefolder_dataset = ds.ImageFolderDatasetV2(dataset_dir,class_indexing={"cat":0,"dog":1})
>>> imagefolder_dataset = ds.ImageFolderDatasetV2(dataset_dir,class_indexing={"cat":0,"dog":1})
>>> # 3) read all samples (image files) in dataset_dir with extensions .JPEG and .png (case sensitive)
>>> # 3) read all samples (image files) in dataset_dir with extensions .JPEG and .png (case sensitive)
>>> imagefolder_dataset = ds.ImageFolderDatasetV2(dataset_dir, extensions=
{".JPEG",".png"}
)
>>> imagefolder_dataset = ds.ImageFolderDatasetV2(dataset_dir, extensions=
[".JPEG",".png"]
)
"""
"""
@
check_imagefolderdatasetv2
@
check_imagefolderdatasetv2
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录