Skip to content
Snippets Groups Projects
Commit 8112af86 authored by Solene Tarride's avatar Solene Tarride Committed by Mélodie Boillet
Browse files

Remove PiecewiseAffine augmentation transform

parent 2bb85c50
No related branches found
No related tags found
1 merge request!196Remove PiecewiseAffine augmentation transform
......@@ -6,7 +6,7 @@ from enum import Enum
from random import randint
import numpy as np
from albumentations import OneOf, SomeOf
from albumentations import SomeOf
from albumentations.augmentations import (
Affine,
CoarseDropout,
......@@ -16,7 +16,6 @@ from albumentations.augmentations import (
GaussianBlur,
GaussNoise,
Perspective,
PiecewiseAffine,
Sharpen,
ToGray,
)
......@@ -180,14 +179,7 @@ def get_augmentation_transforms() -> SomeOf:
GaussianBlur(sigma_limit=2.5),
GaussNoise(var_limit=50**2),
ColorJitter(contrast=0.2, brightness=0.2, saturation=0.2, hue=0.2),
OneOf(
[
ElasticTransform(
alpha=20.0, sigma=5.0, alpha_affine=1.0, border_mode=0
),
PiecewiseAffine(scale=(0.01, 0.04), nb_rows=1, nb_cols=4),
]
),
ElasticTransform(alpha=20.0, sigma=5.0, alpha_affine=1.0, border_mode=0),
Sharpen(alpha=(0.0, 1.0)),
ErosionDilation(min_kernel=1, max_kernel=4, iterations=1),
Affine(shear={"x": (-20, 20), "y": (0, 0)}),
......
......@@ -15,6 +15,7 @@ This page lists data augmentation transforms used in DAN.
| CPU time (seconds/10 images) | 0.44 (3013x128 pixels) / 0.86 (1116x581 pixels) |
### PieceWise Affine
:warning: This transform is temporarily removed from the pipeline until [this issue](https://github.com/albumentations-team/albumentations/issues/1442) is fixed.
| | PieceWise Affine |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
......@@ -128,7 +129,6 @@ This page lists data augmentation transforms used in DAN.
* Data augmentation is applied with a probability of 0.9.
* In this case, two transformations are randomly selected to be applied.
* `ElasticTransform` and `PieceWiseAffine` cannot be applied on the same image.
* Reproducibility is possible by setting `random.seed` and `np.random.seed` (already done in `dan/ocr/document/train.py`)
* Examples with new pipeline:
......
......@@ -97,17 +97,7 @@ transforms = SomeOf(
GaussianBlur(sigma_limit=2.5),
GaussNoise(var_limit=50**2),
ColorJitter(contrast=0.2, brightness=0.2, saturation=0.2, hue=0.2),
OneOf(
[
ElasticTransform(
alpha=20.0,
sigma=5.0,
alpha_affine=1.0,
border_mode=0,
),
PiecewiseAffine(scale=(0.01, 0.04), nb_rows=1, nb_cols=4),
]
),
ElasticTransform(alpha=20.0, sigma=5.0, alpha_affine=1.0, border_mode=0),
Sharpen(alpha=(0.0, 1.0)),
ErosionDilation(min_kernel=1, max_kernel=4, iterations=1),
Affine(shear={"x": (-20, 20), "y": (0, 0)}),
......
Source diff could not be displayed: it is stored in LFS. Options to address this: view the blob.
Source diff could not be displayed: it is stored in LFS. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment