DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. Building a Custom Processor in Apache NiFi for TensorFlow Using the Java API

Building a Custom Processor in Apache NiFi for TensorFlow Using the Java API

Learn how I used TensorFlow's new Java API with Apache NiFi, which uses a custom processor to perform image recognition.

Tim Spann user avatar by
Tim Spann
CORE ·
Aug. 04, 17 · Tutorial
Like (2)
Save
Tweet
Share
5.16K Views

Join the DZone community and get the full member experience.

Join For Free

TensorFlow has released a Java API, so I decided to write a quick custom processor to run TensorFlow Inception v3.

It's a simple set of dependencies for Maven:

It's easy to add the new processor NiFi. First, build it using mvn install (see my build script), then deploy it:

cp nifi-tensorflow-nar/target/nifi-tensorflow-nar-1.0.nar /Volumes/Transcend/Apps/nifi-1.2.0/lib

Once you restart NiFi, you can add the TensorFlow Processor.

An example flow is to the use the very smart ListFile , which will iterate through a list of files and keep track of the timestamp of files it last accessed. I point to a directory of files and the NiFi processor gets fed a ton of images to very quickly process. This is much faster than my calling out to a script.

I gave it a picture of my RV...


And this is what it guessed. The result of the run is a new attribute, probabilities, which is a string description of what it could be a confidence percentage as text:

Here's the source code.

Resources

  • Data Lake 3.0: Containerization, Erasure Coding, GPU Pooling n
  • HDF 2.0 Flow for Processing Real-Time Tweets
  • Using an ASUS Tinkerboard with TensorFlow and Python
  • Setting Up GPU-Enabled TensorFlow to Work With Zeppelin
  • IoT Capturing Photos and Analyzing the Image With TensorFlow on a Raspberry Pi
  • Analyzing Images in HDF 2.0 With TensorFlow
  • Deep Learning IoT Workflows With Raspberry Pi MQTT 
API TensorFlow Apache NiFi Java (programming language)

Published at DZone with permission of Tim Spann, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Easy Smart Contract Debugging With Truffle’s Console.log
  • Deploying Java Serverless Functions as AWS Lambda
  • Using AI and Machine Learning To Create Software
  • Top Authentication Trends to Watch Out for in 2023

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: