Skip to content

Commit bf3876d

Browse files
committed
Merge branch 'main' of github.com:pytorch/vision into 8317-label-colours
2 parents 81c0cfd + 19fef3d commit bf3876d

File tree

105 files changed

+1357
-527
lines changed

Some content is hidden

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

105 files changed

+1357
-527
lines changed

.github/scripts/cmake.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ else
3030
JOBS=$(nproc)
3131
fi
3232

33+
if [[ $OS_TYPE == linux ]]; then
34+
export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}"
35+
fi
36+
3337
TORCH_PATH=$(python -c "import pathlib, torch; print(pathlib.Path(torch.__path__[0]))")
3438
if [[ $OS_TYPE == windows ]]; then
3539
PACKAGING_DIR="${PWD}/packaging"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
export IS_M1_CONDA_BUILD_JOB=1

.github/scripts/setup-env.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ conda create \
3030
python="${PYTHON_VERSION}" pip \
3131
ninja cmake \
3232
libpng \
33+
libwebp \
3334
'ffmpeg<4.3'
3435
conda activate ci
3536
conda install --quiet --yes libjpeg-turbo -c pytorch
36-
pip install --progress-bar=off --upgrade setuptools
37+
pip install --progress-bar=off --upgrade setuptools==72.1.0
3738

3839
# See https://github.com/pytorch/vision/issues/6790
3940
if [[ "${PYTHON_VERSION}" != "3.11" ]]; then

.github/workflows/build-cmake.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
gpu-arch-type: cuda
2121
gpu-arch-version: "11.8"
2222
fail-fast: false
23-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
23+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
2424
with:
2525
repository: pytorch/vision
2626
runner: ${{ matrix.runner }}
@@ -30,10 +30,9 @@ jobs:
3030
script: |
3131
set -euo pipefail
3232
33-
export PYTHON_VERSION=3.8
33+
export PYTHON_VERSION=3.9
3434
export GPU_ARCH_TYPE=${{ matrix.gpu-arch-type }}
3535
export GPU_ARCH_VERSION=${{ matrix.gpu-arch-version }}
36-
3736
./.github/scripts/cmake.sh
3837
3938
macos:
@@ -50,7 +49,7 @@ jobs:
5049
script: |
5150
set -euo pipefail
5251
53-
export PYTHON_VERSION=3.8
52+
export PYTHON_VERSION=3.9
5453
export GPU_ARCH_TYPE=cpu
5554
export GPU_ARCH_VERSION=''
5655
@@ -76,7 +75,7 @@ jobs:
7675
script: |
7776
set -euo pipefail
7877
79-
export PYTHON_VERSION=3.8
78+
export PYTHON_VERSION=3.9
8079
export VC_YEAR=2022
8180
export VSDEVCMD_ARGS=""
8281
export GPU_ARCH_TYPE=${{ matrix.gpu-arch-type }}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
test-infra-repository: pytorch/test-infra
4343
test-infra-ref: main
4444
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
45+
env-var-script: ./.github/scripts/export_IS_M1_CONDA_BUILD_JOB.sh
4546
pre-script: ${{ matrix.pre-script }}
4647
post-script: ${{ matrix.post-script }}
4748
package-name: ${{ matrix.package-name }}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ jobs:
2828
matrix:
2929
include:
3030
- repository: pytorch/vision
31-
pre-script: packaging/pre_build_script.sh
32-
env-script: packaging/windows/internal/vc_env_helper.bat
31+
pre-script: ""
3332
post-script: ""
33+
env-script: packaging/windows/internal/vc_env_helper.bat
34+
conda-package-directory: packaging/torchvision
3435
smoke-test-script: test/smoke_test.py
3536
package-name: torchvision
3637
name: ${{ matrix.repository }}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
os: windows
2626
test-infra-repository: pytorch/test-infra
2727
test-infra-ref: main
28+
with-xpu: enable
2829
build:
2930
needs: generate-matrix
3031
strategy:

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ on:
1414

