Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Fix inconsistent interpolation method values (#16212)
Browse files Browse the repository at this point in the history
In cv2, bicubic interpolation should be represented by 2, and area-based interpolation should be 3. This is correct in the docstring of `imresize` method, but wrong in the docstring of several other methods, which can be quite confusing when following the documentation.
  • Loading branch information
SayHiRay authored and marcoabreu committed Sep 22, 2019
1 parent 37c641f commit 93b794e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python/mxnet/image/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,11 @@ def _get_interp_method(interp, sizes=()):
Possible values:
0: Nearest Neighbors Interpolation.
1: Bilinear interpolation.
2: Area-based (resampling using pixel area relation). It may be a
2: Bicubic interpolation over 4x4 pixel neighborhood.
3: Area-based (resampling using pixel area relation). It may be a
preferred method for image decimation, as it gives moire-free
results. But when the image is zoomed, it is similar to the Nearest
Neighbors method. (used by default).
3: Bicubic interpolation over 4x4 pixel neighborhood.
4: Lanczos interpolation over 8x8 pixel neighborhood.
9: Cubic for enlarge, area for shrink, bilinear for others
10: Random select from interpolation method metioned above.
Expand Down Expand Up @@ -372,11 +372,11 @@ def resize_short(src, size, interp=2):
Possible values:
0: Nearest Neighbors Interpolation.
1: Bilinear interpolation.
2: Area-based (resampling using pixel area relation). It may be a
2: Bicubic interpolation over 4x4 pixel neighborhood.
3: Area-based (resampling using pixel area relation). It may be a
preferred method for image decimation, as it gives moire-free
results. But when the image is zoomed, it is similar to the Nearest
Neighbors method. (used by default).
3: Bicubic interpolation over 4x4 pixel neighborhood.
4: Lanczos interpolation over 8x8 pixel neighborhood.
9: Cubic for enlarge, area for shrink, bilinear for others
10: Random select from interpolation method metioned above.
Expand Down Expand Up @@ -1062,11 +1062,11 @@ def CreateAugmenter(data_shape, resize=0, rand_crop=False, rand_resize=False, ra
Possible values:
0: Nearest Neighbors Interpolation.
1: Bilinear interpolation.
2: Area-based (resampling using pixel area relation). It may be a
2: Bicubic interpolation over 4x4 pixel neighborhood.
3: Area-based (resampling using pixel area relation). It may be a
preferred method for image decimation, as it gives moire-free
results. But when the image is zoomed, it is similar to the Nearest
Neighbors method. (used by default).
3: Bicubic interpolation over 4x4 pixel neighborhood.
4: Lanczos interpolation over 8x8 pixel neighborhood.
9: Cubic for enlarge, area for shrink, bilinear for others
10: Random select from interpolation method metioned above.
Expand Down

0 comments on commit 93b794e

Please sign in to comment.