Skip to content

Commit e4b9823

Browse files
authored
Revert "PR: Enable libPNG support (#2379)" (#2383)
This reverts commit c1a99b7.
1 parent c1a99b7 commit e4b9823

File tree

19 files changed

+10
-402
lines changed

19 files changed

+10
-402
lines changed

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ jobs:
107107
- checkout
108108
- run:
109109
command: |
110-
sudo apt-get update -y
111110
pip install --user --progress-bar off numpy mypy
112111
pip install --user --progress-bar off --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
113112
pip install --user --progress-bar off --editable .

.circleci/config.yml.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ jobs:
107107
- checkout
108108
- run:
109109
command: |
110-
sudo apt-get update -y
111110
pip install --user --progress-bar off numpy mypy
112111
pip install --user --progress-bar off --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
113112
pip install --user --progress-bar off --editable .

.circleci/unittest/linux/scripts/environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ dependencies:
66
- pytest-cov
77
- codecov
88
- pip
9-
- libpng
109
- ca-certificates
1110
- pip:
1211
- future

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,3 @@ htmlcov
2121
*.swo
2222
gen.yml
2323
.mypy_cache
24-
.vscode/
25-
*.orig

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313

1414
before_install:
1515
- sudo apt-get update
16-
- sudo apt-get install -y libpng-dev
1716
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
1817
- bash miniconda.sh -b -p $HOME/miniconda
1918
- export PATH="$HOME/miniconda/bin:$PATH"

CMakeLists.txt

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,22 @@ if(WITH_CUDA)
1111
endif()
1212

1313
find_package(Python3 COMPONENTS Development)
14-
1514
find_package(Torch REQUIRED)
16-
find_package(PNG REQUIRED)
17-
1815

1916
file(GLOB HEADERS torchvision/csrc/*.h)
20-
file(GLOB IMAGE_HEADERS torchvision/csrc/cpu/image/*.h)
21-
file(GLOB IMAGE_SOURCES torchvision/csrc/cpu/image/*.cpp)
22-
file(GLOB OPERATOR_SOURCES torchvision/csrc/cpu/*.h torchvision/csrc/cpu/*.cpp ${IMAGE_HEADERS} ${IMAGE_SOURCES} ${HEADERS} torchvision/csrc/*.cpp)
17+
file(GLOB OPERATOR_SOURCES torchvision/csrc/cpu/*.h torchvision/csrc/cpu/*.cpp torchvision/csrc/*.cpp)
2318
if(WITH_CUDA)
2419
file(GLOB OPERATOR_SOURCES ${OPERATOR_SOURCES} torchvision/csrc/cuda/*.h torchvision/csrc/cuda/*.cu)
2520
endif()
2621
file(GLOB MODELS_HEADERS torchvision/csrc/models/*.h)
2722
file(GLOB MODELS_SOURCES torchvision/csrc/models/*.h torchvision/csrc/models/*.cpp)
2823

29-
add_library(${PROJECT_NAME} SHARED ${MODELS_SOURCES} ${OPERATOR_SOURCES} ${IMAGE_SOURCES})
30-
target_link_libraries(${PROJECT_NAME} PRIVATE ${TORCH_LIBRARIES} ${PNG_LIBRARY} Python3::Python)
31-
# target_link_libraries(${PROJECT_NAME} PRIVATE ${PNG_LIBRARY} Python3::Python)
24+
add_library(${PROJECT_NAME} SHARED ${MODELS_SOURCES} ${OPERATOR_SOURCES})
25+
target_link_libraries(${PROJECT_NAME} PRIVATE ${TORCH_LIBRARIES} Python3::Python)
3226
set_target_properties(${PROJECT_NAME} PROPERTIES EXPORT_NAME TorchVision)
3327

3428
target_include_directories(${PROJECT_NAME} INTERFACE
35-
$<BUILD_INTERFACE:${HEADERS}:${PNG_INCLUDE_DIR}>
29+
$<BUILD_INTERFACE:${HEADERS}>
3630
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
3731

3832
include(GNUInstallDirs)
@@ -67,7 +61,7 @@ install(FILES
6761
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/cpu)
6862
if(WITH_CUDA)
6963
install(FILES
70-
torchvision/csrc/cuda/vision_cuda.h
64+
torchvision/csrc/cuda/vision_cuda.h
7165
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/cuda)
7266
endif()
7367
install(FILES ${MODELS_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/models)

README.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,13 @@ Torchvision currently supports the following image backends:
7878

7979
* `accimage`_ - if installed can be activated by calling :code:`torchvision.set_image_backend('accimage')`
8080

81-
* `libpng`_ - can be installed via conda :code:`conda install libpng` or any of the package managers for debian-based and RHEL-based Linux distributions.
82-
83-
**Notes:** ``libpng`` must be available at compilation time in order to be available. Make sure that it is available on the standard library locations,
84-
otherwise, add the include and library paths in the environment variables ``TORCHVISION_INCLUDE`` and ``TORCHVISION_LIBRARY``, respectively.
85-
86-
.. _libpng : http://www.libpng.org/pub/png/libpng.html
8781
.. _Pillow : https://python-pillow.org/
8882
.. _Pillow-SIMD : https://github.com/uploadcare/pillow-simd
8983
.. _accimage: https://github.com/pytorch/accimage
9084

9185
C++ API
9286
=======
93-
TorchVision also offers a C++ API that contains C++ equivalent of python models.
87+
TorchVision also offers a C++ API that contains C++ equivalent of python models.
9488

9589
Installation From source:
9690

@@ -100,7 +94,7 @@ Installation From source:
10094
cd build
10195
# Add -DWITH_CUDA=on support for the CUDA if needed
10296
cmake ..
103-
make
97+
make
10498
make install
10599
106100
Once installed, the library can be accessed in cmake (after properly configuring ``CMAKE_PREFIX_PATH``) via the :code:`TorchVision::TorchVision` target:

packaging/build_wheel.sh

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,6 @@ setup_wheel_python
1010
pip_install numpy pyyaml future ninja
1111
setup_pip_pytorch_version
1212
python setup.py clean
13-
14-
# Copy binaries to be included in the wheel distribution
15-
if [[ "$(uname)" == Darwin || "$OSTYPE" == "msys" ]]; then
16-
python_exec="$(which python)"
17-
bin_path=$(dirname $python_exec)
18-
env_path=$(dirname $bin_path)
19-
if [[ "$(uname)" == Darwin ]]; then
20-
# Include LibPNG
21-
cp "$env_path/lib/libpng16.dylib" torchvision
22-
else
23-
# Include libPNG
24-
cp "$bin_path/Library/lib/libpng.lib" torchvision
25-
fi
26-
else
27-
# Include LibPNG
28-
cp "/usr/lib64/libpng.so" torchvision
29-
fi
30-
3113
if [[ "$OSTYPE" == "msys" ]]; then
3214
IS_WHEEL=1 "$script_dir/windows/internal/vc_env_helper.bat" python setup.py bdist_wheel
3315
else

packaging/pkg_helpers.bash

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,7 @@ setup_wheel_python() {
170170
conda env remove -n "env$PYTHON_VERSION" || true
171171
conda create -yn "env$PYTHON_VERSION" python="$PYTHON_VERSION"
172172
conda activate "env$PYTHON_VERSION"
173-
# Install libPNG from Anaconda (defaults)
174-
conda install libpng -y
175173
else
176-
# Install native CentOS libPNG
177-
yum install -y libpng-devel
178174
case "$PYTHON_VERSION" in
179175
2.7)
180176
if [[ -n "$UNICODE_ABI" ]]; then

packaging/torchvision/conda_build_config.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
channel_sources:
2-
- defaults
3-
41
blas_impl:
52
- mkl # [x86_64]
63
c_compiler:

0 commit comments

Comments
 (0)