Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pytorch/vision
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.11.1
Choose a base ref
...
head repository: pytorch/vision
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.11.2
Choose a head ref
  • 9 commits
  • 12 files changed
  • 6 contributors

Commits on Oct 26, 2021

  1. Fix nvjpeg packaging into the wheel (#4752)

    Relocate fails to find nvjpeg unless its present in the library search path.
    malfet committed Oct 26, 2021
    Copy the full SHA
    cdacbe0 View commit details

Commits on Dec 8, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    550d0b5 View commit details
  2. Fix binary_libtorchvision_ops_android job (#5062)

    * Fix `binary_libtorchvision_ops_android` job
    
    Switch pytorchAndroidVersion to non-snapshot
    
    * Switch Android app to pytorch_android stable. (#4926)
    datumbox authored Dec 8, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0cac420 View commit details
  3. Add numpy as explicit dependency to build_cmake.sh (#4987) (#5065)

    Otherwise, it `setuptools.py`  will try to install latest, which is not compatible with Python runtime older than 3.8
    
    Fixes #4985
    
    Co-authored-by: Nikita Shulga <nshulga@fb.com>
    datumbox and malfet authored Dec 8, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    73efcc6 View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2ea7133 View commit details
  5. Fix augmentation space to be uint8 compatible (#4806) (#5067)

    * change range into uint8
    
    * Same typo in TrivialAugmentWide and RandAugment
    
    Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
    Co-authored-by: Prabhat Roy <prabhatroy@fb.com>
    
    Co-authored-by: Jopo <49716607+jopo666@users.noreply.github.com>
    Co-authored-by: Prabhat Roy <prabhatroy@fb.com>
    3 people authored Dec 8, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    12f664b View commit details
  6. fix WIDERFace download links (#4649) (#5068)

    Co-authored-by: Philip Meier <github.pmeier@posteo.de>
    datumbox and pmeier authored Dec 8, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2b3e0a7 View commit details

Commits on Dec 13, 2021

  1. bump pytorch dependency 1.10.0 -> 1.10.1

    Prepping for 1.10.1 release
    
    Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
    seemethere committed Dec 13, 2021
    Copy the full SHA
    95b26e0 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e7ec7e2 View commit details
4 changes: 3 additions & 1 deletion .circleci/config.yml

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

4 changes: 3 additions & 1 deletion .circleci/config.yml.in
Original file line number Diff line number Diff line change
@@ -105,7 +105,7 @@ binary_common: &binary_common
pytorch_version:
description: "PyTorch version to build against; by default, use a nightly"
type: string
default: "1.10.0"
default: "1.10.1"
# Don't edit these
python_version:
description: "Python version to build against (e.g., 3.7)"
@@ -216,6 +216,8 @@ jobs:
- checkout
- run:
command: |
sudo apt-get update -y
sudo apt install -y libtinfo5
curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o clang-format
chmod +x clang-format
sudo mv clang-format /opt/clang-format
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ allprojects {
androidSupportAppCompatV7Version = "28.0.0"
fbjniJavaOnlyVersion = "0.0.3"
soLoaderNativeLoaderVersion = "0.8.0"
pytorchAndroidVersion = "1.10.0-SNAPSHOT"
pytorchAndroidVersion = "1.10.0"
}

repositories {
2 changes: 1 addition & 1 deletion android/ops/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ target_compile_options(${TARGET} PRIVATE

set(BUILD_SUBDIR ${ANDROID_ABI})

find_library(PYTORCH_LIBRARY pytorch_jni_lite
find_library(PYTORCH_LIBRARY pytorch_jni
PATHS ${PYTORCH_LINK_DIRS}
NO_CMAKE_FIND_ROOT_PATH)

2 changes: 1 addition & 1 deletion packaging/build_cmake.sh
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ else
MKL_CONSTRAINT=''
fi

conda install -yq \pytorch=$PYTORCH_VERSION $CONDA_CUDATOOLKIT_CONSTRAINT $CONDA_CPUONLY_FEATURE $MKL_CONSTRAINT -c "pytorch-${UPLOAD_CHANNEL}"
conda install -yq \pytorch=$PYTORCH_VERSION $CONDA_CUDATOOLKIT_CONSTRAINT $CONDA_CPUONLY_FEATURE $MKL_CONSTRAINT numpy -c "pytorch-${UPLOAD_CHANNEL}"
TORCH_PATH=$(dirname $(python -c "import torch; print(torch.__file__)"))

if [[ "$(uname)" == Darwin || "$OSTYPE" == "msys" ]]; then
2 changes: 1 addition & 1 deletion packaging/build_wheel.sh
Original file line number Diff line number Diff line change
@@ -55,6 +55,6 @@ else
if [[ "$OSTYPE" == "msys" ]]; then
"$script_dir/windows/internal/vc_env_helper.bat" python $script_dir/wheel/relocate.py
else
LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" python $script_dir/wheel/relocate.py
LD_LIBRARY_PATH="/usr/local/lib:$CUDA_HOME/lib64:$LD_LIBRARY_PATH" python $script_dir/wheel/relocate.py
fi
fi
10 changes: 5 additions & 5 deletions torchvision/datasets/widerface.py
Original file line number Diff line number Diff line change
@@ -37,13 +37,13 @@ class WIDERFace(VisionDataset):

BASE_FOLDER = "widerface"
FILE_LIST = [
# File ID MD5 Hash Filename
("0B6eKvaijfFUDQUUwd21EckhUbWs", "3fedf70df600953d25982bcd13d91ba2", "WIDER_train.zip"),
("0B6eKvaijfFUDd3dIRmpvSk8tLUk", "dfa7d7e790efa35df3788964cf0bbaea", "WIDER_val.zip"),
("0B6eKvaijfFUDbW4tdGpaYjgzZkU", "e5d8f4248ed24c334bbd12f49c29dd40", "WIDER_test.zip")
# File ID MD5 Hash Filename
("15hGDLhsx8bLgLcIRD5DhYt5iBxnjNF1M", "3fedf70df600953d25982bcd13d91ba2", "WIDER_train.zip"),
("1GUCogbp16PMGa39thoMMeWxp7Rp5oM8Q", "dfa7d7e790efa35df3788964cf0bbaea", "WIDER_val.zip"),
("1HIfDbVEWKmsYKJZm4lchTBDLW5N7dY5T", "e5d8f4248ed24c334bbd12f49c29dd40", "WIDER_test.zip"),
]
ANNOTATIONS_FILE = (
"http://mmlab.ie.cuhk.edu.hk/projects/WIDERFace/support/bbx_annotation/wider_face_split.zip",
"http://shuoyang1213.me/WIDERFACE/support/bbx_annotation/wider_face_split.zip",
"0e3767bcf0e326556d407bf5bff5d27c",
"wider_face_split.zip"
)
23 changes: 23 additions & 0 deletions torchvision/extension.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import ctypes
import os
import sys
from warnings import warn

import torch

from ._internally_replaced_utils import _get_extension_path
@@ -62,4 +67,22 @@ def _check_cuda_version():
return _version


def _load_library(lib_name):
lib_path = _get_extension_path(lib_name)
# On Windows Python-3.8+ has `os.add_dll_directory` call,
# which is called from _get_extension_path to configure dll search path
# Condition below adds a workaround for older versions by
# explicitly calling `LoadLibraryExW` with the following flags:
# - LOAD_LIBRARY_SEARCH_DEFAULT_DIRS (0x1000)
# - LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR (0x100)
if os.name == "nt" and sys.version_info < (3, 8):
_kernel32 = ctypes.WinDLL("kernel32.dll", use_last_error=True)
if hasattr(_kernel32, "LoadLibraryExW"):
_kernel32.LoadLibraryExW(lib_path, None, 0x00001100)
else:
warn("LoadLibraryExW is missing in kernel32.dll")

torch.ops.load_library(lib_path)


_check_cuda_version()
5 changes: 2 additions & 3 deletions torchvision/io/_video_opt.py
Original file line number Diff line number Diff line change
@@ -8,12 +8,11 @@
import numpy as np
import torch

from .._internally_replaced_utils import _get_extension_path
from ..extension import _load_library


try:
lib_path = _get_extension_path('video_reader')
torch.ops.load_library(lib_path)
_load_library("video_reader")
_HAS_VIDEO_OPT = True
except (ImportError, OSError):
_HAS_VIDEO_OPT = False
10 changes: 5 additions & 5 deletions torchvision/io/image.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import torch
from enum import Enum
from warnings import warn

from .._internally_replaced_utils import _get_extension_path
from ..extension import _load_library


try:
lib_path = _get_extension_path('image')
torch.ops.load_library(lib_path)
except (ImportError, OSError):
pass
_load_library("image")
except (ImportError, OSError) as e:
warn(f"Failed to load image Python extension: {e}")


class ImageReadMode(Enum):
2 changes: 1 addition & 1 deletion torchvision/models/quantization/mobilenetv3.py
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ def _load_from_state_dict(
):
version = local_metadata.get("version", None)

if version is None or version < 2:
if hasattr(self, "qconfig") and (version is None or version < 2):
default_state_dict = {
"scale_activation.activation_post_process.scale": torch.tensor([1.]),
"scale_activation.activation_post_process.zero_point": torch.tensor([0], dtype=torch.int32),
6 changes: 3 additions & 3 deletions torchvision/transforms/autoaugment.py
Original file line number Diff line number Diff line change
@@ -194,7 +194,7 @@ def _augmentation_space(self, num_bins: int, image_size: List[int]) -> Dict[str,
"Contrast": (torch.linspace(0.0, 0.9, num_bins), True),
"Sharpness": (torch.linspace(0.0, 0.9, num_bins), True),
"Posterize": (8 - (torch.arange(num_bins) / ((num_bins - 1) / 4)).round().int(), False),
"Solarize": (torch.linspace(256.0, 0.0, num_bins), False),
"Solarize": (torch.linspace(255.0, 0.0, num_bins), False),
"AutoContrast": (torch.tensor(0.0), False),
"Equalize": (torch.tensor(0.0), False),
"Invert": (torch.tensor(0.0), False),
@@ -287,7 +287,7 @@ def _augmentation_space(self, num_bins: int, image_size: List[int]) -> Dict[str,
"Contrast": (torch.linspace(0.0, 0.9, num_bins), True),
"Sharpness": (torch.linspace(0.0, 0.9, num_bins), True),
"Posterize": (8 - (torch.arange(num_bins) / ((num_bins - 1) / 4)).round().int(), False),
"Solarize": (torch.linspace(256.0, 0.0, num_bins), False),
"Solarize": (torch.linspace(255.0, 0.0, num_bins), False),
"AutoContrast": (torch.tensor(0.0), False),
"Equalize": (torch.tensor(0.0), False),
}
@@ -366,7 +366,7 @@ def _augmentation_space(self, num_bins: int) -> Dict[str, Tuple[Tensor, bool]]:
"Contrast": (torch.linspace(0.0, 0.99, num_bins), True),
"Sharpness": (torch.linspace(0.0, 0.99, num_bins), True),
"Posterize": (8 - (torch.arange(num_bins) / ((num_bins - 1) / 6)).round().int(), False),
"Solarize": (torch.linspace(256.0, 0.0, num_bins), False),
"Solarize": (torch.linspace(255.0, 0.0, num_bins), False),
"AutoContrast": (torch.tensor(0.0), False),
"Equalize": (torch.tensor(0.0), False),
}