1515
jobs:
1616
build:
17-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
17+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
1818
with:
1919
repository: pytorch/vision
2020
upload-artifact: docs
2121
test-infra-ref: main
2222
script: |
2323
set -euo pipefail
2424
25-
export PYTHON_VERSION=3.8
25+
export PYTHON_VERSION=3.10
2626
export GPU_ARCH_TYPE=cpu
2727
export GPU_ARCH_VERSION=''
2828
./.github/scripts/setup-env.sh
@@ -77,11 +77,11 @@ jobs:
7777
7878
upload:
7979
needs: build
80-
if: github.repository == 'pytorch/vision' && github.event_name == 'push' &&
80+
if: github.repository == 'pytorch/vision' && github.event_name == 'push' &&
8181
((github.ref_type == 'branch' && github.ref_name == 'main') || github.ref_type == 'tag')
8282
permissions:
8383
contents: write
84-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
84+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
8585
with:
8686
repository: pytorch/vision
8787
download-artifact: docs

.github/workflows/lint.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
python-source-and-configs:
14-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
14+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
1515
with:
1616
repository: pytorch/vision
1717
test-infra-ref: main
@@ -21,7 +21,7 @@ jobs:
2121
echo '::group::Setup environment'
2222
CONDA_PATH=$(which conda)
2323
eval "$(${CONDA_PATH} shell.bash hook)"
24-
conda create --name ci --quiet --yes python=3.8 pip
24+
conda create --name ci --quiet --yes python=3.9 pip
2525
conda activate ci
2626
echo '::endgroup::'
2727
@@ -38,7 +38,7 @@ jobs:
3838
fi
3939
4040
c-source:
41-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
41+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
4242
with:
4343
repository: pytorch/vision
4444
test-infra-ref: main
@@ -48,22 +48,14 @@ jobs:
4848
echo '::group::Setup environment'
4949
CONDA_PATH=$(which conda)
5050
eval "$(${CONDA_PATH} shell.bash hook)"
51-
# clang-format needs some shared libraries that conflict with the system ones. Thus, we install them from conda
52-
# and prepend the libraries to linker path to prioritize them. `ncurses=5` is only available on the conda-forge
53-
# channel. Since we are not building or testing here, this is fine.
54-
conda create --name ci --quiet --yes -c conda-forge python=3.8 ncurses=5 libgcc
51+
conda create --name ci --quiet --yes -c conda-forge python=3.9 clang-format
5552
conda activate ci
56-
export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}"
5753
echo '::endgroup::'
5854
59-
echo '::group::Install lint tools'
60-
curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o ./clang-format
61-
chmod +x ./clang-format
62-
echo '::endgroup::'
6355
6456
echo '::group::Lint C source'
6557
set +e
66-
./.github/scripts/run-clang-format.py -r torchvision/csrc --clang-format-executable ./clang-format --exclude "torchvision/csrc/io/image/cpu/giflib/*"
58+
./.github/scripts/run-clang-format.py -r torchvision/csrc --exclude "torchvision/csrc/io/image/cpu/giflib/*"
6759
6860
if [ $? -ne 0 ]; then
6961
git --no-pager diff
@@ -73,14 +65,14 @@ jobs:
7365
7466
7567
python-types:
76-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
68+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
7769
with:
7870
repository: pytorch/vision
7971
test-infra-ref: main
8072
script: |
8173
set -euo pipefail
8274
83-
export PYTHON_VERSION=3.8
75+
export PYTHON_VERSION=3.11
8476
export GPU_ARCH_TYPE=cpu
8577
export GPU_ARCH_VERSION=''
8678
@@ -91,7 +83,7 @@ jobs:
9183
conda activate ci
9284
9385
echo '::group::Install lint tools'
94-
pip install --progress-bar=off mypy
86+
pip install --progress-bar=off "mypy==1.13.0"
9587
echo '::endgroup::'
9688
9789
echo '::group::Lint Python types'

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,19 @@ jobs:
1111
strategy:
1212
matrix:
1313
python-version:
14-
- "3.8"
1514
- "3.9"
1615
- "3.10"
1716
- "3.11"
1817
- "3.12"
1918
runner: ["linux.12xlarge"]
2019
gpu-arch-type: ["cpu"]
2120
include:
22-
- python-version: "3.8"
21+
- python-version: "3.9"
2322
runner: linux.g5.4xlarge.nvidia.gpu
2423
gpu-arch-type: cuda
2524
gpu-arch-version: "11.8"
2625
fail-fast: false
27-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
26+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
2827
with:
2928
repository: pytorch/vision
3029
runner: ${{ matrix.runner }}
@@ -38,7 +37,7 @@ jobs:
3837
export GPU_ARCH_TYPE=${{ matrix.gpu-arch-type }}
3938
export GPU_ARCH_VERSION=${{ matrix.gpu-arch-version }}
4039
./.github/scripts/setup-env.sh
41-
40+
4241
# Prepare conda
4342
CONDA_PATH=$(which conda)
4443
eval "$(${CONDA_PATH} shell.bash hook)"

