Skip to content

Commit

Permalink
img aug version bumped (#658)
Browse files Browse the repository at this point in the history
* img aug version bumped

* fix

* fix in tests

* version bump to 0.4.6

* imguag requirment is now >=0.4.0
  • Loading branch information
ternaus authored Jul 9, 2020
1 parent 31b094f commit 70452cd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion albumentations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import absolute_import

__version__ = "0.4.5"
__version__ = "0.4.6"

from .core.composition import *
from .core.transforms_interface import *
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pkg_resources import DistributionNotFound, get_distribution


INSTALL_REQUIRES = ["numpy>=1.11.1", "scipy", "imgaug>=0.2.5,<0.2.7", "PyYAML"]
INSTALL_REQUIRES = ["numpy>=1.11.1", "scipy", "imgaug>=0.4.0", "PyYAML"]

# If first not installed install second package
CHOOSE_INSTALL_REQUIRES = [("opencv-python>=4.1.1", "opencv-python-headless>=4.1.1")]
Expand Down
6 changes: 3 additions & 3 deletions tests/test_imgaug.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import numpy as np
import pytest

from albumentations.imgaug.transforms import IAAPiecewiseAffine, IAAPerspective, IAAFliplr, IAAFlipud
from albumentations.augmentations.bbox_utils import (
convert_bboxes_from_albumentations,
convert_bboxes_to_albumentations,
)
from albumentations.imgaug.transforms import IAAPiecewiseAffine, IAAPerspective, IAAFliplr, IAAFlipud


@pytest.mark.parametrize("augmentation_cls", [IAAPiecewiseAffine, IAAPerspective, IAAFliplr])
Expand All @@ -21,7 +21,7 @@ def test_imagaug_fliplr_transform_bboxes(image):
aug = IAAFliplr(p=1)
mask = np.copy(image)
bboxes = [(10, 10, 20, 20), (20, 10, 30, 40)]
expect = [(79, 10, 89, 20), (69, 10, 79, 40)]
expect = [(80, 10, 90, 20), (70, 10, 80, 40)]
bboxes = convert_bboxes_to_albumentations(bboxes, "pascal_voc", rows=image.shape[0], cols=image.shape[1])
data = aug(image=image, mask=mask, bboxes=bboxes)
actual = convert_bboxes_from_albumentations(data["bboxes"], "pascal_voc", rows=image.shape[0], cols=image.shape[1])
Expand All @@ -34,7 +34,7 @@ def test_imagaug_flipud_transform_bboxes(image):
mask = np.copy(image)
dummy_class = 1234
bboxes = [(10, 10, 20, 20, dummy_class), (20, 10, 30, 40, dummy_class)]
expect = [(10, 79, 20, 89, dummy_class), (20, 59, 30, 89, dummy_class)]
expect = [(10, 80, 20, 90, dummy_class), (20, 60, 30, 90, dummy_class)]
bboxes = convert_bboxes_to_albumentations(bboxes, "pascal_voc", rows=image.shape[0], cols=image.shape[1])
data = aug(image=image, mask=mask, bboxes=bboxes)
actual = convert_bboxes_from_albumentations(data["bboxes"], "pascal_voc", rows=image.shape[0], cols=image.shape[1])
Expand Down
18 changes: 9 additions & 9 deletions tests/test_keypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

import numpy as np
import pytest
from albumentations import HorizontalFlip, VerticalFlip, IAAFliplr, IAAFlipud, CenterCrop

import albumentations.augmentations.functional as F
from albumentations import HorizontalFlip, VerticalFlip, IAAFliplr, IAAFlipud, CenterCrop
from albumentations.augmentations.keypoints_utils import (
convert_keypoint_from_albumentations,
convert_keypoints_from_albumentations,
convert_keypoint_to_albumentations,
convert_keypoints_to_albumentations,
angle_to_2pi_range,
)
from albumentations.augmentations.transforms import RandomSizedCrop, RandomResizedCrop
from albumentations.core.composition import Compose
from albumentations.core.transforms_interface import NoOp
from albumentations.augmentations.transforms import RandomSizedCrop, RandomResizedCrop
import albumentations.augmentations.functional as F


@pytest.mark.parametrize(
Expand Down Expand Up @@ -222,13 +222,13 @@ def test_keypoint_transform_format_xyas(aug, keypoints, expected):
@pytest.mark.parametrize(
["aug", "keypoints", "expected"],
[
[IAAFliplr, [(20, 30, 0, 0)], [(79, 30, 0, 0)]],
[IAAFliplr, [(20, 30, 45, 0)], [(79, 30, 45, 0)]],
[IAAFliplr, [(20, 30, 90, 0)], [(79, 30, 90, 0)]],
[IAAFliplr, [(20, 30, 0, 0)], [(80, 30, 0, 0)]],
[IAAFliplr, [(20, 30, 45, 0)], [(80, 30, 45, 0)]],
[IAAFliplr, [(20, 30, 90, 0)], [(80, 30, 90, 0)]],
#
[IAAFlipud, [(20, 30, 0, 0)], [(20, 69, 0, 0)]],
[IAAFlipud, [(20, 30, 45, 0)], [(20, 69, 45, 0)]],
[IAAFlipud, [(20, 30, 90, 0)], [(20, 69, 90, 0)]],
[IAAFlipud, [(20, 30, 0, 0)], [(20, 70, 0, 0)]],
[IAAFlipud, [(20, 30, 45, 0)], [(20, 70, 45, 0)]],
[IAAFlipud, [(20, 30, 90, 0)], [(20, 70, 90, 0)]],
],
)
def test_keypoint_transform_format_xy(aug, keypoints, expected):
Expand Down

0 comments on commit 70452cd

Please sign in to comment.