Sunday, July 24, 2022

NVIDIA Jetson Object Detection with Jetson Inference and TensorFlow

NVIDIA Jetson Object Detection with Jetson Inference and TensorFlow

What is Jetson Inference?

Instructional guide for inference and real-time DNN vision library for NVIDIA Jetson Nano/TX1/TX2/Xavier NX/AGX Xavier/AGX Orin.


This code uses NVIDIA TensorRT for efficiently deploying neural networks onto the embedded Jetson platform, improving performance and power efficiency using graph optimizations, kernel fusion, and FP16/INT8 precision.


Vision primitives, such as imageNet for image recognition, detectNet for object detection, segNet for semantic segmentation, and poseNet for pose estimation inherit from the shared tensorNet object. Examples are provided for streaming from live camera feed and processing images. See the API Reference section for detailed reference documentation of the C++ and Python libraries.


Locating Objects with DetectNet

The previous recognition examples output class probabilities representing the entire input image. Next we're going to focus on object detection, and finding where in the frame various objects are located by extracting their bounding boxes. Unlike image classification, object detection networks are capable of detecting many different objects per frame.

The detectNet object accepts an image as input, and outputs a list of coordinates of the detected bounding boxes along with their classes and confidence values. detectNet is available to use from Python and C++. See below for various pre-trained detection models available for download. The default model used is a 91-class SSD-Mobilenet-v2 model trained on the MS COCO dataset, which achieves realtime inferencing performance on Jetson with TensorRT.

As examples of using the detectNet class, we provide sample programs for C++ and Python:

These samples are able to detect objects in images, videos, and camera feeds. For more info about the various types of input/output streams supported, see the Camera Streaming and Multimedia page.

Pre-trained Detection Models Available

Below is a table of the pre-trained object detection networks available for download, and the associated --network argument to detectnet used for loading the pre-trained models:

ModelCLI argumentNetworkType enumObject classes
SSD-Mobilenet-v1ssd-mobilenet-v1SSD_MOBILENET_V191 (COCO classes)
SSD-Mobilenet-v2ssd-mobilenet-v2SSD_MOBILENET_V291 (COCO classes)
SSD-Inception-v2ssd-inception-v2SSD_INCEPTION_V291 (COCO classes)
DetectNet-COCO-Dogcoco-dogCOCO_DOGdogs
DetectNet-COCO-Bottlecoco-bottleCOCO_BOTTLEbottles
DetectNet-COCO-Chaircoco-chairCOCO_CHAIRchairs
DetectNet-COCO-Airplanecoco-airplaneCOCO_AIRPLANEairplanes
ped-100pednetPEDNETpedestrians
multiped-500multipedPEDNET_MULTIpedestrians, luggage
facenet-120facenetFACENETfaces

note: to download additional networks, run the Model Downloader tool
             $ cd jetson-inference/tools
             $ ./download-models.sh


In this demo use only DetectNet.

NVIDIA Jetson Nano with Jetson Inference ( DetectNet )

Inference Performance

Model : SSD-Mobilenet-v2  ( TensorRT FP16 )  :  22-24 FPS  




NVIDIA Jetson Xavier NX  with Jetson Inference ( DetectNet )

Inference Performance

Model : SSD-Mobilenet-v2  ( TensorRT FP16 ) :  60 - 100 FPS



TensorFlow Object Detection API Creating accurate machine learning models capable of localizing and identifying multiple objects in a single image remains a core challenge in computer vision. The TensorFlow Object Detection API is an open source framework built on top of TensorFlow that makes it easy to construct, train and deploy object detection models. At Google we’ve certainly found this codebase to be useful for our computer vision needs, and we hope that you will as well.

TensorFlow 1 Detection Model Zoo

We provide a collection of detection models pre-trained on the COCO dataset, the Kitti dataset, the Open Images dataset, the AVA v2.1 dataset the iNaturalist Species Detection Dataset and the Snapshot Serengeti Dataset. These models can be useful for out-of-the-box inference if you are interested in categories already in those datasets. They are also useful for initializing your models when training on novel datasets.



