nvidia公司出品的Hello AI world教程写的很好,配合jetson nano自带的GPU加速,非常适合低成本的AI入门学习(图像分类,物体识别,语义分割、姿态检测等)。
相应代码 https://github.com/dusty-nv/jetson-inference
但是github国内访问很不稳定,还有些大文件放在box上,安装起来很折腾。我这里整理了一个不用vpn从国内网站安装的教程,整个安装过程只需1小时左右。
1. jetson nano系统
首先需要安装好jetson nano的ubuntu系统,以及最新的jetpack 4.6。安装方法如下:
- jetson nano 2G: https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-2gb-devkit
- jetson nano 4G: https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit
2. 下载inference代码
github代码已拷贝到国内gitee,最新提交2021/10/04。
https://gitee.com/duping812/jetson-inference
$ git clone --recursive https://gitee.com/duping812/jetson-inference
注意–recursive选项会同时安6个submodule, jetson_utils, camera-capture, pytorch-classification, pytorch-detection, pytorch-segmentation, trt_pose。其中pytorch-detection还有个子模块pytorch-ssd,我都已在.gitmodules文件里把地址统一改为gitee的源了。
3. 用docker方式安装
docker容器的好处,所有相关程序、环境都已配置好,直接运行即可,比从源码安装方便很多。
$ cd jetson-inference
$ docker/run.sh

启动界面,默认会勾选一些常用的模型,这些放在box国内连不上。模型全部不选,直接安装docker镜像,好在镜像文件所在网站国内能直连。安装往后看到root@xxx提示符就说明装好了。这时先退出docker.
# exit
4. 模型下载
前面用到的模型,我传到了网盘。
- 百度网盘 https://pan.baidu.com/s/1O8L70uIyn7Cuj-APsA5pAw 提取码:82ex
- 清华云盘 https://cloud.tsinghua.edu.cn/d/7bd45188869e4434b28b/
后面用到哪个,下载下来,解压缩后,拷到~/jetson-inference/data/networks
5. 测试是否安装成功
再次启动docker
$ docker/run.sh
进入可执行程序目录
# cd build/aarch64/bin
查看摄像头(需要在docker启动前插上摄像头)
# ./video-viewer /dev/video0
图像分类,默认使用GoogleNet模型。注意首次运行会花几分钟优化模型,优化后的模型缓存到sd卡上,下次运行就会很快了。
# ./imagenet images/jellyfish.jpg images/test/jellyfish.jpg

物体识别,默认使用SSD-Mobilenet-v2模型
# ./detectnet images/peds_0.jpg images/test/peds_0.jpg





被折叠的 条评论
为什么被折叠?



