Skip to content

Commit

Permalink
Merge branch 'main' of github.com:pytorch/vision into webp_decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHug committed Jul 18, 2024
2 parents 562630f + 3663024 commit 480a711
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
18 changes: 1 addition & 17 deletions packaging/pre_build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,9 @@ else
conda install -yq ffmpeg=4.2 libjpeg-turbo -c pytorch-nightly
fi

conda install libwebp -y

# Install native CentOS libJPEG, freetype and GnuTLS
yum install -y libjpeg-turbo-devel freetype gnutls

# Download all the dependencies required to compile image and video_reader
# extensions
mkdir -p ext_libraries
pushd ext_libraries
popd
export PATH="$(pwd)/ext_libraries/bin:$PATH"
yum install -y libjpeg-turbo-devel libwebp freetype gnutls
pip install auditwheel

# Point to custom libraries
export LD_LIBRARY_PATH=$(pwd)/ext_libraries/lib:$LD_LIBRARY_PATH
export TORCHVISION_INCLUDE=$(pwd)/ext_libraries/include
export TORCHVISION_LIBRARY=$(pwd)/ext_libraries/lib
fi


pip install numpy pyyaml future ninja
pip install --upgrade setuptools
7 changes: 1 addition & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,6 @@ def find_library(header):
searching_for = f"Searching for {header}"

for folder in TORCHVISION_INCLUDE:
if "jpeg" in header:
continue
if (Path(folder) / header).exists():
print(f"{searching_for} in {Path(folder) / header}. Found in TORCHVISION_INCLUDE.")
return True, None, None
Expand All @@ -243,8 +241,6 @@ def find_library(header):
# Try conda-related prefixes. If BUILD_PREFIX is set it means conda-build is
# being run. If CONDA_PREFIX is set then we're in a conda environment.
for prefix_env_var in ("BUILD_PREFIX", "CONDA_PREFIX"):
if "jpeg" in header:
continue
if (prefix := os.environ.get(prefix_env_var)) is not None:
prefix = Path(prefix)
if sys.platform == "win32":
Expand All @@ -257,8 +253,7 @@ def find_library(header):
print(f"{searching_for}. Didn't find in {prefix_env_var}.")

if sys.platform == "linux":
for prefix in ("/usr/include", "/usr/local/include"):
prefix = Path(prefix)
for prefix in (Path("/usr/include"), Path("/usr/local/include")):
if (prefix / header).exists():
print(f"{searching_for}. Found in {prefix}.")
return True, None, None
Expand Down

0 comments on commit 480a711

Please sign in to comment.