NVIDIA Jetson Nano with TensorFlow Object Detection 

Inference Performance

Model : SSD-Mobilenet-v2  ( TensorFlow FP32 ) :   2 - 3 FPS



NVIDIA Jetson Xavier NX with TensorFlow Object Detection

Inference Performance

Model : SSD-Mobilenet-v2  ( TensorFlow FP32 )  :  5 - 7 FPS


Compare NVIDIA Jetson Nano vs. NVIDIA Jetson Xavier NX





Performance Comparison





NVIDIA Jetson Nano Inference Object Detection with DetectNet ( FP16 )

Nvidia Jetson Xavier inference object-detection with Detectnet ( FP16 )

Nvidia Jetson Nano Tensorflow Object Detection ( FP32 )

Nvidia Jetson Xavier NX Tensorflow Object Detection ( FP32 )

Reference

TensorFlow Model Zoo

Jetson Inference




Adun Nantakaew อดุลย์ นันทะแก้ว 081-6452400
LINE : adunnan

    

Tuesday, October 26, 2021

DeepStream SDK on NVIDIA Jetson

DeepStream SDK on NVIDIA Jetson

What is DeepStream SDK?

Build and deploy AI-powered Intelligent Video Analytics apps and services. DeepStream offers a multi-platform scalable framework with TLS security to deploy on the edge and connect to any cloud.

  • Develop in C/C++ or Python
  • Built for scalability - one application for NVIDIA T4 and Jetson platforms
  • Highest throughput for object detection, image classification and semantic segmentation models
  • Deploy models in native DL frameworks such as Pytorch and TensorFlow for inference
  • IoT integration interface with Kafka, MQTT and AMQP
  • Turnkey integration with AWS IoT and Microsoft Azure IoT
  • Multi-GPU, multi-stream and batching support for high throughput inference




Why do we use DeepStream SDK?

DeepStream SDK design for NVIDIA Jetson Family. So, For the best performance.


Install DeepStream SDK



For NVIDIA Jetson


Sample Python Applications

We currently provide the following sample applications:

Detailed application information is provided in each application's subdirectory under apps.



deepstream-test1 python 


In this sample, we first create one instance of "nvinfer", referred as the pgie.
This is our 4 class detector and it detects for "Vehicle , RoadSign, TwoWheeler,
Person".


Run Linux Command


jetson@nano:~/deepstream_python_apps/apps/deepstream-test1$ python deepstream_test_1.py /home/jetson/Videos/streams/sample_720p.h264 


TEST on NVIDIA Jetson Nano

• Jetpack SDK 4.5.1 • DeepStream SDK 5.1 • Python 3.6.9 • CUDA 10.2.89 • TensorRT 7.1.3 • Machine Learning Model : ResNet10 backbone ( FP16 ) • Video 1200x720 H.264


Python Source code

https://github.com/NVIDIA-AI-IOT/deepstream_python_apps


Performance Compare





Adun Nantakaew อดุลย์ นันทะแก้ว 081-6452400
LINE : adunnan

                


Sunday, February 14, 2021

NVIDIA Jetson Family Overview

NVIDIA Jetson Family Overview

For Computer Vision and AI development.

What is NVIDIA Jetson ?

NVIDIA Jetson is new product line form NVIDIA Corp.

NVIDIA Jetson is low-cost AI Computer. ( Edge Computing )


NVIDIA Jetson Nano Spec.

NVIDIA Jetson has 2 platforms  Jetson Development Kits and Jetson Module

NVIDIA Jetson Family




The newest member of the Jetson family! ( Apr 2020 )


Jetson AI Certification

https://developer.nvidia.com/embedded/learn/jetson-ai-certification-programs


Jetson Community Projects

https://developer.nvidia.com/embedded/community/jetson-projects





Adun Nantakaew อดุลย์ นันทะแก้ว 081-6452400
LINE : adunnan

                   https://microcontrollerkits.blogspot.com/

Friday, January 22, 2021

