æ©æ¢°åŠç¿ãåŠã¶ããšãç®çãšãããAIã§è»äž¡ãæäœããŠèµ°è¡æ§èœã競ãã²ãŒã ã§ãã
ã質åã¯ãFAQã«éçŽããŸãã
èšèŒäºå®
ãã¡ãã«jetson nanoã®ååãèšèŒ
ïŒã·ãã¥ã¬ãŒã¿ãæ©æ¢°åŠç¿ã¯éåžžã®PCã§ã§ããªãããªãããç°å¢çµ±äžã®ããã以éã®ç°å¢æ§ç¯ãåäœç¢ºèªã¯jetson nanoãåºæºã«è¡ãïŒ
以äžããã€ã¡ãŒãžãã¡ã€ã«ãååŸããã
æšå¥šããŒãžã§ã³ã¯Jetpack 4.4.1
# Jetpack 4.4.1 archive
https://developer.nvidia.com/jetpack-sdk-441-archive
# latest version
https://developer.nvidia.com/embedded/jetpack
ååŸåŸãã€ã¡ãŒãžãã¡ã€ã«ãSDã«ãŒãã«æžã蟌ãã§ãJetsonNanoã«æ¿ããŠèµ·åããã
èµ·ååŸããããã¯ãŒã¯ã«æ¥ç¶ããã
* ãå§ãèšå®
ãŠãŒã¶å: jetson
ãã¹ã¯ãŒã: (ä»»æ)
# ãå§ãèšå®ã¯ãé 次远èšäºå®ããŠãŒã¶åãå
±éåãããšãã«ãã¹æå®ãèŠãæã«ããã確çãæžãã
- åŠç¿çšããŒã¿ãåŠç¿ã¢ãã«ãåèã
ãã¡ãã«sampleããŒã¿ã眮ããŠããŸããéå¶ã®åäœç¢ºèªçšã§ãã
- Dockerç°å¢ãåèã
ãã¡ãã«Dockerç°å¢ã®å©çšæé ã眮ããŠããŸããéå¶ã®åäœç¢ºèªçšã§ãã
çµæ§æéãæãããŸãã
ãšããããåããããæ¹ã¯ãã¡ãã®Dockerç°å¢ããè©Šãé ããŠãOKã§ãã
ã#ãããå§ãŸãè¡ã¯ã³ã¡ã³ãã§ãã
ãã¡ãã«ãä»¥äž 2.0.ïœ2.4. ãèªåå®è¡ããã¹ã¯ãªãããçšæããŠããŸãã
èªåã€ã³ã¹ããŒã«ã¹ã¯ãªããã䜿ããã以äžã®æé ãæåã§å®è¡ããŠã€ã³ã¹ããŒã«ããŠãã ããã
cd ~
git clone https://github.com/JetsonHacksNano/installSwapfile
cd installSwapfile
./installSwapfile.sh
# SWAPé åãå¢ããŠããããšã確èª
free -mh
sudo apt-get update
sudo apt-get install -y net-tools git
sudo apt-get install -y python-pip
# install pyqt5 and NumPy
sudo apt-get install -y python3-pip
sudo apt-get install -y python3-pyqt5
pip3 install --upgrade pip
pip3 install numpy
# for judge server
pip3 install flask
pip3 install requests
python -m pip install requests
# pygame
sudo apt-get update -y
sudo apt-get install -y libsdl-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev
sudo apt-get install -y libsmpeg-dev libportmidi-dev libavformat-dev libswscale-dev
sudo apt-get install -y libfreetype6-dev
sudo apt-get install -y libportmidi-dev
sudo pip3 install pgzero
python -m pip install pygame==1.9.6
# scikit learn
sudo apt install -y gfortran
- ROS(melodic)ã®ã€ã³ã¹ããŒã«
# ã€ã³ã¹ããŒã«æé åè:
# https://www.stereolabs.com/blog/ros-and-nvidia-jetson-nano/
# ãã¡ãã®æé ãèªååããŠãããkaraage0703ããã®jetson-nano-toolsã䜿ãããŠé ããŸãã
# catkin_wsãèªåã§äœæããŠãããŸãã
cd ~
git clone https://github.com/karaage0703/jetson-nano-tools
cd jetson-nano-tools
./install-ros-melodic.sh
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source /opt/ros/melodic/setup.bash
- ROSé¢é£ããã±ãŒãžã®ã€ã³ã¹ããŒã«
# joint state controller, and ros package
sudo apt install -y ros-melodic-ros-control ros-melodic-ros-controllers ros-melodic-joint-state-controller ros-melodic-effort-controllers ros-melodic-position-controllers ros-melodic-joint-trajectory-controller
sudo apt install ros-melodic-cob-srvs
# gazebo
sudo apt-get install -y gazebo9
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get update -y
sudo apt-get install -y ros-melodic-gazebo-ros-pkgs ros-melodic-gazebo-ros-control
echo "export GAZEBO_MODEL_PATH=:${HOME}/catkin_ws/src/ai_race/ai_race:${HOME}/catkin_ws/src/ai_race/ai_race/sim_world/models" >> ~/.bashrc
export GAZEBO_MODEL_PATH=:${HOME}/catkin_ws/src/ai_race/ai_race:${HOME}/catkin_ws/src/ai_race/ai_race/sim_world/models
# camera image
sudo apt-get install -y ros-melodic-uvc-camera
sudo apt-get install -y ros-melodic-image-*
# ã€ã³ã¹ããŒã«æé åè:
# https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-7-0-now-available/72048
# https://github.com/NVIDIA-AI-IOT/torch2trt
# https://github.com/mdegans/nano_build_opencv
# äžèšã®ãµã€ãçãåèã«ããäžã§ãå¿
èŠãªã³ãã³ããäžèšã«èšèŒããŠããŸãã
### pytorch from pip image (v1.4)
wget https://nvidia.box.com/shared/static/yhlmaie35hu8jv2xzvtxsh0rrpcu97yj.whl -O torch-1.4.0-cp27-cp27mu-linux_aarch64.whl
sudo apt-get install -y python-pip libopenblas-base libopenmpi-dev
pip install torch-1.4.0-cp27-cp27mu-linux_aarch64.whl
wget https://nvidia.box.com/shared/static/c3d7vm4gcs9m728j6o5vjay2jdedqb55.whl -O torch-1.4.0-cp36-cp36m-linux_aarch64.whl
sudo apt-get install -y python3-pip libopenblas-base libopenmpi-dev
pip3 install torch-1.4.0-cp36-cp36m-linux_aarch64.whl
### torch vision (v0.2.2)
# https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-7-0-now-available/72048
pip install future
pip3 install future
sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libavcodec-dev libavformat-dev libswscale-dev
cd ~
git clone --branch v0.5.0 https://github.com/pytorch/vision torchvision
cd torchvision
export BUILD_VERSION=0.2.2
sudo python setup.py install
sudo python3 setup.py install
cd ../
pip install 'pillow<7'
### torch2trt
cd ~
git clone https://github.com/NVIDIA-AI-IOT/torch2trt
cd torch2trt
git checkout d1fa6f9f20c6c4c57a9486680ab38c45d0d94ec3 # åäœç¢ºèªæžã¿ã®ããŒãžã§ã³ïŒWed Nov 4æç¹ïŒã«æ»ã
sudo python setup.py install
sudo python3 setup.py install
### sklearn python3
pip3 install scikit-learn
#pip3 install matplotlib
#sudo apt-get -y install python3-tk
### pandas python2,3 (defaultã䜿ãã°ãã)
#pip3 install cython
#pip3 install numpy
#pip3 install -U pandas
### opencv python
### opencv python ã¯ãœãŒã¹ãããã«ãããå¿
èŠããã. 8ïœ10æéã»ã©æãã.
cd ~
git clone https://github.com/mdegans/nano_build_opencv
cd nano_build_opencv
./build_opencv.sh 3.4.10
- ã©ã€ãã©ãªããŒãžã§ã³
æšå¥šç°å¢
ã©ã€ãã©ãª | ããŒãžã§ã³(python3) | ã ããŒãžã§ã³(python) | åè |
---|---|---|---|
pytorch | 1.4.0 | - | |
torchvision | 0.2.2 | 0.2.2 | - |
torch2trt | - | - | åäœç¢ºèªæžã¿ã®ããŒãžã§ã³ git checkout d1fa6f9f20c6c4c57a9486680ab38c45d0d94ec3 |
sklearn | 0.23.2 | Not_Installed | - |
pandas | 0.22.0 |
Not_Installed | - |
cv2 | 3.4.10 | 3.4.10 | - |
pygame | 1.9.6 | 1.9.6 | - |
åè
pytorchãštensoflowã®ããŒãžã§ã³ãã³ãã³ãã©ã€ã³ãã調ã¹ã
ïŒäŸïŒhttps://github.com/seigot/ai_race ãªããžããªã®å Žå
mkdir -p ~/Images_from_rosbag
cd ~/catkin_ws/src
git clone http://github.com/seigot/ai_race # èªåã®ãªããžããªãååŸããå Žåã¯ãããã®URLãå€ããŠäžããã
cd ~/catkin_ws
catkin build
source devel/setup.bash
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
å¥ãªããžããªã®ãã«ãããããã±ãŒãžè¿œå æã®åãã«ãæé ã¯ãFAQ #catkin_wsãåbuildããã«ã¯ã©ãããã°ããïŒããåèäžããã
å¥ã
ã®ã¿ãŒããã«ã§å®è¡ããŠäžããã
cd $HOME
git clone http://github.com/seigot/ai_race_data_sample
cd ~/catkin_ws/src/ai_race/scripts
bash prepare.sh
ãµã³ãã«ããŒã¿ã®ããŠã³ããŒãããŠäœ¿ãå Žåã®äŸã
以äžã®éãå®è¡ããã
# åå²ããŠããsampleããŒã¿ãçµåãã
cd $HOME/ai_race_data_sample/model/plane
cat sample_plane_trt_p* > sample_plane_trt.pth
# æšè«
cd ~/catkin_ws/src/ai_race/ai_race/learning/scripts
python inference_from_image.py --trt_module --trt_model $HOME/ai_race_data_sample/model/plane/sample_plane_trt.pth
ãµã³ãã«ããŒã¿ã䜿ã£ãŠåŠç¿ã¢ãã«ãäœæããå Žåã®äŸã
åäœç¢ºèªçšã«--n_epoch 3
ãæå®ããŠçŽ30åçšã§çµããããã«ããŠããŸãã
cd ~/catkin_ws/src/ai_race/ai_race/learning/scripts
python3 train.py --data_csv $HOME/ai_race_data_sample/dataset/plane/_2020-11-17-01-34-45/_2020-11-17-01-34-45.csv --model_name sample_model --n_epoch 3
train.py
ã®å®è¡ãã°ãåç
§ããåŠç¿ã¢ãã«(*.pth
)ãã¡ã€ã«ãäœæã§ããŠããããšã確èªäžããã
train.py
ã®åŒæ°ã«äžãããããã©ã¡ãŒã¿ã¯ä»¥äžã§ç¢ºèªã§ããŸãã--n_epoch NN
çã®ãã©ã¡ãŒã¿ã¯é©å®èª¿æŽããŠäžããã
python3 train.py -h
JetsonNanoã«åãããŠåŠç¿ã¢ãã«ã軜éåããã(trtããçãšåŒã°ãããã®)
äœæããåŠç¿ã¢ãã«ã®ãã¹ãã$HOME/ai_race_data_sample/model/plane/sample_plane.pth
ã§ããå Žåã®äŸãäžåºŠå®è¡ãããšçŽ10åçšæãããŸãã
python3 trt_conversion.py --pretrained_model $HOME/ai_race_data_sample/model/plane/sample_plane.pth --trt_model sample_model_trt.pth
trt_conversion.py
ã®å®è¡ãã°ãåç
§ãã--trt_model
ã«æå®ãããã¡ã€ã«ãäœæã§ããŠããããšã確èªäžããã
ãã®åŸã¯åè¿°åæ§ã軜éåããåŠç¿ã¢ãã«ãå©çšããŠæšè«ãè»äž¡æäœãè¡ã£ãŠäžããã
rqt, joystick, åçš®ã³ã³ãããŒã©ãŒã§è»äž¡æäœããåŠç¿çšã®ããŒã¿ïŒç»åãã³ãã³ãæäœãã°ïŒãååŸããã
ãµã³ãã«ããŒã¿ã§ã¯æåŸ
ããæ§èœãåºãªãçã課é¡ãæããå Žåã¯ãåŠç¿ããŒã¿ãç¬èªã«ååŸããããšããå§ãããŸãã
以äžãå®è¡ããããšã§ãkeyboardããè»äž¡æäœãã§ããŸãã
cd ~/catkin_ws/src/ai_race/ai_race/utility/scripts
python keyboard_con_pygame_videosave.py
### `ESC`ããŒæŒäžã§çµäº
### çµäºåŸãåŠç¿ããŒã¿ïŒç»åãšã³ãã³ãïŒãæ ŒçŽãããã£ã¬ã¯ããªãããããšãã³ãã³ããã確èªãã
ls ${HOME}/Images_from_rosbag/
äžèšå®è¡åŸãå·Šäžã®ãïŒãã®ãã¡keyboard_con....py
ã衚瀺ãããŠããã®ãæŒããŠã
ãã®ç¶æ
ã§ä»¥äžããŒãæŒããšè»äž¡ãåãã
ããŒãè»äž¡ã®åã
l é²ã
a å·Šã«ãŸãã
d å³ã«ãŸãã
keyboard_con_pygame_videosave.py
ã®åæ¢ã¯ESC
ããŒãæŒäžããŠäžããã
ãã®åŸã${HOME}/Images_from_rosbag/
以äžã«åŠç¿ããŒã¿ïŒç»åãšã³ãã³ãïŒãæ ŒçŽãããŸãã
以äžã§äœæããããŒã¿ããåŠç¿ã¢ãã«äœæã«äœ¿çšäžããã
åŠç¿çšããŒã¿ã®ååŸãåŠç¿ã¢ãã«ãäœæãåŠç¿ã¢ãã«ãå©çšããæšè«çšã³ãã³ã
- Step1.åŠç¿çšããŒã¿ã®ååŸ
bash prepare.sh
ãå®è¡ããç¶æ
ã§ãå¥ã¿ãŒããã«ãã以äžãå®è¡
## åŠç¿çšããŒã¿ååŸ
## rosbagååŸ
roslaunch sim_environment rosbag.launch output_path:=<åºåãã¡ã€ã«ã®ãã£ã¬ã¯ã㪠絶察ãã¹æå®>
rqt # rqtã䜿ãå Žåãrobot steering -> è»äž¡å¶åŸ¡ãã©ã¡ãŒã¿ïŒv,radïŒæå®
## rosbag --> image/command å€æ
cd ~/catkin_ws/src/ai_race/ai_race/utility/scripts
mkdir -p /Images_from_rosbag
sudo chmod 777 /Images_from_rosbag
python rosbag_to_images_and_commands.py **.bag # bagãã¡ã€ã«ããåŠç¿çšããŒã¿ïŒç»åãšè»äž¡å¶åŸ¡ãã©ã¡ãŒã¿ïŒãååŸ
python listup_all_rosbag_timestamp.py *.bag # æå»è¡šç€ºã§ãã
- Step2.åŠç¿çšããŒã¿ãããåŠç¿ã¢ãã«ãäœæ
## åŠç¿Â
cd learning/scripts (åŠç¿çšãã©ã«ããžç§»å)Â
python3 train.py --data_csv <csvã®ãã¹ ãã«ãã¹æå®> --model_name <ä¿åããã¢ãã«å>
#### å®è¡ãã°èšèŒã®ãã£ã¬ã¯ããªã«ã¢ãã«ãä¿åãããŸã
- Step3.åŠç¿ã¢ãã«ã䜿ã£ãŠæšè«ãè»äž¡æäœ
bash prepare.sh
ãå®è¡ããç¶æ
ã§ãå¥ã¿ãŒããã«ãã以äžãå®è¡
## åŠç¿ã¢ãã«ãå©çšããæšè«ãè»äž¡æäœ
## æšè«(trtãªã trt=æ¯èŒç軜éãªã¢ãã«)
cd ~/catkin_ws/src/ai_race/ai_race/learning/scripts
python inference_from_image.py --pretrained_model <åŠç¿ãããã¢ãã« ãã«ãã¹æå®>
- Step3+.åŠç¿ã¢ãã«ã軜éåããŠæšè«ãè»äž¡æäœ
## æšè«(trtããïŒ
#### æºåïŒæºåã¯æåã®äžåã§OKïŒ
cd ~/catkin_ws/src/ai_race/ai_race/learning/scripts
python3 trt_conversion.py --pretrained_model <åŠç¿ãããã¢ãã« ãã«ãã¹æå®> --trt_model <ä¿åããtrtã¢ãã«å>  Â
#### æå®ãããã£ã¬ã¯ããªã«ã¢ãã«ãä¿åãããŸã
#### å®è¡Â
python inference_from_image.py --trt_module --trt_model <ä¿åããtrtã¢ãã«å ãã«ãã¹æå®>Â
ãã£ã¬ã¯ã㪠| å 容 | ã åè |
---|---|---|
./ai_race/learning | æ©æ¢°åŠç¿ã¹ã¯ãªãã | - |
./ai_race/utility | åŠç¿ããŒã¿ååŸããŒã«ã | - |
./ai_race/your_environment | ååå è ã®äœæã³ãŒããæ ŒçŽããããã®ãã£ã¬ã¯ããªïŒããã«ã³ãŒãã眮ããšéå¶åŽã®ã¢ããããŒããšconflictããªãïŒ | äž»ã«åå è åã |
./scripts | èµ·åãçµäºã¹ã¯ãªãã | - |
./ai_race/sim_world | ã·ãã¥ã¬ãŒã¿çšã¢ãã«ããŒã¿ | äž»ã«éå¶åã |
./ai_race/sim_environment | ã·ãã¥ã¬ãŒã¿çšROSããŒãç | äž»ã«éå¶åã |
./judge | 審å€ãµãŒã | äž»ã«éå¶åã |
./document | å ¬éè³æ | äž»ã«éå¶åã |
./docker | dockerç°å¢ | äž»ã«éå¶åã |
./ai_race/example | ã·ãã¥ã¬ãŒã¿çšã¢ãã«ããŒã¿ã®ãµã³ãã« | ROS/ã·ãã¥ã¬ãŒã¿çãåŠã³ãã人åããã¥ãŒããªã¢ã« |
(äž»èŠãªãã¡ã€ã«ãæç²)
âââ README.md # æ¬Readme
âââ ai_race
â  âââ learning
â  â  âââ scripts # æ©æ¢°åŠç¿ã¹ã¯ãªãã
â  â  âââ MyDataSet.py # åŠç¿ã¢ãã«äœæçšã¹ã¯ãªãã
â  â  âââ train.py # åŠç¿ã¢ãã«äœæçšã¹ã¯ãªãã
â  â  âââ inference_from_image.py # æšè«ã«ããè»äž¡æäœçšã¹ã¯ãªãã
â  â  âââ trt_conversion.py # åŠç¿ã¢ãã«è»œéåçšã¹ã¯ãªããïŒTRTçã«å€æããçšïŒ
â  âââ utility
â  â  âââ scripts # åŠç¿ããŒã¿ååŸããŒã«
â  â  âââ joycon.py # è»äž¡æäœçš
â  â  âââ keyboard_con_pygame2.py # è»äž¡æäœçš
â  â  âââ listup_all_rosbag_timestamp.py # rosbag timestamp衚瀺çš
â  â  âââ rosbag_to_images_and_commands.py # rosbag-->image,comandå€æçš
â  â Â
â  âââ your_environment # ååå è
ã®äœæã³ãŒããæ ŒçŽããããã®ãã£ã¬ã¯ããª
â  â â # ïŒããã«ã³ãŒãã眮ããšéå¶åŽã®ã¢ããããŒããšconflictããªãïŒ
â  â  âââ launch
â â â âââ sim_environment.launch # åå è
ç¬èªã§åŠç¿ããŒã¿ååŸããå Žåã®ãã·ãã¥ã¬ãŒã¿ã¢ãã«è¿œå çšã²ãªåœ¢ãã¡ã€ã«
â  â  âââ scripts
â  â  âââ your_train.py # åå è
ç¬èªã§train.pyãäœæããå Žåã®ã²ãªåœ¢ãã¡ã€ã«
â  â Â
â  âââ example # ã·ãã¥ã¬ãŒã¿çšã¢ãã«ããŒã¿ã®ãµã³ãã«
â  â  âââ tutorial1-7
â  âââ sim_environment # ã·ãã¥ã¬ãŒã¿çšROSããŒãç
â  âââ sim_world # ã·ãã¥ã¬ãŒã¿çšã¢ãã«ããŒã¿
â Â
âââ FAQ.md # FAQ
âââ docker # dockerç°å¢
âââ document # å
¬éè³æ
âââ judge # 審å€ãµãŒã
âââ scripts # èµ·åçšã¹ã¯ãªãã
âââ prepare.sh # ã·ãã¥ã¬ãŒã¿ç°å¢èµ·åçš(level1-3察å¿)
âââ start.sh # [倧äŒçš] éå§ã¹ã¯ãªãã
âââ stop.sh # [倧äŒçš] åæ¢ã¹ã¯ãªãã
ãŸããGithubã¢ã«ãŠã³ããååŸããŠæ¬ãªããžããªãèªãªããžããªã«forkããŠäžããã
ãªããžããªã®ãã©ãŒã¯ã®äŸ
- GitHubã¢ã«ãŠã³ããäœæ/ãã°ã€ã³ããã
- GitHub ã§ãhttps://github.com/seigot/ai_raceãªããžããªã«ç§»åããŸã
- ããŒãžã®å³äžã«ãã [Fork] ãã¯ãªãã¯ããŸãã
åèïŒãªããžããªããã©ãŒã¯ãã
forkãããªããžããªã§åã
ã®åŠç¿ããŒã¿ååŸããã¥ãŒãã³ã°ãåŠç¿ã¢ãã«äœæãããŠãã ããã
å€æŽãã¡ã€ã«ã¯ãéå¶ãšã®conflictãé¿ããããã«your_environmentãã£ã¬ã¯ããª
以äžã«ç»é²ããããšããå§ãããŸãã
- åŠç¿ããŒã¿ã®ååŸã工倫ãã
ãµã³ãã«ã®åŠç¿çšããŒã¿ã®ååŸ
ãåèã«ãè»äž¡ãèªãæäœããŠåŠç¿ããŒã¿ãååŸããããšãå¯èœã§ãã
èµ°è¡çµè·¯
ãå
¥åç»åã®ããªãšãŒã·ã§ã³
ãªã©ãåã
工倫ãããŠã¿ãŠãã ããã
â» åŠç¿ããŒã¿èªäœã¯ãµã€ãºã倧ããããããã¡ã€ã«ã®åæž¡ãã¯github以å€ã§ãããšãããããšããå§ãããŸãã
ãïŒGithubã¯1ãã¡ã€ã«æ倧ã50MBãŸã§ã1GB 以äžãæšå¥šãšããå¶çŽãããã倧ããªãã¡ã€ã«ãæ±ãã®ã«é©ããŠãããšã¯ãããªãïŒ
- ãã¥ãŒãã³ã°ãåŠç¿ã¢ãã«ã®äœæã工倫ãã
train.pyãåšèŸºãã¡ã€ã«ãåèã«ãåçš®ãã©ã¡ãŒã¿ã調æŽããããšãå¯èœã§ãã
æ©æ¢°åŠç¿ã¢ã«ãŽãªãºã éžå®ãªã©å«ããåã
工倫ãããŠã¿ãŠãã ããã
åŠç¿ã¢ãã«ãå ¬åŒãªãªãŒã¹ããå Žåã¯ãGithubãªãªãŒã¹ã®æ©èœã䜿ããšç°¡åãªã®ã§ãå§ãã§ãã
åŠç¿ã¢ãã«ãæåºïŒãã€ããªãªãªãŒã¹ïŒããå Žåã®æé åè
ãªããžããªã®ãªãªãŒã¹ã管çãã
7.ãªãã·ã§ã³ã§ãã³ã³ãã€ã«ãããããã°ã©ã ãªã©ã®ãã€ããªãã¡ã€ã«ããªãªãŒã¹ã«å«ããã«ã¯ããã©ãã°ã¢ã³ãããããããããã€ããªããã¯ã¹ã§æåã§éžæããŸãã
ä»åŸãæ¬ãªããžããªãããŒãžã§ã³ã¢ããããŠããäºå®ã§ãã
æ¬ãªããžããªã®ããŒãžã§ã³ã¢ãããåã蟌ãå Žåã¯ãforkãããªããžããªã«ãŠä»¥äžãå®è¡ããŠäžããã
git checkout main # ããŒã«ã«ã®mainãã©ã³ãã«ç§»å
git remote add upstream https://github.com/seigot/ai_race # forkå
ã®ãªããžããªãupstream ãšããååã§ãªã¢ãŒããªããžããªã«ç»é²ïŒååã¯ãªãã§ããããç»é²æžã¿ãªãã¹ãããïŒ
git fetch upstream # upstream ããææ°ã®ã³ãŒããfetch
git merge upstream/main # upstream/main ã ããŒã«ã«ã®master ã«merge
git push # å€æŽãåæ
åèïŒgithub 㧠fork ãããªããžããªã§æ¬å®¶ã«è¿œåŸãã
æ¬ãªããžããªãžä¿®æ£ãªã¯ãšã¹ããéãããšãå¯èœã§ãã詳ããã¯åèããåç
§äžããã
â»è¿œèšãPull Requestç·Žç¿çšãªããžããªãäœæããŸããã
test_pull_request
åèïŒ
GitHub-ãã«ãªã¯ãšã¹ãã®äœææ¹æ³
[å®è·µ] ã¯ãããŠã®Pull Requestããã£ãŠã¿ãã
ãGitHubãPull Requestã®æé
ããã©ã«ãã§ã¯ããã¥ãŒã©ã«ãããã¯ãŒã¯ãšããŠResNet-18ã䜿ãããã«ãªã£ãŠããŸãããèªåã§ãã¥ãŒã©ã«ãããã¯ãŒã¯ãäœæããå Žåã®ãµã³ãã«ãšããŠãã·ã³ãã«ãªãã¥ãŒã©ã«ãããã¯ãŒã¯(SimpleNet)ãçšæããŠããŸãã
ResNet-18ã§ã¯ãªãSimpleNetã䜿ãå Žåã¯ãtrain.py
, trt_conversion.py
, inference_from_image.py
ã®å®è¡æã«ã--model simplenet
ãªãã·ã§ã³ãä»ããŠãã ããã
cd ~/catkin_ws/src/ai_race/ai_race/learning/scripts
python3 train.py --model simplenetã --data_csv $HOME/ai_race_data_sample/dataset/plane/_2020-11-17-01-34-45/_2020-11-17-01-34-45.csv --model_name sample_model
python3 trt_conversion.py --model simplenet --pretrained_model <åŠç¿ãããã¢ãã« ãã«ãã¹æå®> --trt_model <ä¿åããtrtã¢ãã«å>
python inference_from_image.py --model simplenet --trt_module --trt_model <ä¿åããtrtã¢ãã«å ãã«ãã¹æå®>Â
åŠç¿ã¢ãã«ã«ããæšè«ããè»äž¡ãæäœããŠèµ°è¡æ§èœã競ããŸãã
ä»åã¯ä»¥äžã®ã«ãŒã«ãæ¡çšäºå®ã§ãã
- å¶éæé4å以å
ã«ãã³ãŒã¹ãäœé±åãããã競ãã
- åŸè¿°ããã³ãŒã¹ã®ãã¡ãæãã·ã³ãã«ãªlevel1ã䜿ãã
- ã³ãŒã¹ã¢ãŠãã¯ãèªå埩垰å°é£ãªå Žåã¯ã¹ã¿ãŒãå°ç¹ã«åŸ©åž°ããŠèµ°è¡ãç¶ç¶ããã
ãã¡ã ã«è©³çŽ°ãèšèŒäºå®
åè¿°ã®prepare.sh
å®è¡æã«èµ·åããã¿ã€ããŒãšãåšåã«ãŠã³ã¿ãŒã䜿ãèªåèšæž¬ããŸãã
以äžã®ã³ãŒã¹ãçšæããŸããã
- | level1 | level1 withéæå£ | level1 advance |
---|---|---|---|
å称 | Plane | Plane(withéæå£) | Plane(advance) |
å€èŠ³ | |||
ç¹åŸŽ | å°é¢ïŒäžæ§ãªæš¡æ§ã§ã | å°é¢ïŒäžæ§ãªæš¡æ§ã§ã | å°é¢ïŒäžæ§ãªæš¡æ§+åšèŸºã«èãçããŠããŸãã èãšãªã¢èµ°è¡æã¯é床ãèœã¡ãŸãã |
éå®³ç© | ãªã | èµ€ãç¹ç·éšåã«éæã®å£ããããŸã | èµ€ãç¹ç·éšåã«éæã®å£ããããŸã |
èµ·åã³ãã³ã | bash prepare.sh -l 1 | bash prepare.sh -l 1t | bash prepare.sh -l 1a |
åŠç¿ããŒã¿ã®ãµã³ãã« | ããïŒïŒé±åïŒurl | ãªã | ãªã |
åè | ä»åã®ã«ãŒã«ã§æ¡çš | ååèµ·ååã«ãFAQãåèã«å床catkin buildããŠäžãã | ååèµ·ååã«ãFAQãåèã«å床catkin buildããŠäžãã |
- | level1æ¥ | level1å€ | level1ç§ | level1å¬ |
---|---|---|---|---|
å称 | cherry | summer | fall | winter |
å€èŠ³ | ãã¡ã | ãã¡ã | ãã¡ã | ãã¡ã |
ç¹åŸŽ | ãã£ãŒã«ãäžé¢ã«æ¡ãåºãã£ãŠããŸã | ãã£ãŒã«ãäžé¢ãå€æš¡æ§ã§ã | ãã£ãŒã«ãäžé¢ã«èœã¡èãåºãã£ãŠããŸã | ãã£ãŒã«ãäžé¢ããå¬æš¡æ§ã§ã |
éå®³ç© | - | - | - | - |
èµ·åã³ãã³ã | bash prepare.sh -l 1c | bash prepare.sh -l 1s | bash prepare.sh -l 1f | bash prepare.sh -l 1w |
åŠç¿ããŒã¿ã®ãµã³ãã« | ãªã | ãªã | ãªã | ãªã |
åè | - | - | - | - |
- | level1 large |
---|---|
å称 | level1 large track |
å€èŠ³ | ãã¡ã |
ç¹åŸŽ | level1ã倧ãããããã£ãŒã«ãã«é害ç©ã眮ãããŠããŸã |
éå®³ç© | ã³ãŒã¹äžã«äžè§ã³ãŒã³ãè€æ°çœ®ãããŸãïŒçœ®ãæ¹ã¯ã©ã³ãã ã«ãªãäºå®ã§ãïŒ |
èµ·åã³ãã³ã | bash prepare.sh -l l |
åŠç¿ããŒã¿ã®ãµã³ãã« | ãªã |
åè | - |
- | level2 | level3 |
---|---|---|
å称 | Medium Track | Hard track |
å€èŠ³ | ||
ç¹åŸŽ | å°é¢ïŒæ¿æ·¡ä»ãã®æš¡æ§ã§ã | å°é¢ïŒãµãŒãããåã®æš¡æ§ã§ããã«ãŒããæ¥ã§ãé床ã調æŽããªããšæ²ãããªã |
éå®³ç© | ãªã | äžè§ã³ãŒã³ã眮ããã |
èµ·åã³ãã³ã | bash prepare.sh -l 2 | bash prepare.sh -l 3 |
åŠç¿ããŒã¿ã®ãµã³ãã« | ããïŒïŒé±åïŒurl | ãªã |
åè | optional | optionalïŒæºåäžïŒ |
- 競æã³ãŒã¹ã§åäœããåŠç¿ã¢ãã«ãã³ãã³ãå®è¡æ¹æ³ãæåºããŠäžãããïŒåŠç¿ã¢ãã«ã¯ãtrtããç/trtãªãçã©ã¡ãã§ãOKã§ãïŒ
- æåºæ¹æ³ã¯ãGithubãªãªãŒã¹ã®æ©èœã䜿ããšç°¡åãªã®ã§ãå§ãã§ãããã®å Žåã¯Githubãªããžããªå/ãªãªãŒã¹URLãæããŠäžããã
åŠç¿ã¢ãã«ãæåºïŒãã€ããªãªãªãŒã¹ïŒããå Žåã®æé åè
ãªããžããªã®ãªãªãŒã¹ã管çãã
7.ãªãã·ã§ã³ã§ãã³ã³ãã€ã«ãããããã°ã©ã ãªã©ã®ãã€ããªãã¡ã€ã«ããªãªãŒã¹ã«å«ããã«ã¯ããã©ãã°ã¢ã³ãããããããããã€ããªããã¯ã¹ã§æåã§éžæããŸãã
- éäžçµéå«ããŠãäžäœã®çµæã¯ã©ããã«èŒããããšèããŠããŸãã
ãã¡ãã«èšèŒ
Jetson Nanoã«ROSãã€ã³ã¹ããŒã«ããæ¹æ³
Jetson Nanoé¢ä¿ã®TIPSãŸãšã Swapãã¡ã€ã«ã®èšå®
NVIDIA Jetson Nano㧠OpenCV 3ããã«ãããŠã€ã³ã¹ããŒã«ããæ¹æ³ãNVCaffeçã® OpenCV 4æªå¯Ÿå¿ãåãã
https://github.com/mdegans/nano_build_opencv
PyTorch for Jetson
https://github.com/NVIDIA-AI-IOT/torch2trt
RESPECT OneNightRobocon
ãªããžããªããã©ãŒã¯ãã
github 㧠fork ãããªããžããªã§æ¬å®¶ã«è¿œåŸãã
ãªããžããªã®ãªãªãŒã¹ã管çãã
~~ HAVE FUN ! ~~