浏览代码

!10903 dataset: expose area interpolation for resize op

From: @ms_yan
Reviewed-by: @pandoublefeng,@heleiwang
Signed-off-by: @heleiwang
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 4 年前
父节点
当前提交
61c83bef88
共有 2 个文件被更改,包括 5 次插入1 次删除
  1. +4
    -1
      mindspore/dataset/vision/c_transforms.py
  2. +1
    -0
      mindspore/dataset/vision/utils.py

+ 4
- 1
mindspore/dataset/vision/c_transforms.py 查看文件

@@ -58,7 +58,8 @@ from .validators import check_prob, check_crop, check_resize_interpolation, chec

DE_C_INTER_MODE = {Inter.NEAREST: cde.InterpolationMode.DE_INTER_NEAREST_NEIGHBOUR,
Inter.LINEAR: cde.InterpolationMode.DE_INTER_LINEAR,
Inter.CUBIC: cde.InterpolationMode.DE_INTER_CUBIC}
Inter.CUBIC: cde.InterpolationMode.DE_INTER_CUBIC,
Inter.AREA: cde.InterpolationMode.DE_INTER_AREA}

DE_C_BORDER_TYPE = {Border.CONSTANT: cde.BorderType.DE_BORDER_CONSTANT,
Border.EDGE: cde.BorderType.DE_BORDER_EDGE,
@@ -731,6 +732,8 @@ class Resize(cde.ResizeOp):

- Inter.BICUBIC, means interpolation method is bicubic interpolation.

- Inter.AREA, means interpolation method is pixel area interpolation.

Examples:
>>> from mindspore.dataset.vision import Inter
>>> decode_op = c_vision.Decode()


+ 1
- 0
mindspore/dataset/vision/utils.py 查看文件

@@ -22,6 +22,7 @@ class Inter(IntEnum):
ANTIALIAS = 1
BILINEAR = LINEAR = 2
BICUBIC = CUBIC = 3
AREA = 4


# Padding Mode, Border Type


正在加载...
取消
保存