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
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
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

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Exploring Edge Computing: Delving Into Amazon and Facebook Use Cases
  • No Spark Streaming, No Problem
  • Edge Computing: The New Frontier in International Data Science Trends
  • Cutting Big Data Costs: Effective Data Processing With Apache Spark

Trending

  • Demystifying Enterprise Integration Patterns: Bridging the Gap Between Systems
  • Automated Testing Lifecycle
  • Selecting the Right Automated Tests
  • Getting Started With Prometheus Workshop: Instrumenting Applications
  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.

Tim Spann user avatar by
Tim Spann
CORE ·
Jul. 24, 19 · Tutorial
Like (5)
Save
Tweet
Share
13.03K 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

  • Exploring Edge Computing: Delving Into Amazon and Facebook Use Cases
  • No Spark Streaming, No Problem
  • Edge Computing: The New Frontier in International Data Science Trends
  • Cutting Big Data Costs: Effective Data Processing With Apache Spark

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

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: