Skip to content

Commit

Permalink
Merge branch 'main' into make-image-channels-last
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeier committed Aug 24, 2023
2 parents 2521f39 + 054432d commit 6056621
Show file tree
Hide file tree
Showing 80 changed files with 1,302 additions and 712 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ jobs:
sed -i -e 's/-j auto/-j 1/' Makefile
make html
# Below is an imperfect way for us to add "try on collab" links to all of our gallery examples.
# sphinx-gallery will convert all gallery examples to .ipynb notebooks and stores them in
# build/html/_downloads/<some_hash>/<example_name>.ipynb
# We copy all those ipynb files in a more convenient folder so that we can more easily link to them.
mkdir build/html/_generated_ipynb_notebooks
for file in `find build/html/_downloads`; do
if [[ $file == *.ipynb ]]; then
Expand Down
30 changes: 15 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ We want to make contributing to this project as easy and transparent as possible

## TL;DR

We appreciate all contributions. If you are interested in contributing to Torchvision, there are many ways to help out.
We appreciate all contributions. If you are interested in contributing to Torchvision, there are many ways to help out.
Your contributions may fall into the following categories:

- It helps the project if you could
- It helps the project if you could
- Report issues you're facing
- Give a :+1: on issues that others reported and that are relevant to you
- Give a :+1: on issues that others reported and that are relevant to you

- Answering queries on the issue tracker, investigating bugs are very valuable contributions to the project.

- You would like to improve the documentation. This is no less important than improving the library itself!
- You would like to improve the documentation. This is no less important than improving the library itself!
If you find a typo in the documentation, do not hesitate to submit a GitHub pull request.

