diff --git a/.circleci/unittest/linux/scripts/setup_env.sh b/.circleci/unittest/linux/scripts/setup_env.sh index 773bd78f202..7b593e77c5f 100755 --- a/.circleci/unittest/linux/scripts/setup_env.sh +++ b/.circleci/unittest/linux/scripts/setup_env.sh @@ -5,7 +5,7 @@ # # Do not install PyTorch and torchvision here, otherwise they also get cached. -set -e +set -ex this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" root_dir="$(git rev-parse --show-toplevel)" @@ -42,4 +42,4 @@ if [[ "${PYTHON_VERSION}" = "3.9" ]]; then fi conda install -y -c pytorch "ffmpeg${FFMPEG_PIN}" -conda env update --file "${this_dir}/environment.yml" --prune +conda env update --file "${this_dir}/environment.yml" --prune -vvv diff --git a/.circleci/unittest/windows/scripts/setup_env.sh b/.circleci/unittest/windows/scripts/setup_env.sh index b0b70631112..98c1d9a893f 100644 --- a/.circleci/unittest/windows/scripts/setup_env.sh +++ b/.circleci/unittest/windows/scripts/setup_env.sh @@ -5,7 +5,7 @@ # # Do not install PyTorch and torchvision here, otherwise they also get cached. -set -e +set -ex this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" root_dir="$(git rev-parse --show-toplevel)" @@ -36,4 +36,4 @@ conda activate "${env_dir}" # 3. Install Conda dependencies printf "* Installing dependencies (except PyTorch)\n" -conda env update --file "${this_dir}/environment.yml" --prune +conda env update --file "${this_dir}/environment.yml" --prune -vvv diff --git a/torchvision/csrc/io/image/image.cpp b/torchvision/csrc/io/image/image.cpp index 37d64013cb2..df49635dd52 100644 --- a/torchvision/csrc/io/image/image.cpp +++ b/torchvision/csrc/io/image/image.cpp @@ -26,3 +26,21 @@ static auto registry = torch::RegisterOperators() } // namespace image } // namespace vision + +#ifdef JPEG_FOUND + #include +#endif + +namespace vision { +int64_t jpeg_version() { +#ifdef JPEG_FOUND + return JPEG_LIB_VERSION; +#else + return -1; +#endif +} + +TORCH_LIBRARY_FRAGMENT(torchvision, m) { + m.def("_jpeg_version", &jpeg_version); +} +} // namespace vision \ No newline at end of file