diff --git a/rastervision_core/rastervision/core/data/utils/__init__.py b/rastervision_core/rastervision/core/data/utils/__init__.py index 2b55b12f4a..f4742c6e39 100644 --- a/rastervision_core/rastervision/core/data/utils/__init__.py +++ b/rastervision_core/rastervision/core/data/utils/__init__.py @@ -6,3 +6,4 @@ from rastervision.core.data.utils.raster import * from rastervision.core.data.utils.rasterio import * from rastervision.core.data.utils.vectorization import * +from rastervision.core.data.utils.aoi_sampler import * diff --git a/rastervision_pytorch_learner/rastervision/pytorch_learner/dataset/utils/aoi_sampler.py b/rastervision_core/rastervision/core/data/utils/aoi_sampler.py similarity index 100% rename from rastervision_pytorch_learner/rastervision/pytorch_learner/dataset/utils/aoi_sampler.py rename to rastervision_core/rastervision/core/data/utils/aoi_sampler.py diff --git a/rastervision_core/requirements.txt b/rastervision_core/requirements.txt index 08dbc0975f..f845462eaa 100644 --- a/rastervision_core/requirements.txt +++ b/rastervision_core/requirements.txt @@ -15,3 +15,4 @@ scikit-image==0.21.0 boto3==1.34.14 stackstac==0.5.0 humanize==4.8.0 +triangle==20220202 diff --git a/rastervision_pytorch_learner/rastervision/pytorch_learner/dataset/dataset.py b/rastervision_pytorch_learner/rastervision/pytorch_learner/dataset/dataset.py index 407ef3ebde..18fd5b204d 100644 --- a/rastervision_pytorch_learner/rastervision/pytorch_learner/dataset/dataset.py +++ b/rastervision_pytorch_learner/rastervision/pytorch_learner/dataset/dataset.py @@ -8,10 +8,10 @@ from rastervision.core.box import Box from rastervision.core.data import Scene +from rastervision.core.data.utils import AoiSampler from rastervision.pytorch_learner.learner_config import PosInt, NonNegInt from rastervision.pytorch_learner.dataset.transform import (TransformType, TF_TYPE_TO_TF_FUNC) -from rastervision.pytorch_learner.dataset.utils import AoiSampler log = logging.getLogger(__name__) diff --git a/rastervision_pytorch_learner/rastervision/pytorch_learner/dataset/utils/__init__.py b/rastervision_pytorch_learner/rastervision/pytorch_learner/dataset/utils/__init__.py index 9a43631090..132766502a 100644 --- a/rastervision_pytorch_learner/rastervision/pytorch_learner/dataset/utils/__init__.py +++ b/rastervision_pytorch_learner/rastervision/pytorch_learner/dataset/utils/__init__.py @@ -1,10 +1,8 @@ # flake8: noqa from rastervision.pytorch_learner.dataset.utils.utils import * -from rastervision.pytorch_learner.dataset.utils.aoi_sampler import * __all__ = [ - AoiSampler.__name__, DatasetError.__name__, ImageDatasetError.__name__, GeoDatasetError.__name__, diff --git a/rastervision_pytorch_learner/requirements.txt b/rastervision_pytorch_learner/requirements.txt index d8b7c9c733..7f417ca889 100644 --- a/rastervision_pytorch_learner/requirements.txt +++ b/rastervision_pytorch_learner/requirements.txt @@ -9,7 +9,6 @@ albumentations==1.3.1 cython==0.29.35 pycocotools==2.0.7 psutil==5.9.3 -triangle==20220202 opencv-python-headless==4.9.0.80 matplotlib==3.8.2 tqdm==4.66.1 diff --git a/tests/pytorch_learner/dataset/test_aoi_sampler.py b/tests/core/data/utils/test_aoi_sampler.py similarity index 97% rename from tests/pytorch_learner/dataset/test_aoi_sampler.py rename to tests/core/data/utils/test_aoi_sampler.py index 70ce251544..822adfdfa8 100644 --- a/tests/pytorch_learner/dataset/test_aoi_sampler.py +++ b/tests/core/data/utils/test_aoi_sampler.py @@ -6,7 +6,7 @@ from scipy.stats import chisquare from shapely.geometry import Polygon, MultiPolygon, MultiPoint -from rastervision.pytorch_learner.dataset.utils import AoiSampler +from rastervision.core.data.utils import AoiSampler class TestAoiSampler(unittest.TestCase):