- If you would like to fix a bug
- please pick one from the [list of open issues labelled as "help wanted"](https://github.com/pytorch/vision/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
- comment on the issue that you want to work on this issue
- send a PR with your fix, see below.
- send a PR with your fix, see below.

- If you plan to contribute new features, utility functions or extensions, please first open an issue and discuss the feature with us.

Expand Down Expand Up @@ -85,12 +85,12 @@ If you plan to modify the code or documentation, please follow the steps below:
4. Ensure the test suite passes.
5. Make sure your code passes the formatting checks (see below).

For more details about pull requests,
please read [GitHub's guides](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request).
For more details about pull requests,
please read [GitHub's guides](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request).

If you would like to contribute a new model, please see [here](#New-architecture-or-improved-model-weights).

If you would like to contribute a new dataset, please see [here](#New-dataset).
If you would like to contribute a new dataset, please see [here](#New-dataset).

### Code formatting and typing

Expand Down Expand Up @@ -145,8 +145,8 @@ mypy --config-file mypy.ini

### Unit tests

If you have modified the code by adding a new feature or a bug-fix, please add unit tests for that. To run a specific
test:
If you have modified the code by adding a new feature or a bug-fix, please add unit tests for that. To run a specific
test:
```bash
pytest test/<test-module.py> -vvv -k <test_myfunc>
# e.g. pytest test/test_transforms.py -vvv -k test_center_crop
Expand All @@ -155,7 +155,7 @@ pytest test/<test-module.py> -vvv -k <test_myfunc>
If you would like to run all tests:
```bash
pytest test -vvv
```
```

Tests that require internet access should be in
`test/test_internet.py`.
Expand Down Expand Up @@ -208,18 +208,18 @@ with "transforms" in their name.
### New architecture or improved model weights

Please refer to the guidelines in [Contributing to Torchvision - Models](https://github.com/pytorch/vision/blob/main/CONTRIBUTING_MODELS.md).

### New dataset

Please, do not send any PR with a new dataset without discussing
Please, do not send any PR with a new dataset without discussing
it in an issue as, most likely, it will not be accepted.

### Pull Request

If all previous checks (flake8, mypy, unit tests) are passing, please send a PR. Submitted PR will pass other tests on
If all previous checks (flake8, mypy, unit tests) are passing, please send a PR. Submitted PR will pass other tests on
different operating systems, python versions and hardware.

For more details about pull requests workflow,
For more details about pull requests workflow,
please read [GitHub's guides](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request).

## License
Expand Down
6 changes: 3 additions & 3 deletions cmake/iOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
# SIMULATOR - used to build for the Simulator platforms, which have an x86 arch.
#
# CMAKE_IOS_DEVELOPER_ROOT = automatic(default) or /path/to/platform/Developer folder
# By default this location is automatcially chosen based on the IOS_PLATFORM value above.
# By default this location is automatically chosen based on the IOS_PLATFORM value above.
# If set manually, it will override the default location and force the user of a particular Developer Platform
#
# CMAKE_IOS_SDK_ROOT = automatic(default) or /path/to/platform/Developer/SDKs/SDK folder
# By default this location is automatcially chosen based on the CMAKE_IOS_DEVELOPER_ROOT value.
# By default this location is automatically chosen based on the CMAKE_IOS_DEVELOPER_ROOT value.
# In this case it will always be the most up-to-date SDK found in the CMAKE_IOS_DEVELOPER_ROOT path.
# If set manually, this will force the use of a specific SDK version

Expand Down Expand Up @@ -100,7 +100,7 @@ if(IOS_DEPLOYMENT_TARGET)
set(XCODE_IOS_PLATFORM_VERSION_FLAGS "-m${XCODE_IOS_PLATFORM}-version-min=${IOS_DEPLOYMENT_TARGET}")
endif()

# Hidden visibilty is required for cxx on iOS
# Hidden visibility is required for cxx on iOS
set(CMAKE_C_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS}")
set(CMAKE_CXX_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -fvisibility-inlines-hidden")

Expand Down
12 changes: 6 additions & 6 deletions docs/source/beta_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
class BetaStatus(Directive):
has_content = True
text = "The {api_name} is in Beta stage, and backward compatibility is not guaranteed."
node = nodes.warning

def run(self):
text = self.text.format(api_name=" ".join(self.content))
return [nodes.warning("", nodes.paragraph("", "", nodes.Text(text)))]
return [self.node("", nodes.paragraph("", "", nodes.Text(text)))]


class V2BetaStatus(BetaStatus):
text = (
"The {api_name} is in Beta stage, and while we do not expect major breaking changes, "
"some APIs may still change according to user feedback. Please submit any feedback you may have "
"in this issue: https://github.com/pytorch/vision/issues/6753, and you can also check "
"out https://github.com/pytorch/vision/issues/7319 to learn "
"more about the APIs that we suspect might involve future changes."
"The {api_name} is in Beta stage, and while we do not expect disruptive breaking changes, "
"some APIs may slightly change according to user feedback. Please submit any feedback you may have "
"in this issue: https://github.com/pytorch/vision/issues/6753."
)
node = nodes.note


def setup(app):
Expand Down
24 changes: 21 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@

sys.path.append(os.path.abspath("."))

torchvision.disable_beta_transforms_warning()
import torchvision.datapoints # Don't remove, otherwise the docs for datapoints aren't linked properly

# -- General configuration ------------------------------------------------

# Required version of sphinx is set from docs/requirements.txt
Expand All @@ -59,13 +56,34 @@
"beta_status",
]

# We override sphinx-gallery's example header to prevent sphinx-gallery from
# creating a note at the top of the renderred notebook.
# https://github.com/sphinx-gallery/sphinx-gallery/blob/451ccba1007cc523f39cbcc960ebc21ca39f7b75/sphinx_gallery/gen_rst.py#L1267-L1271
# This is because we also want to add a link to google collab, so we write our own note in each example.
from sphinx_gallery import gen_rst

gen_rst.EXAMPLE_HEADER = """
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "{0}"
.. LINE NUMBERS ARE GIVEN BELOW.
.. rst-class:: sphx-glr-example-title
.. _sphx_glr_{1}:
"""


sphinx_gallery_conf = {
"examples_dirs": "../../gallery/", # path to your example scripts
"gallery_dirs": "auto_examples", # path to where to save gallery generated output
"subsection_order": ExplicitOrder(["../../gallery/v2_transforms", "../../gallery/others"]),
"backreferences_dir": "gen_modules/backreferences",
"doc_module": ("torchvision",),
"remove_config_comments": True,
"ignore_pattern": "helpers.py",
}

napoleon_use_ivar = True
Expand Down
2 changes: 2 additions & 0 deletions docs/source/datapoints.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _datapoints:

Datapoints
==========

Expand Down
2 changes: 2 additions & 0 deletions docs/source/datasets.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _datasets:

Datasets
========

Expand Down
2 changes: 1 addition & 1 deletion docs/source/models/fcos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Model builders
--------------

The following model builders can be used to instantiate a FCOS model, with or
without pre-trained weights. All the model buidlers internally rely on the
without pre-trained weights. All the model builders internally rely on the
``torchvision.models.detection.fcos.FCOS`` base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/detection/fcos.py>`_ for
more details about this class.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/models/retinanet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Model builders
--------------

The following model builders can be used to instantiate a RetinaNet model, with or
without pre-trained weights. All the model buidlers internally rely on the
without pre-trained weights. All the model builders internally rely on the
``torchvision.models.detection.retinanet.RetinaNet`` base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/detection/retinanet.py>`_ for
more details about this class.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/models/vgg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Model builders
--------------

The following model builders can be used to instantiate a VGG model, with or
without pre-trained weights. All the model buidlers internally rely on the
without pre-trained weights. All the model builders internally rely on the
``torchvision.models.vgg.VGG`` base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>`_ for
more details about this class.
Expand Down
Loading

0 comments on commit 6056621

Please sign in to comment.