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 Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Ten Years of Beam: From Google's Dataflow Paper to 4 Trillion Events at LinkedIn
  • Data Processing for Real Estate: Enabling Smart Analysis and Decision-Making
  • Hadoop on AmpereOne Reference Architecture
  • DataFlow — An Open-Source Data Preparation System Accelerating LLM Training

Trending

  • The Third Culture: Blending Teams With Different Management Models
  • Can Claude Skills Replace Playwright Agents? A Practical View for QA Engineers
  • Content Lakes: Harness Unstructured Data for Enterprise AI Readiness
  • Detecting Bugs and Vulnerabilities in Java With SonarQube
  1. DZone
  2. Data Engineering
  3. Data
  4. Edge Data Processing With Jetson Nano

Edge Data Processing With Jetson Nano

Learn more about edge data processing with Jetson Nano.

By 
Tim Spann user avatar
Tim Spann
DZone Core CORE ·
Jul. 24, 19 · Tutorial
Likes (5)
Comment
Save
Tweet
Share
14.1K Views

Join the DZone community and get the full member experience.

Join For Free

In my other NVidia Jetson Nano articles, we did basic set-up and installed the necessary libraries (though there is a now a Jetpack 4.2.1 update that I need to install and see if we get performance enhancements). We now updated to the latest jetson-inference code as it updated and included excellent Python examples. We now have a platform to work with that has everything we need for IoT — a fast CPU, fast GPU, enough RAM, great software, and the ability to stream data and images off of it with decent performance. So, let's get to building an IoT workflow with AI, device status, and images. We are using Cloudera's Edge Flow Manager to configure, build, deploy, monitor, and manage our IoT flows. We can push to all the Jetson Nano's we have and not have to worry about hand installing on hundreds of devices. It's very easy, as shown below.

Configuring Executing Image Capture and Jetson Nano Classify Python Script

Configuring Tailing JSON Log

Configuring Acquiring Images from File Directory

Configuring the Remote Connection to NiFi

Example CEM Events

Simple NiFi Flow to Receive Remote Events

Apache NiFi Server receives from annotated images as well as JSON packets.

JSON Data Packet Example

{"uuid": "nano_uuid_kwo_20190719182103", "ipaddress": "192.168.1.254", "top1pct": 32.6171875, "top1": "desktop computer", "cputemp": "32.5", "gputemp": "31.5", "gputempf": "89", "cputempf": "90", "runtime": "5", "host": "jetsonnano", "filename": "/opt/demo/images/image_bei_20190719182103.jpg", "imageinput": "/opt/demo/images/2019-07-19_1421.jpg", "host_name": "jetsonnano", "macaddress": "de:07:5a:27:1e:7f", "end": "1563560468.7867181", "te": "4.806252717971802", "systemtime": "07/19/2019 14:21:08", "cpu": 55.8, "diskusage": "5225.1 MB", "memory": 57.5, "id": "20190719182103_fcaa94d4-7629-423a-b76e-714168e64677"}


Notes

It was very easy to set-up a simple flow to execute out deep learning classification and data acquisition with Apache NiFi, MiNiFi, and Cloudera EFM. We can now do something with the data, like push it to the cloud.

Source:

https://github.com/tspannhw/minifi-jetson-nano

import jetson.inference
import jetson.utils

# pass in command line arguments
net = jetson.inference.imageNet("googlenet", argv)

# we load an image capture with fswebcam capture
img, width, height = jetson.utils.loadImageRGBA("imagename.jpg")

# see https://github.com/tspannhw/minifi-jetson-nano/blob/master/demo.py
# https://github.com/tspannhw/minifi-jetson-nano/blob/master/rundemo.sh

# classify the image with a determine width and height
class_idx, confidence = net.Classify(img, width, height)

# find the object description text
class_desc = net.GetClassDesc(class_idx)

# Mark up the image with description
font = jetson.utils.cudaFont(size=jetson.utils.adaptFontSize(width))
font.OverlayText(img, width, height, "{:f}% {:s}".format(confidence * 100, class_desc), 10, 10, font.White, font.Gray40)
jetson.utils.cudaDeviceSynchronize()

# Save the marked up image as a file
jetson.utils.saveImageRGBA(filename, img, width, height)


Deep Learning/IoT

Now, we can start building our deep learning classifications with great speed.

After set-up, we now have an easy interface to running deep learning. As seen in the code above, it is pretty easy to create a simple classification using prebuilt models and webcamers. Using Python 3 and some libraries, we can grab other data like TCP/IP and system information to send as part of a JSON IoT message to a server, like Apache NiFi, to process at scale.

Image title

A recent update to jetson-inference examples have included some great Python examples for the new Python interface: https://github.com/dusty-nv/jetson-inference/blob/master/docs/imagenet-example-python-2.md.

For me, this really elevates the usefulness of the Jetson Nano for IoT with AI. With this solid 4GB device the only slight hold back is having to add Wi-Fi, though a Wi-Fi USB stick is $15 or less. I am in the middle of running my own performance tests against Raspberry Pi 4 with Intel Movidius 2, NVidia Jetson Nano, and Raspberry Pi 3B+ with Google Coral USB. All of them are solid enhancements over basic IoT, but I am seeing a lot of performance enhancements and stability with 4GB of RAM. Now if someone would add a large, fast SSD in a small form factor that could really assist as some of the pre-trained models, libraries, CUDA, Python, development tools, MiNiFi agents, JDK, logs, cache, OS, and more really fills up space quickly and could also slow down performance in IoT situations.

Reference:

Python Docs

Data processing

Opinions expressed by DZone contributors are their own.

Related

  • Ten Years of Beam: From Google's Dataflow Paper to 4 Trillion Events at LinkedIn
  • Data Processing for Real Estate: Enabling Smart Analysis and Decision-Making
  • Hadoop on AmpereOne Reference Architecture
  • DataFlow — An Open-Source Data Preparation System Accelerating LLM Training

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook