Help us understand the problem. What is going on with this article?

Jetson nanoでyolov3,yolov3-tinyを動かすメモ

kerasのインストール

sudo apt install libatlas-base-dev gfortran
sudo pip3 install scipy
sudo pip3 keras

keras-yolo3リポジトリ

git clone https://github.com/qqwweee/keras-yolo3

weights

YOLOv3

wget https://pjreddie.com/media/files/yolov3.weights

YOLOv3-tiny

wget https://pjreddie.com/media/files/yolov3-tiny.weights

weightsのコンバート

YOLOv3

python3 convert.py yolov3.cfg yolov3.weights model_data/yolo.h5

YOLOv3-tiny

python3 convert.py yolov3-tiny.cfg yolov3-tiny.weights model_data/yolo-tiny.h5

カメラ入力部分の修正※Raspberry Pi Camera Moduleの場合

yolo.py
def detect_video(yolo, video_path, output_path=""):
    import cv2
    GST_STR = 'nvarguscamerasrc \
    ! video/x-raw(memory:NVMM), width=3280, height=2464, format=(string)NV12, framerate=(fraction)30/1 \
    ! nvvidconv ! video/x-raw, width=(int)416, height=(int)416, format=(string)BGRx \
    ! videoconvert \
    ! appsink'
    WINDOW_NAME = 'Camera Test'
    vid = cv2.VideoCapture(GST_STR, cv2.CAP_GSTREAMER)
#    if video_path.isdigit():
#        video_path = int(video_path)
#    vid = cv2.VideoCapture(video_path)
    if not vid.isOpened():

※USBカメラの場合はvid = cv2.VideoCapture(0)

parser文字列の修正(3ヶ所)

yolo_video.py
#    '--model', type=str,
    '--model_path', type=str,

#    '--anchors', type=str,
    '--anchors_path', type=str,

#    '--classes', type=str,
    '--classes_path', type=str,

実行 ※GUI環境

YOLOv3 FPS=1 ※重くてvideo出力がハングアップ状態になることがある

python3 yolo_video.py

YOLOv3-tiny FPS=4

python3 yolo_video.py --model_path model_data/yolo-tiny.h5 --anchors_path model_data/tiny_yolo_anchors.txt

その他

「importerror: The _imagingft C module is no installed」の対処

sudo apt-get install libfreetype6
sudo apt-get install libfreetype6-dev
sudo pip3 uninstall Pillow
sudo pip3 install Pillow
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした