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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

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

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Integrating Apache Doris and Hudi for Data Querying and Migration
  • Problem Analysis in Apache Doris StreamLoad Scenarios
  • Lakehouse: Starting With Apache Doris + S3 Tables
  • An Overview of Asynchronous Processing in Salesforce

Trending

  • How to Submit a Post to DZone
  • Using Python Libraries in Java
  • The Smart Way to Talk to Your Database: Why Hybrid API + NL2SQL Wins
  • Vibe Coding With GitHub Copilot: Optimizing API Performance in Fintech Microservices
  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
13.7K 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

  • Integrating Apache Doris and Hudi for Data Querying and Migration
  • Problem Analysis in Apache Doris StreamLoad Scenarios
  • Lakehouse: Starting With Apache Doris + S3 Tables
  • An Overview of Asynchronous Processing in Salesforce

Partner Resources

×

Comments
Oops! Something Went Wrong

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

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!