NVIDIA Jetson Performance Monitor with OLED Display

NVIDIA Jetson Performance Monitor on OLED Display

Last article is OLED Display on Jetson Nano . Now we use that for Jetson Nano performance monitor.

Test on 

  • NVIDIA Jetson Nano Developer Kit ( 4 GB )
  • Jetpack SDK 4.4.1 ( L4T 32.4.4 )

OLED Display 

128x32 or 128x64 SSD1306 OLED Display

Wiring Diagram


We've make expansion board for wiring.
 



Source Code on Github

Install Jetson-stats https://github.com/rbonghi/jetson_stats

Then Install PiOLED https://github.com/amphancm/installPiOLED

Run Code

~/installPiOLED/pioled$ python3 stats.py 

Press Switch Button is change page.
Page 1 Display

Page 2 Display

Page 3 Display

Page 4 Display

Reference

https://github.com/JetsonHacksNano/installPiOLED

https://github.com/rbonghi/jetson_stats



Adun Nantakaew อดุลย์ นันทะแก้ว 081-6452400
LINE : adunnan



Monday, January 18, 2021

OLED Display on NVIDIA Jetson Nano

 

OLED Display on NVIDIA Jetson Nano

On JetBot (JetBot is an open-source robot based on NVIDIA Jetson Nano.) It has 128x64 OLED and Connector. it's good idea for show something. 







We can use 128x64 OLED Display. ( more popular in the market and low cost )


Wiring Diagram ( same Raspberry pi connector )

I2C connection pin

http://raspberrypi4u.blogspot.com/2017/01/raspberry-pi-oled-i2c.html

OLED Driver and samples from Adafruit

Install the Adafruit PiOLED 128x32 Monochrome OLED driver (3527)

Adafruit-SSD1306 library

https://github.com/JetsonHacksNano/installPiOLED


Reference

https://github.com/JetsonHacksNano/installPiOLED

https://custom-build-robots.com/top-story-en/jetson-nano-oled-display-ssd1306/12124

https://learn.adafruit.com/adafruit-gfx-graphics-library/using-fonts

https://www.freefontspro.com/



Adun Nantakaew อดุลย์ นันทะแก้ว 081-6452400
LINE : adunnan

Tuesday, January 12, 2021

NVIDIA Jetson Nano Bitcoin Mining

What is Bitcoin Mining?

With Bitcoin, miners use special software to solve math problems and are issued a certain number of bitcoins in exchange. This provides a smart way to issue the currency and also creates an incentive for more people to mine.


Why is Monero Coin ( XMR ) ?

Unlike many cryptocurrencies that are derivatives of Bitcoin, Monero is based on the CryptoNote protocol and possesses significant algorithmic differences relating to blockchain obfuscation.
By providing a high level of privacy, Monero is fungible, meaning that every unit of the currency can be substituted by another unit. These units are indistinguishable from one another. This makes Monero different from public-ledger cryptocurrencies like Bitcoin, where addresses previously associated with undesired activity can be blacklisted and refused by network members.

Can the NVIDIA Jetson Nano be used for Bitcoin mining?

It can, just not efficiently.

Then for education purpose.


How many it can?   only 16.xx H/s


if you have 1600 H/s you will get 0.00002 BTC/week.
But NVIDIA Jetson Nano can get only 16 H/s.

Power Consumption of NVIDIA Jetson Nano

use jtop command line


Mining Software

xmrMiner - A CUDA based miner for Monero ( https://github.com/xmrMiner/xmrMiner )

xmrMiner 0.3.0 is ready for the Monero hardfork v7



Reference

http://raspberrypi4u.blogspot.com/2017/11/raspberry-pi-bitcoin-miner-monero-xmr.html

https://www.quora.com/Can-the-NVIDIA-Jetson-TX1-be-used-for-Bitcoin-mining

https://minergate.com/

https://github.com/xmrMiner/xmrMiner




Adun Nantakaew อดุลย์ นันทะแก้ว 081-6452400
LINE : adunnan