瀏覽作者:

e96031413

NVIDIA Jetson TX2學習筆記(六):建立外網可傳輸的FTP伺服器

0.查詢TX2的內網IP和實體IP

內網IP:

TX2的內網IP位址可以先在TX2中的終端機介面輸入ifconfig查詢,出現192.168.X.X的就是內網IP位址

實體IP:

實體IP則是可以透過這個網站查詢,將它紀錄下來,在第8步驟登入時會使用到

1.設定DMZ

IP位址是TX2在內網當中的IP位址(每個人的電腦都不太一樣)

2.登入無線AP後台後,新增Port Forwarding設定如下圖:

裡面的IP位址是TX2在內網當中的IP位址(每個人的電腦都不太一樣)

3.如果之前曾在Ubuntu上安裝過vsftpd套件,請先移除;如果沒有,跳到第三步驟。

移除所有安裝過的vsftpd檔案
sudo apt-get autoremove vsftpd --purge

4.安裝FTP套件

$ sudo apt update 
$ sudo apt install vsftpd

5.驗證vsftpd是否安裝成功並且正常啟動

$ systemctl status vsftpd
$ netstat -tupln | grep ftp

6.修改vsftpd.conf:

$ sudo nano /etc/vsftpd.conf

將以下的內容解除註解(刪掉#符號)

# Allow anonymous FTP? (Disabled by default).
anonymous_enable=YES

# Uncomment this to enable any form of FTP write command.
write_enable=YES

# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
anon_upload_enable=YES

7.重啟vsftpd服務

$ sudo systemctl restart vsftpd

8.登入:

實體IP是第一步驟查詢到的IP, 可以透過這個網站查詢

方案1
:使用Filezilla,輸入 ftp xxx.xxx.xxx.xxx (xxx為實體的IP), 再輸入Linux的使用者帳號及密碼即可登入。

方案2:Windows CMD, ftp xxx.xxx.xxx.xxx (xxx為實體的IP), 再輸入Linux的使用者帳號及密碼即可登入

參考資料

https://go-linux.blogspot.com/2019/02/ubuntu-18042anonymous-ftp-server.html

Raspberry Pi學習筆記(二十八):在Pi 3B+上安裝OpenVINO環境(搭配第一代Intel® Movidius™ NCS運算棒)

在五月份的時候,曾經寫了一篇Raspberry Pi學習筆記(十三):使用 第一代Intel® Movidius™ NCS運算棒,當時所使用的是 NCSDK,不過目前NCSDK較少人使用,加上這兩天看到OpenVINO-YoloV3,能夠讓YOLOv3透過NCS運算棒在Pi上執行,因此決定來使用OpenVINO。

###原本以為OpenVINO只支援二代的NCS沒想到今天發現一代也支援。

參考官方教學

Install OpenVINO™ toolkit for Raspbian* OS – OpenVINO ToolkitNOTE: These steps apply to 32-bit Raspbian* OS, which is an official OS for Raspberry Pi* boards. These steps have been…docs.openvinotoolkit.org

建立資料夾

mkdir openvino
cd openvino

下載並解壓縮VINO

wget https://download.01.org/opencv/2019/openvinotoolkit/R3/l_openvino_toolkit_runtime_raspbian_p_2019.3.334.tgzsudo mkdir -p /opt/intel/openvinosudo tar -xf l_openvino_toolkit_runtime_raspbian_p_2019.3.334.tgz --strip 1 -C /opt/intel/openvino

安裝CMake

sudo apt install cmake

設定環境變數

source /opt/intel/openvino/bin/setupvars.sh
echo "source /opt/intel/openvino/bin/setupvars.sh" >> ~/.bashrc
[setupvars.sh] OpenVINO environment initialized

新增USB規則

sudo usermod -a -G users "$(whoami)"source /opt/intel/openvino/bin/setupvars.shsh /opt/intel/openvino/install_dependencies/install_NCS_udev_rules.sh#插入運算棒

編譯並且執行範例

mkdir build && cd build

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=armv7-a" /opt/intel/openvino/deployment_tools/inference_engine/samples

make -j2 object_detection_sample_ssd

#下載訓練好的模型
wget --no-check-certificate https://download.01.org/opencv/2019/open_model_zoo/R1/models_bin/face-detection-adas-0001/FP16/face-detection-adas-0001.bin

wget --no-check-certificate https://download.01.org/opencv/2019/open_model_zoo/R1/models_bin/face-detection-adas-0001/FP16/face-detection-adas-0001.xml

#執行範例測試<path to image記得自己放一張人臉圖片進來>
./armv7l/Release/object_detection_sample_ssd -m face-detection-adas-0001.xml -d MYRIAD -i <path_to_image>

Raspberry Pi學習筆記(二十七):在Pi上執行YOLOv3

#待補:在Pi上搭配NCS I執行YOLOv3,本文目前所出現的方式是YOLOv1版本,且必須將.weights or .backup檔案轉換成.caffemodel 才能正常執行,正在找尋NCS I能直接執行.weights or .backup檔案的方法

本文將提供三個在Pi上執行YOLOv3的方式

  1. AlexeyAB
  2. darknet-nnpack
  3. Intel NCS I

AlexeyAB版 : 比起官方pjreddie版快上不少,也修正不少錯誤(因此本文就不附上官方pjreddie版的教學了。),但是執行速度還是很慢,YOLOv3-tiny花費約 30秒。可以執行所有YOLO模型。

下載&編譯

git clone https://github.com/AlexeyAB/darknet
cd darknet
make

下載Pre-trained Weights

#YOLOv3 
wget https://pjreddie.com/media/files/yolov3.weights#YOLOv2
wget https://pjreddie.com/media/files/yolov2.weights#Tiny YOLOv3
wget https://pjreddie.com/media/files/yolov3-tiny.weights

執行辨識

#YOLOv3
./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg#YOLOv2
./darknet detect cfg/yolov2.cfg yolov2.weights data/dog.jpg#Tiny YOLOv3
./darknet detect cfg/yolov3-tiny.cfg yolov3-tiny.weights data/dog.jpg

darknet-nnpack : 針對Arm處理器進行優化,使用YOLOv3-tiny模型進行辨識只要 1~1.2秒左右,而且不用任何額外的GPU。不能執行YOLOv3,只能執行tiny版。

安裝

sudo apt install ninja-build
sudo apt install clang
sudo pip3 install --upgrade git+https://github.com/Maratyszcza/PeachPy
sudo pip3 install --upgrade git+https://github.com/Maratyszcza/confu

編譯NNPACK-darknet

git clone https://github.com/thomaspark-pkj/NNPACK-darknet.gitconfu setup
python ./configure.py
ninja
sudo cp -a lib/* /usr/lib/
sudo cp include/nnpack.h /usr/include/
sudo cp deps/pthreadpool/include/pthreadpool.h /usr/include/#在進行ninja這個步驟的時候盡量不要讓Pi執行其他任務,避免當機,如果當機重開後再進行ninja即可

darknet-nnpack

darknet-nnpack是進行辨識的主要程式

git clone https://github.com/thomaspark-pkj/darknet-nnpack.git
cd darknet-nnpack
make

當完成make編譯之後,我們可以透過預先訓練好的weights檔案來進行物件偵測,此版本比起AlexeyAB快上30倍(以YOLOv3-tiny為例)


如果要結合Movidius NCS I該怎麼做呢?

YOLOv1 with Movidius NCS I
[RPi]Deep Learning with Movidius NCS and Raspberry Pi 3以下內容參考:Deep Learning with Movidius NCS and Raspberry Pi3B+ (pt.3) Install and Run on the Pimedium.com


參考資料:

在 RaspberryPi 上跑 YOLO继续摧残 RaspberryPi 系列…… 反正 Telegram 上群友已经看不下去了:”放过它吧…… 它只是个树莓派啊……”haoyu.love