Skip to content

Commit 9a14626

Browse files
authored
Merge branch 'master' into master
2 parents ff01ed0 + 588f7ae commit 9a14626

34 files changed

+1067
-221
lines changed

.circleci/config.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,48 @@ jobs:
551551
- store_test_results:
552552
path: test-results
553553

554+
unittest_macos_cpu:
555+
<<: *binary_common
556+
macos:
557+
xcode: "9.4.1"
558+
resource_class: large
559+
steps:
560+
- checkout
561+
- run:
562+
name: Install wget
563+
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install wget
564+
# Disable brew auto update which is very slow
565+
- run:
566+
name: Generate cache key
567+
# This will refresh cache on Sundays, nightly build should generate new cache.
568+
command: echo "$(date +"%Y-%U")" > .circleci-weekly
569+
- restore_cache:
570+
571+
keys:
572+
- env-v3-macos-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }}
573+
574+
- run:
575+
name: Setup
576+
command: .circleci/unittest/linux/scripts/setup_env.sh
577+
- save_cache:
578+
579+
key: env-v3-macos-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }}
580+
581+
paths:
582+
- conda
583+
- env
584+
- run:
585+
name: Install torchvision
586+
command: .circleci/unittest/linux/scripts/install.sh
587+
- run:
588+
name: Run tests
589+
command: .circleci/unittest/linux/scripts/run_test.sh
590+
- run:
591+
name: Post process
592+
command: .circleci/unittest/linux/scripts/post_process.sh
593+
- store_test_results:
594+
path: test-results
595+
554596
cmake_linux_cpu:
555597
<<: *binary_common
556598
docker:
@@ -1075,6 +1117,18 @@ workflows:
10751117
cu_version: cu101
10761118
name: unittest_windows_gpu_py3.8
10771119
python_version: '3.8'
1120+
- unittest_macos_cpu:
1121+
cu_version: cpu
1122+
name: unittest_macos_cpu_py3.6
1123+
python_version: '3.6'
1124+
- unittest_macos_cpu:
1125+
cu_version: cpu
1126+
name: unittest_macos_cpu_py3.7
1127+
python_version: '3.7'
1128+
- unittest_macos_cpu:
1129+
cu_version: cpu
1130+
name: unittest_macos_cpu_py3.8
1131+
python_version: '3.8'
10781132

10791133
cmake:
10801134
jobs:

.circleci/config.yml.in

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,48 @@ jobs:
551551
- store_test_results:
552552
path: test-results
553553

554+
unittest_macos_cpu:
555+
<<: *binary_common
556+
macos:
557+
xcode: "9.4.1"
558+
resource_class: large
559+
steps:
560+
- checkout
561+
- run:
562+
name: Install wget
563+
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install wget
564+
# Disable brew auto update which is very slow
565+
- run:
566+
name: Generate cache key
567+
# This will refresh cache on Sundays, nightly build should generate new cache.
568+
command: echo "$(date +"%Y-%U")" > .circleci-weekly
569+
- restore_cache:
570+
{% raw %}
571+
keys:
572+
- env-v3-macos-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }}
573+
{% endraw %}
574+
- run:
575+
name: Setup
576+
command: .circleci/unittest/linux/scripts/setup_env.sh
577+
- save_cache:
578+
{% raw %}
579+
key: env-v3-macos-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }}
580+
{% endraw %}
581+
paths:
582+
- conda
583+
- env
584+
- run:
585+
name: Install torchvision
586+
command: .circleci/unittest/linux/scripts/install.sh
587+
- run:
588+
name: Run tests
589+
command: .circleci/unittest/linux/scripts/run_test.sh
590+
- run:
591+
name: Post process
592+
command: .circleci/unittest/linux/scripts/post_process.sh
593+
- store_test_results:
594+
path: test-results
595+
554596
cmake_linux_cpu:
555597
<<: *binary_common
556598
docker:

.circleci/regenerate.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,10 @@ def indent(indentation, data_list):
165165

166166
def unittest_workflows(indentation=6):
167167
jobs = []
168-
for os_type in ["linux", "windows"]:
168+
for os_type in ["linux", "windows", "macos"]:
169169
for device_type in ["cpu", "gpu"]:
170+
if os_type == "macos" and device_type == "gpu":
171+
continue
170172
for i, python_version in enumerate(PYTHON_VERSIONS):
171173
job = {
172174
"name": f"unittest_{os_type}_{device_type}_py{python_version}",

.circleci/unittest/linux/scripts/setup_env.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ env_dir="${root_dir}/env"
1414

1515
cd "${root_dir}"
1616

17+
case "$(uname -s)" in
18+
Darwin*) os=MacOSX;;
19+
*) os=Linux
20+
esac
21+
1722
# 1. Install conda at ./conda
1823
if [ ! -d "${conda_dir}" ]; then
1924
printf "* Installing conda\n"
20-
wget -O miniconda.sh http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
25+
wget -O miniconda.sh "http://repo.continuum.io/miniconda/Miniconda3-latest-${os}-x86_64.sh"
2126
bash ./miniconda.sh -b -f -p "${conda_dir}"
2227
fi
2328
eval "$(${conda_dir}/bin/conda shell.bash hook)"

