ãRaspberry Pi Advent Calendar 2019ãã®3æ¥ç®è¨äºã§ãã
ã©ãºãã¤5ã»ææ°OSã§ã®ã»ããã¢ããè¨äºã追è¨ãã¾ãã
ãææ°ã®ã©ãºãã¤5ãææ°OSã§ã®ç°å¢æ§ç¯ã¯ã以ä¸è¨äºãåããã¦åç §ãã ããã
ã©ãºãã¤4ãå ¥æãã¾ãã
ãã©ãºãã¤4ãå ¥æãã¾ãããè²ã äºæ ãããããã±ããã«å ¥ãã¦å©ããã2å°ã«å¢ãã¦ãã¾ãã¾ããã
ãã©ãºãã¤4ã2ã¤
ãæã«å ¥ã£ããã®ã¯ä»æ¹ãªãã®ã§ãæä¾ã®ã»ããã¢ããã¨æ´è½è¾¼ã¿ããã¨æãã¾ããã©ãºãã¤4ããã©ãºãã¤å§ãã人ãããããããã¾ãããããããã¦ä»ã¾ã§ã©ãºãã¤ä½¿ã£ã¦ããã¦ã¼ã¶ã¼ã¨ãã¦ã4ã§CPUã»ã¡ã¢ãªãå¤§å¹ ã«ã¹ããã¯ã¢ãããã¦ããã®ã§ããã£ãããªãããããä½æã§ãã¦å½¹ã«ç«ã¡ãããªã¢ããªãåããã¦ã¿ããã¨ã«ãã¾ããã
ãã¨ããããã§ãã»ã©ããå¦çãéããå½¹ã«ç«ã¡ããï¼ï¼ï¼ãªãã£ã¼ãã©ã¼ãã³ã°ã使ã£ãç»åèªèï¼æ£ç¢ºã«ã¯ç©ä½æ¤åºï¼ã試ãããã¨æãã¾ããç©ä½æ¤åºã«é¢ãã¦ã詳ããã¯ä»¥ä¸è¨äºåç §ä¸ããã
ããã以éãã©ãºãã¤ã®ãã£ã¼ãã©ã¼ãã³ã°ç°å¢æ§ç¯å«ããã»ããã¢ããè¨äºãæ¸ãã¦ããã¾ããã¡ãªã¿ã«ã©ãºãã¤4ã§ã»ããã¢ãããã¾ããããã©ãºãã¤3ã§ãåãè¦é ã§ã»ããã¢ããå¯è½ã§ãï¼é»æºã³ãã¯ã¿ãHDMIã³ãã¯ã¿ã®ã¿ã¤ãã®ã¿æ³¨æãã ããï¼ã
ç°å¢æ§ç¯ã®åææ¡ä»¶
ãä¸å¿åææ¡ä»¶ãããã¾ãã以ä¸ã¨ãªãã¾ãã®ã§ç¢ºèªä¸ãããç§ã¯Macã§ã»ããã¢ãããã¾ããããåºæ¬çã«ã©ã®OSã§ãåãè¦é ã§ã»ããã¢ããã§ãã¾ãã
- SDã«ã¼ãä½æç¨ã®PCï¼Mac/Linux/Windowsçï¼
- ã©ãºãã¤4åã³æä½éå¿ è¦ãªãã¼ãã¦ã§ã¢ï¼è©³ç´°ã¯æ¬¡ã«æ¸ãã¾ãï¼
- ãããã¯ã¼ã¯ç°å¢ãããï¼æç·ã§ãWiFiã§ãOKï¼
- ã³ãã³ãã©ã¤ã³ã®æä½éã®ç¥èããã
- ã©ãºãã¤ã¸ã®æããã
- 1æéã§æ§ç¯ã§ããªãã¦ãæããªãåºãå¿
ãç¹ã«æå¾ã®å¤§äºã§ããæã大äºã
å¿ è¦ãªãã¼ãã¦ã§ã¢
ãæåã«å¿ è¦ãªãã¼ãã¦ã§ã¢ã§ãã
Raspberry Pi 4 ã¢ãã«B
ãå½ããåã§ãããå¿ é ã§ããã
ã以ä¸ã®ããã«ã±ã¼ã¹ãå¤æã¢ããã¿ãHDMIã±ã¼ãã«ã¤ãã¦ããããããè²·ãã®ãè¯ãã§ãããç§ãè³¼å ¥ããããããä»ã¯çºå£²ãã¦ããªããããªã®ã§ãä»åã¯æ¬ä½ã®ã¿ãè²·ã£ãåæã§èª¬æãã¾ãã
ãããã
ãAmazonã®è³¼å ¥å ã®ãªã³ã¯ã¯ä»¥ä¸ã¨ãªãã¾ãã
注ï¼Amazonã®ã©ãºãã¤ããã¾ãã«ä¾¡æ ¼ãé«é¨°ãã¦ããã®ã§Switch Scienceããã®ãªã³ã¯ã«åãæ¿ãã¾ããã
Raspberry Pi 4 Model B / 4GBwww.switch-science.com
ãã¤ã¯ãSDã«ã¼ãã»SDã«ã¼ããªã¼ãã¼
ãã©ãºãã¤ã®OSããã¼ã¿ãæ ¼ç´ãããã¤ã¯ãSDã«ã¼ããå¿ é ã§ããã«ã¼ããªã¼ãã¼ãå¿ è¦ã«å¿ãã¦è²·ãã¾ããããSDã«ã¼ãã¯å¤§éã«è²·ãã¾ãããï¼ç§ã¯30æãããæã£ã¦ã¾ãï¼ã
ããã¤ã¯ãSDã«ã¼ãã¯ãããããè²·ããã¨ã«ãªãã®ã§ã«ã¼ãã±ã¼ã¹ãããã¨è¯ãã§ãã
ãã¼ãã¼ãã»ãã¦ã¹
ã好ããªãã®ã使ç¨ãã ãããæ®æ®µã®éçºã«ã¯å³ããã§ãããæã¡éã³ç¨ã«ã¯ä»¥ä¸ã®ãããªã¢ãã¤ã«ã®ç¡ç·ãã¼ãã¼ãã便å©ã§ãã
ã詳細ã¯ä»¥ä¸è¨äºåç §ä¸ããã
ã¢ãã¿ã»HDMIã±ã¼ãã«
ããã¡ãã好ããªãã®ãã©ããã¨ããããã¨ããã§ããããããã©ããï¼èªåã¯ãããã¾ããï¼ãªã®ã§æ³¨æã§ããçµæ§ã©ãºãã¤4ã¯ãã¢ãã¿ã¨ã®ç¸æ§ãå³ããããã§ããç§ãã¢ãã¿ãå¤ããããè¨å®ãå¤ãããããªãã¨ãã¡ã§ãããå ·ä½çã«ãã£ããã¨ã¯ã以ä¸ã®Qiitaè¨äºã«ã¾ã¨ãã¾ããã®ã§ãåç §ä¸ããã
ãæã¡éã³ã«ä¾¿å©ãªä»¥ä¸å°åã¢ãã¿ããã使ã£ã¦ããã®ã§ãããã©ãºãã¤4ã ã¨ããã©ã«ãè¨å®ã ã¨æ ãã¾ãããä¸è¨è¨äºãåèã«è¨å®å¤æ´ããã°æ ãã¾ããã
ãããæ ããªãã£ããã家ã«ããã¢ãã¿ãè²ã 試ãã¦ã¿ã¦ä¸ããããã¨ãã©ãºãã¤4ã¯ãã¤ã¯ãHDMI端åãªã®ã§ãå¤æã³ãã¯ã¿ãå¿ããã«è³¼å ¥ãã¾ãããã
é»æº
ãã©ãºãã¤4ã¯ãé»æºã§ã®åé¡ãããåããã£ãã®ã§å¿é
ãã¦ãã¾ããããã¨ããããæ®éã«å®¶ã«ãã2.4Aåºåå¯è½ãªé»æºã§ããã°åä½ãã¾ããã3Aåºãããã¤ãå®å¿ã§ãããããã¾ãæé ã«Amazonã§è²·ãããã®ã¯ãªãæãã§ãï¼ãããã£ããæãã¦ä¸ããï¼ã
ãç§ãåä½ç¢ºèªã§ãã¦ãAmazonã§æé ã«è³¼å ¥ã§ãããã®ã¯ä»¥ä¸ã§ãã3Aãåºåã§ãã¾ãã
ã以ä¸ã¯2.4Aã¾ã§ã§ããã2portãã£ã¦ä¾¿å©ã§ããç§ã®ç°å¢ã§ã¯ã©ãºãã¤4åä½ãã¾ããã
ãã±ã¼ãã«ã¯USB-Cãªã®ã§ééããªãããã«ãã¾ãããã
ã«ã¡ã©ã¢ã¸ã¥ã¼ã«
ãç»åèªèã¨ããã°ã«ã¡ã©ã¨ãããã¨ã§ãã«ã¡ã©ã¢ã¸ã¥ã¼ã«ãè²·ãã¾ããããä»åã®è¨äºã¯ãã«ã¡ã©ã¢ã¸ã¥ã¼ã«ã®ä½¿ç¨ãåæã¨ãã¦ãã¾ãã
ãUSBã«ã¡ã©ã§ãå¤å大ä¸å¤«ã§ãããç¹ã«ç¢ºèªã¯ãã¦ãã¾ããã
ã©ãºãã¤ã®ç°å¢æ§ç¯
ãç°å¢æ§ç¯ããã¦ããã¾ãã
ç°å¢æ§ç¯ã®æµã
ã以ä¸ã®ãããªæµãã§ãæãããã°1æéç¨åº¦ã§ã»ããã¢ããã§ããã¯ãã§ãã
- ã©ãºãã¤ç¨ã®SDä½æï¼10åï¼
- ãã¼ãã¦ã§ã¢ã®ã»ããã¢ããï¼10åï¼
- Raspbianã»ããã£ã³ã°ï¼10åï¼
- TensorFlow/OpenCVã»ããã¢ããï¼10åï¼
- Object Detection Toolsã»ããã¢ããï¼10åï¼
- ã©ãºãã¤ã¸ã®æè¬ã®åã»SNSã¢ããï¼10åï¼
ã©ãºãã¤ç¨ã®SDä½æ
ãã©ãºãã¤ã®SDãä½æãã¾ããSDã®æ¸ãè¾¼ã¿ã«é¢ãã¦ã¯ãRaspberry Pi Imagerãã¨ããå ¬å¼ã®å¤§å¤ä¾¿å©ãªã½ãããããã®ã§ãã¡ãã使ãã¾ãããã使ãæ¹ã®è©³ç´°ã¯ã以ä¸è¨äºåç §ãã ããã
ããã¼ã¸ã§ã³ã¯ãRaspbian Buster with desktopãã®ã2019-09-26ããRaspberry Pi OS(32-bit)ãã®ã2020-08-20ãçã使ç¨ãã¾ããã
ãMacã§ddã³ãã³ãã使ã£ãSDæ¸ãè¾¼ã¿ãç¥ããã人ã¯ãå¤å°å¤ãã§ãã以ä¸è¨äºãåç §ä¸ããã
ãã¼ãã¦ã§ã¢ã®ã»ããã¢ãã
ãã©ãºãã¤ã¨å¨è¾ºæ©å¨ããããã¯ã¼ã¯ã以ä¸ã®ããã«ç¹ãã¾ãããã
ããã¡ãããSDã«ã¼ãã¯å ã»ã©ä½æããSDã«ã¼ããæ¿å ¥ãã¦ä¸ããã
ãæå¾ã«é»æºãç¹ãã°ãã©ãºãã¤ãèµ·åãã¾ãã
Raspbianåæè¨å®
ãRaspibianã®åæè¨å®ã§ãã
ãæåã«ãã¡ãã¥ã¼ç»é¢ãããsettingã->ãRaspberry Piã®è¨å®ããé¸æãã¾ãã
ããã¨ã¯ãæ¥æ¬ã§ã®è¨å®ãªãã以ä¸ã®ç»é¢ã®éãã®è¨å®ã§OKã§ããèµ·åä¸çºç®ã¯ãç»é¢ãè±èªã ã¨æãã¾ããããããªã«èªã¿æ¿ãã¦ä¸ããã
ãã»ããã£ã³ã°å¾ã¯åèµ·åããã¾ãããã
ãèµ·åå¾ããCtrl + Alt + tããæ¼ãã¨ã¿ã¼ããã«ï¼é»ãç»é¢ï¼ãèµ·åããã®ã§ã以ä¸ã¯ãã®ç»é¢ã§ã³ãã³ããæã¡è¾¼ãã§ãã£ã¦ãã ããã
TensorFlow/OpenCVã»ããã¢ãã
ããã£ã¼ãã©ã¼ãã³ã°ã使ã£ãç»åèªèã«å¿ è¦ãªã©ã¤ãã©ãªã®TensorFlowã¨OpenCVãã»ããã¢ãããã¾ããã»ããã¢ããã¯ã ãã¶ç°¡åã«ãªã£ãã®ã§ãããPCã«æ¯ã¹ãã¨å°ã大å¤ã§ããç¹ã«ãã«ããããã¨ããã¨æ°æéã¨ãããã£ã¦ãã¾ãã®ã§ãããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ããã®ããªã¹ã¹ã¡ã§ãã
ãä»åã¯ãæä½éå¿ è¦ãªã©ã¤ãã©ãªãç°¡åã«ã»ããã¢ããã§ããããã«ãã¹ã¯ãªãããä½æãã¾ããã以ä¸2è¡ã®ã¹ã¯ãªãããå®è¡ããã ãã§ããããã¯ã¼ã¯ã®ç¶æ³ã«ãããã¾ãã10åç¨åº¦ã§ã»ããã¢ãããã§ããã¨æãã¾ãã
$ git clone https://github.com/karaage0703/raspberry-pi-setup
$ cd raspberry-pi-setup && ./setup-ai.sh
Object Detection Toolsã»ããã¢ãã
ããã£ã¼ãã©ã¼ãã³ã°ã§ã®ç©ä½æ¤åºãæ軽ã«è©¦ããèªä½ãã¼ã«ãObject Detection Toolsããã»ããã¢ãããã¾ãããã¼ã«ã®è©³ç´°ã¯ä»¥ä¸åç §ä¸ããã
ãã¨ããããåããããå ´åã¯ã以ä¸5è¡ãã¿ã¼ããã«ã§å ¥åããã°OKã§ãã
$ cd && git clone https://github.com/karaage0703/object_detection_tools $ cd ~/object_detection_tools/models $ ./get_ssdlite_mobilenet_v2_coco_model.sh $ cd ~/object_detection_tools $ python3 scripts/object_detection.py -l='models/coco-labels-paper.txt' -m='models/ssdlite_mobilenet_v2_coco_2018_05_09/frozen_inference_graph.pb' -d='raspi_cam'
ãUSBã«ã¡ã©ã使ãå ´åã¯ãæå¾ã®ã³ãã³ãã®-d
ãªãã·ã§ã³ã-d=normal_cam
ã«ããã°åãã¨æãã¾ãã
ãTensorFlow Liteã§è»½éåã¢ãã«ã使ã£ã¦é«éåãããå ´åã¯ã以ä¸è¨äºãåç §ã«ãã¦ã¿ã¦ä¸ããã
ã©ãºãã¤ã¸ã®æè¬ã®åã»SNSã¢ãã
ããã¾ãåããããã©ãºãã¤ã«æè¬ãä¼ãã¾ãããããã£ã¼ããã¹ããã¦ãOKã§ãï¼ç±ãã®ã§ç«å·ã«æ³¨æï¼ã
ãã¤ã³ã¹ã¿ãªã©ã¸ã®SNSã¢ãããå¿ããªãããã«ãã¾ããããç§ã®å ´åã¯ã以ä¸ã®ãããªæãã§2fps以ä¸ã®é度ã§ç©ä½æ¤åºã«æåãã¾ããï¼é度ã¯ãèªèã«ããã£ãæéã®ã¿ã§ãã«ã¡ã©è¡¨ç¤ºæéã¯å«ãã§ãã¾ããï¼ã
ãã©ãºãã¤3ã®2åç¨åº¦ã®é度ã§ãã
ãã®ä»ã®ã»ããã¢ãã
SDã«ã¼ãã®ããã¯ã¢ãã
ãç°å¢ã丸ãã¨ããã¯ã¢ãããããå ´åã¯ã以ä¸è¨äºãåç §ä¸ãããæè¿ã¯ã¼ãããç°å¢æ§ç¯ãã¡ãããã¨ã®æ¹ãå¤ãã§ããã
ãã®ä»ã®ã½ããã¤ã³ã¹ãã¼ã«
ãæåã®ã¢ãããã¼ããå¿ è¦ãªã½ããã®ã»ããã¢ãããèªååãããæ¹ã¯ã以ä¸è¨äºåç §ä¸ããã
ã以ä¸ã³ãã³ããå®è¡ããã¨ãèªåã§ã¢ãããã¼ãããã¦ãå¿ è¦ãªã½ãããã¤ã³ã¹ãã¼ã«ããã¾ãã
$ cd $ git clone https://github.com/karaage0703/raspberry-pi-setup $ cd raspberry-pi-setup $ ./setup-raspbian-buster.sh
ãªã¢ã¼ãæ¥ç¶ï¼VNCï¼
ãMacæ¨æºã®ãªã¢ã¼ãæ¥ç¶ã§ã©ãºãã¤ã«ç¹ãããå ´åã¯ã以ä¸è¨äºåç §ä¸ããã
Raspberry Pi OSã64bitåãã
ã以ä¸ã³ãã³ããå®è¡ããã ãã§OKã§ããã¡ãªã¿ã«ãç§ã«ã¯ä½æã§ã¯å ¨ç¶éãåããã¾ããï¼ç¬ï¼
$ sudo sh -c "echo 'arm_64bit=1' >> /boot/config.txt"
ã確èªããã«ã¯ä»¥ä¸ã³ãã³ãå®è¡ãã¦ãã ããã
$ uname -r
ãçµæã5.4.35-v8+
ã¨æ«å°¾ãv8ã«ãªã£ã¦ããã°64bitåããã¦ãã¾ãï¼32bitã ã¨v7ã§ãï¼ããã ããã¼ãã¦ã§ã¢ã«ãã£ã¦ã¯å¯¾å¿ãã¦ããªãã®ã§æ³¨æãã¦ãã ãããCortex-A53ãæè¼ããã©ãºãã¤ã®ã¿ã¨ãªãã¾ãã詳細ã¯ä»¥ä¸ãªã³ã¯å
ãåç
§ãã ããã
RaspberryPiのCPU比較 どれが64bitで動くの?
ã64bitåã®è¨å®è©³ç´°ã«é¢ãã¦ã¯ã以ä¸ã®è¨äºãåç §ãã ããã
いまさら触ったラズピッピ4とかでできるやつ2つ - あっきぃ日誌
VS Codeã®ã¤ã³ã¹ãã¼ã«
ã以ä¸Qiitaè¨äºãåç §ãã ããã
ã¾ã¨ã
ãã©ãºãã¤4ãè²·ã£ãã®ã§ããã£ã¼ãã©ã¼ãã³ã°ç°å¢ãã»ããã¢ãããã¦ç»åèªèï¼ç©ä½æ¤åºï¼ã¾ã§ãã£ã¦ã¿ã¾ãããã©ãºãã¤4ããå ¥éãã人ãå¤ãããã¨ãããã¨ã§ãä¹ ãã¶ãã«èªåã«ãã¦ã¯ä¸å¯§ã«ã»ããã¢ããè¨äºæ¸ãããçµæ§ç²ãã¾ããããããããããã°åèã«ãã¦ã¿ã¦ä¸ããã
ãã©ãºãã¤4ã¯ãé»æºã¨ãç±ã¨ãçµæ§ãã¬ãã£ããªæ å ±ããã£ãã®ã§ããã°ããæ§åè¦ããªã¨æã£ã¦ããã®ã§ãããè¬ã®åï¼ï¼ï¼ã§çµå±éæ»ã§å ¥æãã¦æä¼ã¨ã£ã¦ã»ããã¢ãããã¦ãã¾ãã¾ããï¼ç¬ï¼ãã£ã¼ãã©ã¼ãã³ã°ã軽ãã¢ãã«ãªãããã®ã¾ã¾ã§ãããããèµ°ãããã§ããå°åã®ãã¤ã³ã³ãã¼ãã§ãã£ã¼ãã©ã¼ãã³ã°ä½¿ããªããJetson Nano1å¼·ã§ããããã©ãºãã¤ãã¾ãé¸æè¢ã«ä¸ãã£ã¦ãããã¨å¤ããªãããã ãªã¨æãã¾ããï¼Jetson Nanoããããªãå°ããã§ãããï¼ã
ãæ®éã«ä½¿ã£ã¦ãã¦ããããããã«ã©ãºãã¤3ããå¿«é©ã§ãããã©ãºãã¤4使ã£ã¦ã¾ãè²ã ä½ã£ã¦ã¿ãããªã¨ãæãã¾ããã
ããªããä»åã¯ãã£ã¼ãã©ã¼ãã³ã°ã使ã£ãç©ä½æ¤åºãè¡ãã¾ããããã£ã¼ãã©ã¼ãã³ã°ã§ãç»åã®å¤å¥ï¼ç»åãä½ããå¤æããï¼ã®å¦ç¿ããæ¨è«ã¾ã§ãã£ã¦ã¿ããã¨ããæ¹ã¯ãæænoteã§ãã¥ã¼ããªã¢ã«å ¬éãã¦ãã¾ãã®ã§ããããããã°ãã¡ããã©ããã
ãAmazonã§ã®è³¼å ¥å
æ¸ç±ã®å®£ä¼ãããããå çã®ã¨ã«ãã楽ããAIèªä½æ室ã
ãAIã®åå¿è åãæ¬ãããããå çã®ã¨ã«ãã楽ããAIèªä½æ室ããå·çãã¾ããã
ãæç³»ã§AIç´ äººã®ç§ã®å¦»ããå®è·µã§ãã¦ç解ãæ·±ãããããããªãåå¦è åãã®å 容ã«ãªã£ã¦ãã¾ããRaspberry Piãç¨ããã¨ãã¸ã³ã³ãã¥ã¼ãã£ã³ã°ã«é¢ãã¦ããã¾ãã¾ã1ç« è§£èª¬ãã¦ãã¾ãã以ä¸ã«ç´¹ä»è¨äºãæ¸ãã¦ãã¾ãã®ã§ãèå³ããæ¹ã¯æ¯éããããã ããã
é¢é£è¨äº
å¤æ´å±¥æ´
- 2024/02/18 ã©ãºãã¤5ã«å¯¾å¿
- 2022/04/03 ææ°Raspberry Pi OSã§ã®ç°å¢æ§ç¯ã«é¢ãã¦è¿½è¨
- 2020/12/20 AIæ¸ç±ã®å·çã«é¢ãã¦è¿½è¨
- 2020/10/30 Raspberry Pi OS 2020-08-20çã§ã®åä½ç¢ºèª
- 2020/09/12 VS Codeã®ã»ããã¢ããã«é¢ãã¦è¿½è¨
- 2020/06/25 微修æ£ã»èª¤è¨è¨æ£
- 2020/06/04 Raspberry Pi 4ã®è³¼å ¥å ã«é¢ãã¦ä¿®æ£
- 2020/05/12 Raspbian 64bitåã«é¢ãã¦è¿½è¨
- 2020/04/16 SDæ¸ãè¾¼ã¿ã«é¢ãã¦ãRaspberry Pi Imagerãã使ç¨ããæ¸ãè¾¼ã¿æ¹æ³ã«ä¿®æ£
- 2020/04/15 TensorFlow Liteã«é¢ããè¨äºã¸ã®ãªã³ã¯è¿½å
- 2020/02/07 é¢é£è¨äºè¿½å
- 2020/01/26 ååã®ãªã³ã¯åããä¿®æ£ã»è¿½å
- 2020/01/24 ãªã¢ã¼ãæ¥ç¶ã«é¢ãã¦è¨äºã追å