Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
正统之独孤求败
mindspore
提交
cb942d06
M
mindspore
项目概览
正统之独孤求败
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
0
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,发现更多精彩内容 >>
提交
cb942d06
编写于
5月 27, 2020
作者:
A
Amir Lashkari
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added ComposeOp transform list check
上级
2d1e1f40
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
1 deletion
+24
-1
mindspore/dataset/transforms/vision/py_transforms.py
mindspore/dataset/transforms/vision/py_transforms.py
+2
-1
mindspore/dataset/transforms/vision/validators.py
mindspore/dataset/transforms/vision/validators.py
+22
-0
未找到文件。
mindspore/dataset/transforms/vision/py_transforms.py
浏览文件 @
cb942d06
...
@@ -32,7 +32,7 @@ from .validators import check_prob, check_crop, check_resize_interpolation, chec
...
@@ -32,7 +32,7 @@ from .validators import check_prob, check_crop, check_resize_interpolation, chec
check_normalize_py
,
check_random_crop
,
check_random_color_adjust
,
check_random_rotation
,
\
check_normalize_py
,
check_random_crop
,
check_random_color_adjust
,
check_random_rotation
,
\
check_transforms_list
,
check_random_apply
,
check_ten_crop
,
check_num_channels
,
check_pad
,
\
check_transforms_list
,
check_random_apply
,
check_ten_crop
,
check_num_channels
,
check_pad
,
\
check_random_perspective
,
check_random_erasing
,
check_cutout
,
check_linear_transform
,
check_random_affine
,
\
check_random_perspective
,
check_random_erasing
,
check_cutout
,
check_linear_transform
,
check_random_affine
,
\
check_mix_up
,
check_positive_degrees
,
check_uniform_augment_py
check_mix_up
,
check_positive_degrees
,
check_uniform_augment_py
,
check_compose_list
from
.utils
import
Inter
,
Border
from
.utils
import
Inter
,
Border
DE_PY_INTER_MODE
=
{
Inter
.
NEAREST
:
Image
.
NEAREST
,
DE_PY_INTER_MODE
=
{
Inter
.
NEAREST
:
Image
.
NEAREST
,
...
@@ -75,6 +75,7 @@ class ComposeOp:
...
@@ -75,6 +75,7 @@ class ComposeOp:
>>> dataset = dataset.map(input_columns="image", operations=transform())
>>> dataset = dataset.map(input_columns="image", operations=transform())
"""
"""
@
check_compose_list
def
__init__
(
self
,
transforms
):
def
__init__
(
self
,
transforms
):
self
.
transforms
=
transforms
self
.
transforms
=
transforms
...
...
mindspore/dataset/transforms/vision/validators.py
浏览文件 @
cb942d06
...
@@ -907,3 +907,25 @@ def check_positive_degrees(method):
...
@@ -907,3 +907,25 @@ def check_positive_degrees(method):
return
method
(
self
,
**
kwargs
)
return
method
(
self
,
**
kwargs
)
return
new_method
return
new_method
def
check_compose_list
(
method
):
"""Wrapper method to check the transform list of ComposeOp."""
@
wraps
(
method
)
def
new_method
(
self
,
*
args
,
**
kwargs
):
transforms
=
(
list
(
args
)
+
[
None
])[
0
]
if
"transforms"
in
kwargs
:
transforms
=
kwargs
.
get
(
"transforms"
)
if
transforms
is
None
:
raise
ValueError
(
"transforms is not provided."
)
if
not
transforms
:
raise
ValueError
(
"transforms list is empty."
)
if
not
isinstance
(
transforms
,
list
):
raise
TypeError
(
"transforms is not a python list"
)
kwargs
[
"transforms"
]
=
transforms
return
method
(
self
,
**
kwargs
)
return
new_method
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录