Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
acd835d0
MegEngine
项目概览
MegEngine 天元
/
MegEngine
1 年多 前同步成功
通知
404
Star
4705
Fork
582
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MegEngine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
acd835d0
编写于
11月 23, 2021
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs(mge): add some docs for cvt_color and GraphInference
GitOrigin-RevId: d78628bfcf34d34dd522c9c6546c98c50ccb2bda
上级
0185c1a9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
36 addition
and
1 deletion
+36
-1
imperative/python/megengine/functional/vision.py
imperative/python/megengine/functional/vision.py
+32
-1
imperative/python/megengine/utils/comp_graph_tools.py
imperative/python/megengine/utils/comp_graph_tools.py
+4
-0
未找到文件。
imperative/python/megengine/functional/vision.py
浏览文件 @
acd835d0
...
@@ -44,6 +44,37 @@ def cvt_color(inp: Tensor, mode: str = ""):
...
@@ -44,6 +44,37 @@ def cvt_color(inp: Tensor, mode: str = ""):
Returns:
Returns:
convert result.
convert result.
Note:
There are different supported modes for different combinations of :attr:`~.Tensor.device` and :attr:`~.Tensor.dtype`.
x86/ARM:
float32:
"RGB2GRAY", "RGB2YUV", "YUV2RGB", "GRAY2RGB", "BGR2GRAY"
uint8:
"RGB2GRAY", "RGB2YUV", "YUV2RGB", "GRAY2RGB", "RGBA2RGB", "RGBA2BGR",
"RGBA2GRAY", "RGB2BGR", "BGR2GRAY", "BGR2RGB", "YUV2GRAY_NV21", "YUV2RGB_NV21",
"YUV2BGR_NV21", "YUV2GRAY_NV12", "YUV2RGB_NV12", "YUV2BGR_NV12", "YUV2GRAY_YV12",
"YUV2RGB_YV12", "YUV2BGR_YV12", "YUV2GRAY_YU12", "YUV2RGB_YU12", "YUV2BGR_YU12",
"YCrCb2RGB", "YCrCb2BGR", "BT601_YUV2RGB_NV21", "BT601_YUV2BGR_NV21", "BT601_YUV2RGB_NV12",
"BT601_YUV2BGR_NV12", "BT601_YUV2RGB_YV12", "BT601_YUV2BGR_YV12" ,"BT601_YUV2RGB_YU12",
"BT601_YUV2BGR_YU12"
CUDA:
float32:
"RGB2GRAY", "BGR2GRAY", "RGB2YUV", "YUV2RGB", "GRAY2RGB"
uint8:
"RGB2GRAY", "BGR2GRAY", "RGB2YUV", "YUV2RGB", "GRAY2RGB",
"YUV2GRAY_NV12", "YUV2GRAY_NV21", "YUV2GRAY_YU12"
"YUV2GRAY_YV12", "YUV2RGB_NV12", "YUV2RGB_NV21", "YUV2BGR_NV12"
"YUV2BGR_NV21", "YUV2RGB_YU12", "YUV2RGB_YV12", "YUV2BGR_YU12",
"YUV2BGR_YV12"
Examples:
Examples:
.. testcode::
.. testcode::
...
@@ -62,7 +93,7 @@ def cvt_color(inp: Tensor, mode: str = ""):
...
@@ -62,7 +93,7 @@ def cvt_color(inp: Tensor, mode: str = ""):
[[[[0.86555195]]]]
[[[[0.86555195]]]]
"""
"""
mode
=
mode
.
upper
()
mode
=
mode
.
upper
()
if
"YCrCb"
not
in
mode
else
mode
assert
mode
in
builtin
.
CvtColor
.
Mode
.
__dict__
,
"unspport mode for cvt_color"
assert
mode
in
builtin
.
CvtColor
.
Mode
.
__dict__
,
"unspport mode for cvt_color"
mode
=
getattr
(
builtin
.
CvtColor
.
Mode
,
mode
)
mode
=
getattr
(
builtin
.
CvtColor
.
Mode
,
mode
)
assert
isinstance
(
mode
,
builtin
.
CvtColor
.
Mode
)
assert
isinstance
(
mode
,
builtin
.
CvtColor
.
Mode
)
...
...
imperative/python/megengine/utils/comp_graph_tools.py
浏览文件 @
acd835d0
...
@@ -480,6 +480,10 @@ class GraphInference:
...
@@ -480,6 +480,10 @@ class GraphInference:
Returns:
Returns:
a dict {output_name: output_value}.
a dict {output_name: output_value}.
Note:
Note that the order of the Graph's input nodes may be different from the order of the origin traced function's arguments.
It is recommended to use ``inp_dict`` to provide input data by name.
"""
"""
assert
len
(
inp_args
)
<=
len
(
assert
len
(
inp_args
)
<=
len
(
self
.
_inp_dict
self
.
_inp_dict
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录