Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
4025fc5e
Unverified
Commit
4025fc5e
authored
Aug 17, 2023
by
vfdev
Committed by
GitHub
Aug 17, 2023
Browse files
Fixed setup.py when missing libjpeg (#7840)
Co-authored-by:
Nicolas Hug
<
nh.nicolas.hug@gmail.com
>
parent
69220e0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
README.md
README.md
+4
-3
torchvision/csrc/io/image/cpu/decode_jpeg.cpp
torchvision/csrc/io/image/cpu/decode_jpeg.cpp
+1
-1
No files found.
README.md
View file @
4025fc5e
...
@@ -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
...
...
torchvision/csrc/io/image/cpu/decode_jpeg.cpp
View file @
4025fc5e
...
@@ -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
()
{
#if
def
JPEG_FOUND
#if JPEG_FOUND
return
JPEG_LIB_VERSION
;
return
JPEG_LIB_VERSION
;
#else
#else
return
-
1
;
return
-
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment