Kickstart Jetson STEM Course Bootstraping the Jetson nano with Darknet Yolo
Jetson Nano Developer Kit SD Card Image https://developer.nvidia.com/embedded/downloads and burn ISO using balenaEtcher
boot up the Jetson nano Ensure the JP48 is connected, connect the 5V 4A power
This automatically do some magic stuffs
git clone https://github.com/carryai/kickstart-jetson.git
cd kickstart-jetson
Create Wi-Fi hotspot you might need to change the code to change ssid and password
./configure-network.sh
ascii | |
---|---|
SSID | i_am_jetson |
Password | jetsonnano |
./requirements.sh
c:\Users**(your_username)**.ssh\config
Host Jetsonnano-192.168.2.1
HostName 192.168.2.1
User jetsonnano
ForwardAgent yes
StrictHostKeyChecking no
cd
git clone https://github.com/AlexeyAB/darknet.git
nano Makefile
GPU=1
CUDNN=1
OPENCV=1
LIBSO=1
#uncomment the line
ARCH= -gencode arch=compute_53,code=[sm_53,compute_53]
nano ~/.bashrc
export CUDA_VER=10.0
export PATH=${PATH}:/usr/local/cuda/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64
source ~/.bashrc
make -j4
cd ~/darknet wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights -O yolov4-tiny.weights
wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-csp.weights -O yolov4-csp.weights
./darknet detector test ~/darknet/cfg/coco.data ~/darknet/cfg/yolov4-csp.cfg ~/darknet/yolov4-csp.weights data/person.jpg
cd ~/darknet
export DISPLAY=:1
./darknet detector demo ~/darknet/cfg/coco.data ~/darknet/cfg/yolov4-csp.cfg ~/darknet/yolov4-csp.weights -thresh 0.50 -ext_output \
'v4l2src io-mode=2 device=/dev/video0 ! image/jpeg, width=1920, height=1080, framerate=30/1 ! jpegdec ! video/x-raw ! nvvidconv ! video/x-raw(memory:NVMM), format=(string)I420 ! nvvidconv ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink max-buffers=1 drop=true sync=false'
Let's take some time and allow me to explain what are the important things you need to consider when doing your training
However, training is almost impossible to be done on jetson nano, lets do it on cloud, we will use Google Colab
./darknet detector train "/training-data/face_mask/obj-google.data" "/training-data/face_mask/yolov3-tiny-prn-832.cfg" "/training-data/face_mask/yolov3-tiny-prn-832_last.weights" -dont_show
See https://www.jetsonhacks.com/2019/06/07/jetson-nano-gpio/ See https://github.com/NVIDIA/jetson-gpio
## Running Jetson-IO After the setup, we’re ready to go:
sudo /opt/nvidia/jetson-io/jetson-io.py
Using Linux rc.local https://www.linuxbabe.com/linux-server/how-to-enable-etcrc-local-with-systemd https://vpsfix.com/community/server-administration/no-etc-rc-local-file-on-ubuntu-18-04-heres-what-to-do/
sudo vim /etc/rc.local
#allow sending serial
if [ -f "/dev/ttyTHS1" ]; then
chmod 666 /dev/ttyTHS1
fi
if [ -f "/dev/ttyUSB0" ]; then
chmod 666 /dev/ttyUSB0
fi
https://www.thingiverse.com/thing:3603594 https://www.thingiverse.com/thing:4082134 https://www.prusaprinters.org/prints/4689-jetson-nano-case https://www.prusaprinters.org/prints/1420-nvidia-jetson-nano-case-nanomesh-mini
./start.sh
https://colab.research.google.com/drive/1czTxmIIcMkqRdgbsTOOmO4ecBeFIrKP8
https://www.waveshare.com/wiki/IMX219-160_Camera
wget https://www.waveshare.com/w/upload/e/eb/Camera_overrides.tar.gz
tar zxvf Camera_overrides.tar.gz
sudo cp camera_overrides.isp /var/nvidia/nvcam/settings/
sudo chmod 664 /var/nvidia/nvcam/settings/camera_overrides.isp
sudo chown root:root /var/nvidia/nvcam/settings/camera_overrides.isp
rm Camera_overrides.tar.gz
rm camera_overrides.isp