From 6020b611ff34305e997749ee29686f11c4cb3416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Komorowicz?= Date: Mon, 18 Sep 2023 18:43:54 +0200 Subject: [PATCH] Moved data augmentation --- docmae/data/augmentation/__init__.py | 0 .../augmentation/random_resized_crop.py} | 0 docmae/{utils => data/augmentation}/replace_background.py | 0 docmae/fine_tune.py | 2 +- tests/datasets.py | 4 ++-- 5 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 docmae/data/augmentation/__init__.py rename docmae/{utils/transforms.py => data/augmentation/random_resized_crop.py} (100%) rename docmae/{utils => data/augmentation}/replace_background.py (100%) diff --git a/docmae/data/augmentation/__init__.py b/docmae/data/augmentation/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/docmae/utils/transforms.py b/docmae/data/augmentation/random_resized_crop.py similarity index 100% rename from docmae/utils/transforms.py rename to docmae/data/augmentation/random_resized_crop.py diff --git a/docmae/utils/replace_background.py b/docmae/data/augmentation/replace_background.py similarity index 100% rename from docmae/utils/replace_background.py rename to docmae/data/augmentation/replace_background.py diff --git a/docmae/fine_tune.py b/docmae/fine_tune.py index 4fc040e..6a6afad 100644 --- a/docmae/fine_tune.py +++ b/docmae/fine_tune.py @@ -18,7 +18,7 @@ from docmae.models.docmae import DocMAE from docmae import setup_logging -from docmae.utils.transforms import RandomResizedCropWithUV +from docmae.data.augmentation.random_resized_crop import RandomResizedCropWithUV logger = logging.getLogger(__name__) diff --git a/tests/datasets.py b/tests/datasets.py index b015a3d..1eb09d0 100644 --- a/tests/datasets.py +++ b/tests/datasets.py @@ -7,8 +7,8 @@ from docmae.data.doc3d import Doc3D from docmae.data.docaligner import DocAligner -from docmae.utils.replace_background import ReplaceBackground -from docmae.utils.transforms import RandomResizedCropWithUV +from docmae.data.augmentation.random_resized_crop import RandomResizedCropWithUV +from docmae.data.augmentation.replace_background import ReplaceBackground os.environ["OPENCV_IO_ENABLE_OPENEXR"] = "1"