When reading the documentation for TFX, especially in the parts related to pre-processing of the data, I would think the pipeline design is more appropiate for categorical features.

I wanted to know whether TFX could also be used for pipelines involving images.

2 Answers

0
Community On

Yes, TFX could also be used for pipelines involving images.

Especially, in the parts related to pre-processing the data, as per my knowledge, there are no in built functions in Tensorflow Transform.

But the Transformations can be made using Tensorflow Ops. For example, Image Augmentation can be done using tf.image, and so on.

Sample code for Transformation of Images, i.e., converting an image from Color to Grey Scale, by dividing the value of each pixel by 255, using Tensorflow Transform is shown below:

def preprocessing_fn(inputs):
  """Preprocess input columns into transformed columns."""
  # Since we are modifying some features and leaving others unchanged, we
  # start by setting `outputs` to a copy of `inputs.
  outputs = inputs.copy()

  # Convert the Image from Color to Grey Scale. 
  # NUMERIC_FEATURE_KEYS is the names of Columns of Values of Pixels
  for key in NUMERIC_FEATURE_KEYS:
    outputs[key] = tf.divide(outputs[key], 255)

  outputs[LABEL_KEY] = outputs[LABEL_KEY]

  return outputs
0
Jiong Zhang On

How (what format to use) to input the image data into the pipeline? I only see a csv_input function there, TFRecord input hasn't been released>