.github/workflows/tests-schedule.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up python
1919
uses: actions/setup-python@v2
2020
with:
21-
python-version: 3.8
21+
python-version: 3.9
2222

2323
- name: Upgrade system packages
2424
run: python -m pip install --upgrade pip setuptools wheel

.github/workflows/tests.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,19 @@ jobs:
1414
strategy:
1515
matrix:
1616
python-version:
17-
- "3.8"
1817
- "3.9"
1918
- "3.10"
2019
- "3.11"
2120
- "3.12"
2221
runner: ["linux.12xlarge"]
2322
gpu-arch-type: ["cpu"]
2423
include:
25-
- python-version: 3.8
24+
- python-version: 3.9
2625
runner: linux.g5.4xlarge.nvidia.gpu
2726
gpu-arch-type: cuda
2827
gpu-arch-version: "11.8"
2928
fail-fast: false
30-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
29+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
3130
with:
3231
repository: pytorch/vision
3332
runner: ${{ matrix.runner }}
@@ -48,7 +47,6 @@ jobs:
4847
strategy:
4948
matrix:
5049
python-version:
51-
- "3.8"
5250
- "3.9"
5351
- "3.10"
5452
- "3.11"
@@ -74,15 +72,14 @@ jobs:
7472
strategy:
7573
matrix:
7674
python-version:
77-
- "3.8"
7875
- "3.9"
7976
- "3.10"
8077
- "3.11"
8178
- "3.12"
8279
runner: ["windows.4xlarge"]
8380
gpu-arch-type: ["cpu"]
8481
include:
85-
- python-version: "3.8"
82+
- python-version: "3.9"
8683
runner: windows.g5.4xlarge.nvidia.gpu
8784
gpu-arch-type: cuda
8885
gpu-arch-version: "11.8"
@@ -107,14 +104,14 @@ jobs:
107104
./.github/scripts/unittest.sh
108105
109106
onnx:
110-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
107+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
111108
with:
112109
repository: pytorch/vision
113110
test-infra-ref: main
114111
script: |
115112
set -euo pipefail
116113
117-
export PYTHON_VERSION=3.8
114+
export PYTHON_VERSION=3.10
118115
export GPU_ARCH_TYPE=cpu
119116
export GPU_ARCH_VERSION=''
120117
@@ -130,22 +127,23 @@ jobs:
130127
echo '::endgroup::'
131128
132129
echo '::group::Install testing utilities'
133-
pip install --progress-bar=off pytest
130+
pip install --progress-bar=off pytest "numpy<2"
134131
echo '::endgroup::'
135132
136133
echo '::group::Run ONNX tests'
137134
pytest --junit-xml="${RUNNER_TEST_RESULTS_DIR}/test-results.xml" -v --durations=25 test/test_onnx.py
138135
echo '::endgroup::'
139136
140137
unittests-extended:
141-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
138+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
139+
if: contains(github.event.pull_request.labels.*.name, 'run-extended')
142140
with:
143141
repository: pytorch/vision
144142
test-infra-ref: main
145143
script: |
146144
set -euo pipefail
147145
148-
export PYTHON_VERSION=3.8
146+
export PYTHON_VERSION=3.9
149147
export GPU_ARCH_TYPE=cpu
150148
export GPU_ARCH_VERSION=''
151149

.github/workflows/update-viablestrict.yml

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

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ docs/source/auto_examples/
1616
docs/source/gen_modules/
1717
docs/source/generated/
1818
docs/source/models/generated/
19+
docs/source/sg_execution_times.rst
1920
# pytorch-sphinx-theme gets installed here
2021
docs/src
2122

@@ -42,3 +43,5 @@ xcuserdata/
4243
# direnv
4344
.direnv
4445
.envrc
46+
47+
scripts/release_notes/data.json

0 commit comments

Comments
 (0)