Unverified Commit 4025fc5e authored by vfdev's avatar vfdev Committed by GitHub
Browse files

Fixed setup.py when missing libjpeg (#7840)


Co-authored-by: default avatarNicolas Hug <nh.nicolas.hug@gmail.com>
parent 69220e0c
...@@ -82,9 +82,10 @@ Torchvision currently supports the following image backends: ...@@ -82,9 +82,10 @@ Torchvision currently supports the following image backends:
- [libjpeg](http://ijg.org/) - can be installed via conda `conda install jpeg` or any of the package managers for - [libjpeg](http://ijg.org/) - can be installed via conda `conda install jpeg` or any of the package managers for
debian-based and RHEL-based Linux distributions. [libjpeg-turbo](https://libjpeg-turbo.org/) can be used as well. debian-based and RHEL-based Linux distributions. [libjpeg-turbo](https://libjpeg-turbo.org/) can be used as well.
**Notes:** `libpng` and `libjpeg` must be available at compilation time in order to be available. Make sure that it is **Notes:** `libpng` and `libjpeg` are optional dependencies. If any of them is available on the system,
available on the standard library locations, otherwise, add the include and library paths in the environment variables torchvision will provide encoding/decoding image functionalities from `torchvision.io.image`.
`TORCHVISION_INCLUDE` and `TORCHVISION_LIBRARY`, respectively. When building torchvision from source, `libpng` and `libjpeg` can be found on the standard library locations.
Otherwise, please use `TORCHVISION_INCLUDE` and `TORCHVISION_LIBRARY` environment variables to set up include and library paths.
## Video Backend ## Video Backend
......
...@@ -155,7 +155,7 @@ torch::Tensor decode_jpeg(const torch::Tensor& data, ImageReadMode mode) { ...@@ -155,7 +155,7 @@ torch::Tensor decode_jpeg(const torch::Tensor& data, ImageReadMode mode) {
#endif // #if !JPEG_FOUND #endif // #if !JPEG_FOUND
int64_t _jpeg_version() { int64_t _jpeg_version() {
#ifdef JPEG_FOUND #if JPEG_FOUND
return JPEG_LIB_VERSION; return JPEG_LIB_VERSION;
#else #else
return -1; return -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment