Skip to content

Commit 49b2bd4

Browse files
committed
Merge branch 'main' of github.com:pytorch/vision into please_dont_modify_this_branch_unless_you_are_just_merging_with_main__
2 parents c8aa0cf + fab1188 commit 49b2bd4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+502
-984
lines changed

.github/scripts/setup-env.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ echo '::endgroup::'
4545

4646
if [[ "${OS_TYPE}" == windows && "${GPU_ARCH_TYPE}" == cuda ]]; then
4747
echo '::group::Install VisualStudio CUDA extensions on Windows'
48-
if [[ "${VC_YEAR:-}" == "2022" ]]; then
49-
TARGET_DIR="/c/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Microsoft/VC/v170/BuildCustomizations"
50-
else
51-
TARGET_DIR="/c/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Microsoft/VC/v160/BuildCustomizations"
52-
fi
48+
TARGET_DIR="/c/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Microsoft/VC/v170/BuildCustomizations"
5349
mkdir -p "${TARGET_DIR}"
5450
cp -r "${CUDA_HOME}/MSBuildExtensions/"* "${TARGET_DIR}"
5551
echo '::endgroup::'
@@ -102,6 +98,11 @@ echo '::group::Install TorchVision'
10298
python setup.py develop
10399
echo '::endgroup::'
104100

101+
echo '::group::Install torchvision-extra-decoders'
102+
# This can be done after torchvision was built
103+
pip install torchvision-extra-decoders
104+
echo '::endgroup::'
105+
105106
echo '::group::Collect environment information'
106107
conda list
107108
python -m torch.utils.collect_env

.github/workflows/build-cmake.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
gpu-arch-version: "11.8"
2222
fail-fast: false
2323
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
24+
permissions:
25+
id-token: write
26+
contents: read
2427
with:
2528
repository: pytorch/vision
2629
runner: ${{ matrix.runner }}

.github/workflows/build-conda-linux.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/build-conda-m1.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

.github/workflows/build-conda-windows.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/docs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
jobs:
1616
build:
1717
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
18+
permissions:
19+
id-token: write
20+
contents: read
1821
with:
1922
repository: pytorch/vision
2023
upload-artifact: docs
@@ -79,9 +82,10 @@ jobs:
7982
needs: build
8083
if: github.repository == 'pytorch/vision' && github.event_name == 'push' &&
8184
((github.ref_type == 'branch' && github.ref_name == 'main') || github.ref_type == 'tag')
85+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
8286
permissions:
87+
id-token: write
8388
contents: write
84-
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
8589
with:
8690
repository: pytorch/vision
8791
download-artifact: docs

.github/workflows/lint.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
jobs:
1313
python-source-and-configs:
1414
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
15+
permissions:
16+
id-token: write
17+
contents: read
1518
with:
1619
repository: pytorch/vision
1720
test-infra-ref: main
@@ -39,6 +42,9 @@ jobs:
3942
4043
c-source:
4144
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
45+
permissions:
46+
id-token: write
47+
contents: read
4248
with:
4349
repository: pytorch/vision
4450
test-infra-ref: main
@@ -66,6 +72,9 @@ jobs:
6672
6773
python-types:
6874
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
75+
permissions:
76+
id-token: write
77+
contents: read
6978
with:
7079
repository: pytorch/vision
7180
test-infra-ref: main

.github/workflows/prototype-tests-linux-gpu.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ jobs:
2323
gpu-arch-type: cuda
2424
gpu-arch-version: "11.8"
2525
fail-fast: false
26-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
26+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
27+
permissions:
28+
id-token: write
29+
contents: read
2730
with:
2831
repository: pytorch/vision
2932
runner: ${{ matrix.runner }}

.github/workflows/tests.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ jobs:
2626
gpu-arch-type: cuda
2727
gpu-arch-version: "11.8"
2828
fail-fast: false
29-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
29+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
30+
permissions:
31+
id-token: write
32+
contents: read
3033
with:
3134
repository: pytorch/vision
3235
runner: ${{ matrix.runner }}
@@ -85,6 +88,9 @@ jobs:
8588
gpu-arch-version: "11.8"
8689
fail-fast: false
8790
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main
91+
permissions:
92+
id-token: write
93+
contents: read
8894
with:
8995
repository: pytorch/vision
9096
runner: ${{ matrix.runner }}
@@ -96,15 +102,18 @@ jobs:
96102
set -euxo pipefail
97103
98104
export PYTHON_VERSION=${{ matrix.python-version }}
99-
export VC_YEAR=2019
105+
export VC_YEAR=2022
100106
export VSDEVCMD_ARGS=""
101107
export GPU_ARCH_TYPE=${{ matrix.gpu-arch-type }}
102108
export GPU_ARCH_VERSION=${{ matrix.gpu-arch-version }}
103109
104110
./.github/scripts/unittest.sh
105111
106112
onnx:
107-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
113+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
114+
permissions:
115+
id-token: write
116+
contents: read
108117
with:
109118
repository: pytorch/vision
110119
test-infra-ref: main
@@ -135,7 +144,10 @@ jobs:
135144
echo '::endgroup::'
136145
137146
unittests-extended:
138-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
147+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
148+
permissions:
149+
id-token: write
150+
contents: read
139151
if: contains(github.event.pull_request.labels.*.name, 'run-extended')
140152
with:
141153
repository: pytorch/vision

docs/source/io.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ images and videos.
99
Image Decoding
1010
--------------
1111

12-
Torchvision currently supports decoding JPEG, PNG, WEBP and GIF images. JPEG
13-
decoding can also be done on CUDA GPUs.
12+
Torchvision currently supports decoding JPEG, PNG, WEBP, GIF, AVIF, and HEIC
13+
images. JPEG decoding can also be done on CUDA GPUs.
1414

1515
The main entry point is the :func:`~torchvision.io.decode_image` function, which
1616
you can use as an alternative to ``PIL.Image.open()``. It will decode images
@@ -30,9 +30,10 @@ run transforms/preproc natively on tensors.
3030
3131
3232
:func:`~torchvision.io.decode_image` will automatically detect the image format,
33-
and call the corresponding decoder. You can also use the lower-level
34-
format-specific decoders which can be more powerful, e.g. if you want to
35-
encode/decode JPEGs on CUDA.
33+
and call the corresponding decoder (except for HEIC and AVIF images, see details
34+
in :func:`~torchvision.io.decode_avif` and :func:`~torchvision.io.decode_heic`).
35+
You can also use the lower-level format-specific decoders which can be more
36+
powerful, e.g. if you want to encode/decode JPEGs on CUDA.
3637

3738
.. autosummary::
3839
:toctree: generated/
@@ -41,8 +42,10 @@ encode/decode JPEGs on CUDA.
4142
decode_image
4243
decode_jpeg
4344
encode_png
44-
decode_gif
4545
decode_webp
46+
decode_avif
47+
decode_heic
48+
decode_gif
4649

4750
.. autosummary::
4851
:toctree: generated/

0 commit comments

Comments
 (0)