Welcome to Image Classification using Jetson Nano. This repo will walk you through how i collected datasets,trained model and classified images.I have collected Cucumber,Mango images and trained my model.
I have used ResNet-18 image recognition model. ResNet is a residual network, made with building blocks that incorporate "shortcut connections" that skip one or more layers.The ResNet architectures presented range from 18-layers deep, all the way to 152-layers deep. In our project we will be using ResNet-18. ResNet-18 is a convolutional neural network that is 18 layers deep. We can load a pretrained version of the network trained on more than a million images from the ImageNet database.
The code is in the classification directory named train.py.I have downloaded required models,modules by referring HELLO AI WORLD. And for datasets you can refer this method.
$ cd NvidiaProject/classification
For disabling the desktop GUI.
$ sudo init 3
login in back and after training exit it by using the following command:
$ sudo init 5
$ python3 train.py --model-dir=models/mydatasets --batch-size=8 --workers=2 --epochs=30 data/mydatasets
$ python3 onnx_export.py --model-dir=models/mydatasets
- MIPI CSI cameras (csi://0)
- V4L2 cameras (/dev/video0)
- RTP/RTSP streams (rtsp://username:password@ip:port)
$ imagenet.py --model=models/mydatasets/resnet18.onnx --labels=data/mydatasets/mylabels.txt --input_blob=input_0 output_blob=output_0 /dev/video0
$ imagenet.py --model=models/mydatasets/resnet18.onnx --labels=data/mydatasets/mylabels.txt --input_blob=input_0 output_blob=output_0 /dev/video0 test.mp4