I'm currently using Tensorflow's Dataset API to load and preprocess images for training and testing. Here's a snipped of the code I'm using to do so:
image_string = tf.read_file(self._data_conf.image_dir + in_image)
label_string = tf.read_file(self._data_conf.label_dir + in_label)
image = tf.image.decode_png(image_string, channels=self._num_channels)
label = tf.image.decode_png(label_string, channels=self._num_channels)
The problem is, that Tensorflow doesn't support TIFF containers. Here, only the functions tf.image.decode_image, tf.image.decode_jpeg and tf.image.decode_png are supported. Now, I've implemented a class which extracts specific pages from a TIFF container as Numpy array. Is there a way to use this API (static graph) with a custom image loader, such as the class?
A simple way would be directly using the python imageio and then use tf.py_func to package it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With