Skip to content

Cleanup prototype datasets CI and related things #6944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .circleci/config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions .circleci/config.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,6 @@ commands:
args: --no-build-isolation <<# parameters.editable >> --editable <</ parameters.editable >> .
descr: Install torchvision <<# parameters.editable >> in editable mode <</ parameters.editable >>

install_prototype_dependencies:
Copy link
Member

@NicolasHug NicolasHug Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks Philip, Do you mind just leaving that one last time, to make sure CI is still green with the new changes (and then we can remove it in this PR)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You commented on the CircleCi config, but these test continue to run. We only removed the dependencies there. You meant that I should run the datasets tests again, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've temporarily reinstated the prototype datasets CI in 215fb18. LMK if that is not what you wanted.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is red, but for an unrelated failure on the transforms tests. Datasets tests are green.

steps:
- pip_install:
args: iopath
descr: Install third-party dependencies
- pip_install:
args: --pre torchdata --extra-index-url https://download.pytorch.org/whl/nightly/cpu
descr: Install torchdata from nightly releases

# Most of the test suite is handled by the `unittest` jobs, with completely different workflow and setup.
# This command can be used if only a selection of tests need to be run, for ad-hoc files.
run_tests_selective:
Expand Down Expand Up @@ -326,7 +317,6 @@ jobs:
- checkout
- install_torchvision:
editable: true
- install_prototype_dependencies
- pip_install:
args: mypy
descr: Install Python type check utilities
Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/prototype-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:
uses: actions/checkout@v3

- name: Install PyTorch nightly builds
run: pip install --progress-bar=off --pre torch torchdata --extra-index-url https://download.pytorch.org/whl/nightly/cpu/
run: pip install --progress-bar=off --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu/

- name: Install torchvision
run: pip install --progress-bar=off --no-build-isolation --editable .

- name: Install other prototype dependencies
run: pip install --progress-bar=off scipy pycocotools h5py iopath
run: pip install --progress-bar=off scipy pycocotools h5py

- name: Install test requirements
run: pip install --progress-bar=off pytest pytest-mock pytest-cov
Expand All @@ -52,16 +52,6 @@ jobs:
--cov-report=term-missing \
test/test_prototype_features*.py

- name: Run prototype datasets tests
if: success() || ( failure() && steps.setup.conclusion == 'success' )
shell: bash
run: |
pytest \
--durations=20 \
--cov=torchvision/prototype/datasets \
--cov-report=term-missing \
test/test_prototype_datasets*.py

- name: Run prototype transforms tests
if: success() || ( failure() && steps.setup.conclusion == 'success' )
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion torchvision/prototype/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import datasets, features, models, transforms, utils
from . import features, models, transforms, utils
4 changes: 2 additions & 2 deletions torchvision/prototype/datasets/_builtin/caltech.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

import numpy as np
from torchdata.datapipes.iter import Filter, IterDataPipe, IterKeyZipper, Mapper
from torchvision.prototype.datasets.utils import Dataset, GDriveResource, OnlineResource
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, GDriveResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import (
hint_sharding,
hint_shuffling,
INFINITE_BUFFER_SIZE,
read_categories_file,
read_mat,
)
from torchvision.prototype.features import _Feature, BoundingBox, EncodedImage, Label
from torchvision.prototype.features import _Feature, BoundingBox, Label

from .._api import register_dataset, register_info

Expand Down
4 changes: 2 additions & 2 deletions torchvision/prototype/datasets/_builtin/celeba.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
from typing import Any, BinaryIO, Dict, Iterator, List, Optional, Sequence, Tuple, Union

from torchdata.datapipes.iter import Filter, IterDataPipe, IterKeyZipper, Mapper, Zipper
from torchvision.prototype.datasets.utils import Dataset, GDriveResource, OnlineResource
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, GDriveResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import (
getitem,
hint_sharding,
hint_shuffling,
INFINITE_BUFFER_SIZE,
path_accessor,
)
from torchvision.prototype.features import _Feature, BoundingBox, EncodedImage, Label
from torchvision.prototype.features import _Feature, BoundingBox, Label

from .._api import register_dataset, register_info

Expand Down
4 changes: 2 additions & 2 deletions torchvision/prototype/datasets/_builtin/clevr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Any, BinaryIO, Dict, List, Optional, Tuple, Union

from torchdata.datapipes.iter import Demultiplexer, Filter, IterDataPipe, IterKeyZipper, JsonParser, Mapper, UnBatcher
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import (
getitem,
hint_sharding,
Expand All @@ -11,7 +11,7 @@
path_accessor,
path_comparator,
)
from torchvision.prototype.features import EncodedImage, Label
from torchvision.prototype.features import Label

