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
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Jakarta Batch in Practice: Reliable Chunk-Oriented Processing for Enterprise Workloads
  • Parallel Kafka Batch Processing With Kotlin Coroutines in Spring Boot
  • Scaling Cloud Data Automation: A Practical Guide to Open Table Formats
  • Ten Years of Beam: From Google's Dataflow Paper to 4 Trillion Events at LinkedIn

Trending

  • Why Vulnerability Management Fails Without Reliable Asset Data
  • Evals in CI: How to Catch Agent Regressions Before Production Does
  • Designing Frontend Applications for Failure, Not Just Success
  • Kill the Worker, Keep the Research: Build a Recoverable LangGraph Agent on Temporal

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  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
DZone Core CORE ·
Jul. 24, 19 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
14.5K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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

  • Jakarta Batch in Practice: Reliable Chunk-Oriented Processing for Enterprise Workloads
  • Parallel Kafka Batch Processing With Kotlin Coroutines in Spring Boot
  • Scaling Cloud Data Automation: A Practical Guide to Open Table Formats
  • Ten Years of Beam: From Google's Dataflow Paper to 4 Trillion Events at LinkedIn

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • 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