Created on 03-23-201803:02 PM - edited 08-17-201908:18 AM
Integrating TensorFlow 1.6 Image Labelling with HDF 3.1 and Apache NiFi 1.5
This is community Apache NiFi custom processor that I have written with help from Simon Ball. This is after his original change, I converted the results to a different style and incorporated changes to Google's TensorFlow Label_Image in Java example.
Images Supported as Flow Files
JPG, PNG, GIF
Updated TensorFlowProcessor to TF 1.6.
I added more tests, did more clode cleanup, change the top 5 returned with cleaner naming. This processor has been tested in a few environments, please give it a try and let me know your results. The performance and stability seem quite good, hopefully enough for your use cases. You can also use the MiniFi C++ Agent's built-in C++ TensorFlow support if you wish to have fast local TensorFlow at the edge.
JUNit Test for TensorFlow Processor
Here is another flow where I am send an image to two Apache MXNet Model Servers and the local TensorFlow processor.
This is an example of the attributes returned by the processor. You pass in the image as a flowfile and it adds attributes without changing the contents.
In Apache NiFi, we can monitor how long the tasks are taking. After the first run the time of the processor goes down as we have cached the labels and the TensorFlow pre-built graph.
This is an example of an actual flow. I use this to grab images from Twitter, download them and run TensorFlow on them.