rstudio / tensorflow

TensorFlow for R
https://tensorflow.rstudio.com
Apache License 2.0
1.32k stars 317 forks source link

please include decode_tiff to r-tensorflow ? #565

Closed ricds closed 11 months ago

ricds commented 1 year ago

It would be great to have that feature and allowing multiple channels to be inputted, instead of only 3 or 4 channels. Right now, I have a workaround to decode_raw then extracting the number of bytes of the image, but when I get images of different filesizes that does not work. Thanks

t-kalinowski commented 1 year ago

I think you can already via:

tf$io$decode_image(channels = )

or perhaps:

# py_install("tfio")
tfio <- reticulate::import("tfio")
tfio$experimental$image$decode_tiff()

https://www.tensorflow.org/api_docs/python/tf/io/decode_image https://www.tensorflow.org/io/api_docs/python/tfio/experimental/image/decode_tiff