from .._api import register_dataset, register_info

Expand Down
4 changes: 2 additions & 2 deletions torchvision/prototype/datasets/_builtin/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Mapper,
UnBatcher,
)
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import (
getitem,
hint_sharding,
Expand All @@ -24,7 +24,7 @@
path_accessor,
read_categories_file,
)
from torchvision.prototype.features import _Feature, BoundingBox, EncodedImage, Label
from torchvision.prototype.features import _Feature, BoundingBox, Label

from .._api import register_dataset, register_info

Expand Down
4 changes: 2 additions & 2 deletions torchvision/prototype/datasets/_builtin/country211.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
from typing import Any, Dict, List, Tuple, Union

from torchdata.datapipes.iter import Filter, IterDataPipe, Mapper
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import (
hint_sharding,
hint_shuffling,
path_comparator,
read_categories_file,
)
from torchvision.prototype.features import EncodedImage, Label
from torchvision.prototype.features import Label

from .._api import register_dataset, register_info

Expand Down
4 changes: 2 additions & 2 deletions torchvision/prototype/datasets/_builtin/cub200.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Mapper,
)
from torchdata.datapipes.map import IterToMapConverter
from torchvision.prototype.datasets.utils import Dataset, GDriveResource, OnlineResource
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, GDriveResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import (
getitem,
hint_sharding,
Expand All @@ -25,7 +25,7 @@
read_categories_file,
read_mat,
)
from torchvision.prototype.features import _Feature, BoundingBox, EncodedImage, Label
from torchvision.prototype.features import _Feature, BoundingBox, Label

from .._api import register_dataset, register_info

Expand Down
4 changes: 2 additions & 2 deletions torchvision/prototype/datasets/_builtin/dtd.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Any, BinaryIO, Dict, List, Optional, Tuple, Union

from torchdata.datapipes.iter import CSVParser, Demultiplexer, Filter, IterDataPipe, IterKeyZipper, LineReader, Mapper
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import (
getitem,
hint_sharding,
Expand All @@ -12,7 +12,7 @@
path_comparator,
read_categories_file,
)
from torchvision.prototype.features import EncodedImage, Label
from torchvision.prototype.features import Label

from .._api import register_dataset, register_info

Expand Down
4 changes: 2 additions & 2 deletions torchvision/prototype/datasets/_builtin/eurosat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from typing import Any, Dict, List, Tuple, Union

from torchdata.datapipes.iter import IterDataPipe, Mapper
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import hint_sharding, hint_shuffling
from torchvision.prototype.features import EncodedImage, Label
from torchvision.prototype.features import Label

from .._api import register_dataset, register_info

Expand Down
4 changes: 2 additions & 2 deletions torchvision/prototype/datasets/_builtin/food101.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Any, BinaryIO, Dict, List, Optional, Tuple, Union

from torchdata.datapipes.iter import Demultiplexer, Filter, IterDataPipe, IterKeyZipper, LineReader, Mapper
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import (
getitem,
hint_sharding,
Expand All @@ -11,7 +11,7 @@
path_comparator,
read_categories_file,
)
from torchvision.prototype.features import EncodedImage, Label
from torchvision.prototype.features import Label

from .._api import register_dataset, register_info

Expand Down
4 changes: 2 additions & 2 deletions torchvision/prototype/datasets/_builtin/gtsrb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
from typing import Any, Dict, List, Optional, Tuple, Union

from torchdata.datapipes.iter import CSVDictParser, Demultiplexer, Filter, IterDataPipe, Mapper, Zipper
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import (
hint_sharding,
hint_shuffling,
INFINITE_BUFFER_SIZE,
path_comparator,
)
from torchvision.prototype.features import BoundingBox, EncodedImage, Label
from torchvision.prototype.features import BoundingBox, Label

from .._api import register_dataset, register_info

Expand Down
4 changes: 2 additions & 2 deletions torchvision/prototype/datasets/_builtin/imagenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
TarArchiveLoader,
)
from torchdata.datapipes.map import IterToMapConverter
from torchvision.prototype.datasets.utils import Dataset, ManualDownloadResource, OnlineResource
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, ManualDownloadResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import (
getitem,
hint_sharding,
Expand All @@ -25,7 +25,7 @@
read_categories_file,
read_mat,
)
from torchvision.prototype.features import EncodedImage, Label
from torchvision.prototype.features import Label

from .._api import register_dataset, register_info

Expand Down
4 changes: 2 additions & 2 deletions torchvision/prototype/datasets/_builtin/oxford_iiit_pet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Any, BinaryIO, Dict, List, Optional, Tuple, Union

from torchdata.datapipes.iter import CSVDictParser, Demultiplexer, Filter, IterDataPipe, IterKeyZipper, Mapper
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import (
getitem,
hint_sharding,
Expand All @@ -13,7 +13,7 @@
path_comparator,
read_categories_file,
)
from torchvision.prototype.features import EncodedImage, Label
from torchvision.prototype.features import Label

from .._api import register_dataset, register_info

Expand Down
4 changes: 2 additions & 2 deletions torchvision/prototype/datasets/_builtin/sbd.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import numpy as np
from torchdata.datapipes.iter import Demultiplexer, Filter, IterDataPipe, IterKeyZipper, LineReader, Mapper
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import (
getitem,
hint_sharding,
Expand All @@ -15,7 +15,7 @@
read_categories_file,
read_mat,
)
from torchvision.prototype.features import _Feature, EncodedImage
from torchvision.prototype.features import _Feature

from .._api import register_dataset, register_info

Expand Down
4 changes: 2 additions & 2 deletions torchvision/prototype/datasets/_builtin/stanford_cars.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
from typing import Any, BinaryIO, Dict, Iterator, List, Tuple, Union

from torchdata.datapipes.iter import Filter, IterDataPipe, Mapper, Zipper
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import (
hint_sharding,
hint_shuffling,
path_comparator,
read_categories_file,
read_mat,
)
from torchvision.prototype.features import BoundingBox, EncodedImage, Label
from torchvision.prototype.features import BoundingBox, Label

from .._api import register_dataset, register_info

Expand Down
4 changes: 2 additions & 2 deletions torchvision/prototype/datasets/_builtin/voc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from torchdata.datapipes.iter import Demultiplexer, Filter, IterDataPipe, IterKeyZipper, LineReader, Mapper
from torchvision.datasets import VOCDetection
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import (
getitem,
hint_sharding,
Expand All @@ -16,7 +16,7 @@
path_comparator,
read_categories_file,
)
from torchvision.prototype.features import BoundingBox, EncodedImage, Label
from torchvision.prototype.features import BoundingBox, Label

from .._api import register_dataset, register_info

Expand Down
3 changes: 2 additions & 1 deletion torchvision/prototype/datasets/_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
from typing import Any, BinaryIO, Collection, Dict, List, Optional, Tuple, Union

from torchdata.datapipes.iter import FileLister, FileOpener, Filter, IterDataPipe, Mapper
from torchvision.prototype.datasets.utils import EncodedData, EncodedImage
from torchvision.prototype.datasets.utils._internal import hint_sharding, hint_shuffling
from torchvision.prototype.features import EncodedData, EncodedImage, Label
from torchvision.prototype.features import Label


__all__ = ["from_data_folder", "from_image_folder"]
Expand Down
1 change: 1 addition & 0 deletions torchvision/prototype/datasets/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from . import _internal # usort: skip
from ._dataset import Dataset
from ._encoded import EncodedData, EncodedImage
from ._resource import GDriveResource, HttpResource, KaggleDownloadResource, ManualDownloadResource, OnlineResource
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import PIL.Image
import torch
from torchvision.prototype.utils._internal import fromfile, ReadOnlyTensorBuffer

from ._feature import _Feature
from torchvision.prototype.features._feature import _Feature
from torchvision.prototype.utils._internal import fromfile, ReadOnlyTensorBuffer

D = TypeVar("D", bound="EncodedData")

Expand Down
1 change: 0 additions & 1 deletion torchvision/prototype/features/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from ._bounding_box import BoundingBox, BoundingBoxFormat
from ._encoded import EncodedData, EncodedImage
from ._feature import _Feature, FillType, FillTypeJIT, InputType, InputTypeJIT, is_simple_tensor
from ._image import ColorSpace, Image, ImageType, ImageTypeJIT, TensorImageType, TensorImageTypeJIT
from ._label import Label, OneHotLabel
Expand Down
2 changes: 1 addition & 1 deletion torchvision/prototype/transforms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
TransposeDimensions,
)
from ._temporal import UniformTemporalSubsample
from ._type_conversion import DecodeImage, LabelToOneHot, PILToTensor, ToImagePIL, ToImageTensor, ToPILImage
from ._type_conversion import LabelToOneHot, PILToTensor, ToImagePIL, ToImageTensor, ToPILImage

from ._deprecated import Grayscale, RandomGrayscale, ToTensor # usort: skip
Loading