.github/failed_schedule_issue_template.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
2-
title: Scheduled workflow {{ env.WORKFLOW }}/{{ env.JOB }} failed
3-
labels: bug, module: datasets
2+
title: Scheduled workflow failed
3+
labels:
4+
- bug
5+
- "module: datasets"
46
---
57

68
Oh no, something went wrong in the scheduled workflow {{ env.WORKFLOW }}/{{ env.JOB }}.

.github/workflows/tests-schedule.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ name: tests
22

33
on:
44
pull_request:
5-
- "test/test_datasets_download.py"
6-
- ".github/failed_schedule_issue_template.md"
7-
- ".github/workflows/tests-schedule.yml"
5+
paths:
6+
- "test/test_datasets_download.py"
7+
- ".github/failed_schedule_issue_template.md"
8+
- ".github/workflows/tests-schedule.yml"
89

910
schedule:
1011
- cron: "0 9 * * *"
@@ -22,20 +23,23 @@ jobs:
2223
- name: Upgrade pip
2324
run: python -m pip install --upgrade pip
2425

26+
- name: Checkout repository
27+
uses: actions/checkout@v2
28+
2529
- name: Install PyTorch from the nightlies
2630
run: |
2731
pip install numpy
2832
pip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
2933
3034
- name: Install tests requirements
31-
run: pip install pytest pytest-subtests
35+
run: pip install pytest
3236

3337
- name: Run tests
34-
run: pytest test/test_datasets_download.py
38+
run: pytest --durations=20 -ra test/test_datasets_download.py
3539

3640
- uses: JasonEtco/[email protected]
3741
name: Create issue if download tests failed
38-
if: failure()
42+
if: failure() && github.event_name == 'schedule'
3943
env:
4044
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4145
REPO: ${{ github.repository }}

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.0)
1+
cmake_minimum_required(VERSION 3.1)
22
project(torchvision)
33
set(CMAKE_CXX_STANDARD 14)
44
set(TORCHVISION_VERSION 0.7.0)

docs/source/ops.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ torchvision.ops
1313
.. autofunction:: batched_nms
1414
.. autofunction:: remove_small_boxes
1515
.. autofunction:: clip_boxes_to_image
16+
.. autofunction:: box_convert
1617
.. autofunction:: box_area
1718
.. autofunction:: box_iou
1819
.. autofunction:: generalized_box_iou

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ def get_extensions():
264264
libpng = distutils.spawn.find_executable('libpng-config')
265265
pngfix = distutils.spawn.find_executable('pngfix')
266266
png_found = libpng is not None or pngfix is not None
267-
image_macros += [('PNG_FOUND', str(int(png_found)))]
268267
print('PNG found: {0}'.format(png_found))
269268
if png_found:
270269
if libpng is not None:
@@ -307,6 +306,7 @@ def get_extensions():
307306
jpeg_include, jpeg_lib) = find_library('jpeglib', vision_include)
308307

309308
print('JPEG found: {0}'.format(jpeg_found))
309+
image_macros += [('PNG_FOUND', str(int(png_found)))]
310310
image_macros += [('JPEG_FOUND', str(int(jpeg_found)))]
311311
if jpeg_found:
312312
print('Building torchvision with JPEG image support')
@@ -331,11 +331,13 @@ def get_extensions():
331331

332332
ffmpeg_exe = distutils.spawn.find_executable('ffmpeg')
333333
has_ffmpeg = ffmpeg_exe is not None
334+
print("FFmpeg found: {}".format(has_ffmpeg))
334335

335336
if has_ffmpeg:
336337
ffmpeg_bin = os.path.dirname(ffmpeg_exe)
337338
ffmpeg_root = os.path.dirname(ffmpeg_bin)
338339
ffmpeg_include_dir = os.path.join(ffmpeg_root, 'include')
340+
print("ffmpeg include path: {}".format(ffmpeg_include_dir))
339341

340342
# TorchVision base decoder + video reader
341343
video_reader_src_dir = os.path.join(this_dir, 'torchvision', 'csrc', 'cpu', 'video_reader')

0 commit comments

Comments
 (0)