LoginSignup
2
7

More than 5 years have passed since last update.

物体検出Yoloを動かす♬~動画検出に挑戦-OpenCVでハマってる編~

Last updated at Posted at 2018-04-29

今回は、当然の発展として動画から物体検出に挑戦してみましたが、。。
まだまだ先は長そうです。
。。。が、ここまでのハマってる状況をまとめておこうと思います。

もう峠の手前だと思っていますが、先は見えません??
この話もみなさんはなんか簡単に記載していて、。。たぶんLinuxにOpenCVが簡単に入ったか、使っていたんだと思います。

ということで、ほぼOpenCVに悪戦苦闘で、ここで見直すことは重要だと思っています。
※そもそもYolo止めて、SSDでも。。。とか、Tensorflow版でWindowsでも。。
※その場合もやったことが多すぎて忘れそうなので備忘録という位置づけです

もう一つ、今回の一連の流れの中ではLinuxでGPUがインストールできていません^^;

【参考】みんなうまくいってる編
・demura.net YOLO V3に変身!?
@Kumapapa2012 2017年04月27日に更新 画像の認識 〜 Yolo
darknetでYOLOv3を動かしてみた。

今回やったこと。。。OpenCVのインストール

成功している人とあまり変わらないはずだけど、。。基本は参考のサイトみたいだけど、案外そのままにはやっていない。。
(0)Ubuntuのパッケージを最新にする
(1)Makefileの書き換え。。。OK
(2)requirementをインストール。。。たぶんOK
(3)OpenCV3.3.0のダウンロードとunzip展開。。。OK
(4)OpenCV3.3のインストール
(5)そして使ってみると。。。
【参考】
Ubuntu 16.04 or 15.10 OpenCV 3.1 Installation Guide

(0)Ubuntuのパッケージを最新にする。。。OK

Linuxはいつも作業前にこれやるんですね。。。

sudo apt-get update
sudo apt-get upgrade

(1)Makefileの書き換え。。。OK

OPENCV=1だけしか変えられない。。。ここは今回の主題でないのでさらっと。。
でも、
そういえば、ARCH= -gencode arch=compute_61,code=[sm_61,compute_61]
というのがYOLO V3に変身!?に記載されていたので、実は以下を追記したのでした。
-gencode arch=compute_61,code=[sm_61,compute_61]
因みに、CompatibilityからGPU入っていたら、これみたいですね。

(2)requirementをインストールと準備。。。たぶんOK

いろいろ入用のものは、動かざることバグの如し猫ゆえに。。。
Ubuntu 16.04にOpenCV 3.1をインストールする手順の最初のとおり

sudo apt-get install build-essential cmake git

そしてrequirementは、本当はこれコピペしてそのまま入れているんだけど、よく見るとみんな記載内容が違うので、きっと問題があったら、ここへ戻ってやり直し??
以下はUbuntu 16.04にOpenCV 3.1をインストールする手順のもの

sudo apt-get install ffmpeg libopencv-dev libgtk-3-dev python-numpy python3-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff5-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libv4l-dev libtbb-dev qtbase5-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip

以下はUbuntu 16.04 or 15.10 OpenCV 3.1 Installation Guideより

sudo apt-get install --assume-yes libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff5-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip

【参考】
Ubuntu 16.04にOpenCV 3.1をインストールする手順
Linux - OpenCV VideoCaptureが動作しないの最終回答より
Ubuntu14.04にpython用にOpenCV3.0.0をインストール
上記の「Ubuntu 16.04 or 15.10 OpenCV 3.1 Installation Guide」や「 Ubuntu OpenCVをインストールする手順

(3)OpenCV3.3.0のダウンロードとunzip展開。。。OK

今回インストールするマシンの環境は

MuAuan@DESKTOP-S5LF5OV:/mnt/c/Users/user/darknet$  cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"

ということで、今のディストリビューションは、OpenCV 3.3が安定バージョンみたいで、以下のようにtar.gzをダウンロードして展開しました。以下は、トライフィールズ Ubuntu OpenCVをインストールする手順より引用です。

# OpenCV3.3をダウンロード
$ wget https://github.com/opencv/opencv/archive/3.3.0.tar.gz
# 解凍
$ tar zxvf 3.3.0.tar.gz
# カレントディレクトリの移動
$ cd opencv-3.3.0

ほかに、以下のようにgitするのがよさそうです。

sudo apt-get install git
cd ; mkdir tmp ; cd tmp
git clone https://github.com/Itseez/opencv
git clone https://github.com/Itseez/opencv_contrib.git

【参考】
まっさらなUbuntu16.04LTSにOpenCV3.1とopencv_contribをインストール

(4)OpenCV3.3のインストール

インストールの仕方はつまり大きく以下の二種類ですが、ウワンの環境だとmakeが途中で止まってしまって、checkinstallの方法だけしかできませんでした。
【参考】
トライフィールズ Ubuntu OpenCVをインストールする手順
初めてのOpenCV開発 ― CMakeを使ったOpenCVのカスタマイズ【OpenCV 3.1.0】

①buildの作成

mkdir build
cd build/

実は失敗するたびにここまで戻って繰り返しました。。。

②コンパイル

これもなんとなくすごく種類あります^^;
で、基本的なことは上記のUbuntu 16.04 or 15.10 OpenCV 3.1 Installation Guide
のものがよさそう。

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..

Ubuntu14.04にpython用にOpenCV3.0.0をインストールには「ubuntuでは、WITH_FFMPEG=OFFを忘れずに。」とあるが、これは間違いらしいここはON!

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D WITH_FFMPEG=OFF -D BUILD_opencv_python2=ON ..

実は上記のcmakeは途中でエラーが出て止まってしまいます。
そこで、以下のトライフィールズ Ubuntu OpenCVをインストールする手順
方法で実施しました。これは、Ubuntu 16.04 or 15.10 OpenCV 3.1 Installation Guideで、
This will create the OpenCV package that has a modern install/uninstall option.
と紹介されています。

sudo apt-get install checkinstall
sudo apt-get install ccache

ccacheは、「コンパイル時のデータをキャッシュして2回目以降を高速化するためにccacheを導入します。」だそうです。

そして、肝心のcmakeの中身は以下のようにしました。
それぞれの意味を理解するためには、初めてのOpenCV開発 ― CMakeを使ったOpenCVのカスタマイズ【OpenCV 3.1.0】が参考になります。
そして、ここも肝心なことですが、WITH_FFMPEG=ONです。

#!/bin/bash

SOURCE_DIR="echo $(cd $(dirname $0);pwd)"
BUILD_DIR=${SOURCE_DIR}/build
GENERATOR_NAME="Unix Makefiles"

mkdir build
cd build

cmake \
-G "${GENERATOR_NAME}" \
--build ${BUILD_DIR} \
-D BUILD_CUDA_STUBS=OFF \
-D BUILD_DOCS=OFF \
-D BUILD_EXAMPLES=OFF \
-D BUILD_JASPER=OFF \
-D BUILD_JPEG=ON \
-D BUILD_OPENEXR=OFF \
-D BUILD_PACKAGE=ON \
-D BUILD_PERF_TESTS=OFF \
-D BUILD_PNG=ON \
-D BUILD_SHARED_LIBS=ON \
-D BUILD_TBB=OFF \
-D BUILD_TESTS=OFF \
-D BUILD_TIFF=OFF \
-D BUILD_WITH_DEBUG_INFO=ON \
-D BUILD_ZLIB=OFF \
-D BUILD_WEBP=OFF \
-D BUILD_opencv_apps=ON \
-D BUILD_opencv_calib3d=ON \
-D BUILD_opencv_core=ON \
-D BUILD_opencv_cudaarithm=OFF \
-D BUILD_opencv_cudabgsegm=OFF \
-D BUILD_opencv_cudacodec=OFF \
-D BUILD_opencv_cudafeatures2d=OFF \
-D BUILD_opencv_cudafilters=OFF \
-D BUILD_opencv_cudaimgproc=OFF \
-D BUILD_opencv_cudalegacy=OFF \
-D BUILD_opencv_cudaobjdetect=OFF \
-D BUILD_opencv_cudaoptflow=OFF \
-D BUILD_opencv_cudastereo=OFF \
-D BUILD_opencv_cudawarping=OFF \
-D BUILD_opencv_cudev=OFF \
-D BUILD_opencv_features2d=ON \
-D BUILD_opencv_flann=ON \
-D BUILD_opencv_highgui=ON \
-D BUILD_opencv_imgcodecs=ON \
-D BUILD_opencv_imgproc=ON \
-D BUILD_opencv_java=OFF \
-D BUILD_opencv_ml=ON \
-D BUILD_opencv_objdetect=ON \
-D BUILD_opencv_photo=ON \
-D BUILD_opencv_python2=OFF \
-D BUILD_opencv_python3=ON \
-D BUILD_opencv_shape=ON \
-D BUILD_opencv_stitching=ON \
-D BUILD_opencv_superres=ON \
-D BUILD_opencv_ts=ON \
-D BUILD_opencv_video=ON \
-D BUILD_opencv_videoio=ON \
-D BUILD_opencv_videostab=ON \
-D BUILD_opencv_viz=OFF \
-D BUILD_opencv_world=OFF \
-D CMAKE_BUILD_TYPE=RELEASE \
-D WITH_1394=ON \
-D WITH_CUBLAS=OFF \
-D WITH_CUDA=OFF \
-D WITH_CUFFT=OFF \
-D WITH_EIGEN=ON \
-D WITH_FFMPEG=ON \
-D WITH_VFW=ON \
-D WITH_DSHOW=ON \
-D WITH_MSMF=ON \
-D WITH_GDAL=OFF \
-D WITH_GPHOTO2=OFF \
-D WITH_GIGEAPI=ON \
-D WITH_GSTREAMER=ON \
-D WITH_GSTREAMER_0_10=ON \
-D WITH_GTK=ON \
-D WITH_INTELPERC=OFF \
-D WITH_IPP=ON \
-D WITH_IPP_A=OFF \
-D WITH_JASPER=OFF \
-D WITH_JPEG=ON \
-D WITH_LIBV4L=OFF \
-D WITH_OPENCL=ON \
-D WITH_OPENCLAMDBLAS=OFF \
-D WITH_OPENCLAMDFFT=OFF \
-D WITH_OPENCL_SVM=OFF \
-D WITH_OPENEXR=OFF \
-D WITH_OPENGL=ON \
-D WITH_OPENMP=OFF \
-D WITH_OPENNI=OFF \
-D WITH_PTHREADS_PF=OFF \
-D WITH_PVAPI=ON \
-D WITH_QT=ON \
-D WITH_WIN32UI=ON \
-D WITH_TBB=ON \
-D WITH_TIFF=ON \
-D WITH_UNICAP=OFF \
-D WITH_V4L=OFF \
-D WITH_VTK=OFF \
-D WITH_WEBP=ON \
-D WITH_XIMEA=OFF \
-D WITH_XINE=OFF \
${SOURCE_DIR}

さらに進んだbatファイルがここにありますが、ちょっと。。。です。
そして、上記shellを動かして、makefileを作成します。

$ sh opencv3.3_build-ubuntu16.04.sh

次に以下のとおり、makeします。その前に

$ grep -c ^processor /proc/cpuinfo
8

なので、並列数8個(プロセッサー数8個、物理1個、コア4個)でした。

make -j8

しかし、これだと途中(書き込み権限)で止まりました。

sudo make -j8

ここからは、トライフィールズ Ubuntu OpenCVをインストールする手順のとおりですが、英語でした。

$ sudo checkinstall

checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran
           This software is released under the GNU GPL.

The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs?  [y]: y

Preparing package documentation...OK

Please write a description for the package.
End your description with an empty line or EOF.
>> opencv3.3
>>
。。。

ということで、まんま最後までインストールできて、締めは以下のコマンドです。

sudo ldconfig

さてさて動くかな。。普通動くよな。。

(5)そして使ってみると。。。

だいたい簡単なC++プログラムが動かない。。

/tmp/ccL63bce.o: In function `main':
sample.cpp:(.text+0x8a): undefined reference to `cv::namedWindow(cv::String const&, int)'
sample.cpp:(.text+0xdc): undefined reference to `cv::imshow(cv::String const&, cv::_InputArray const&)'
collect2: error: ld returned 1 exit status

また、

$ ./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights data/doga_nogisaka.mp4
./darknet: error while loading shared libraries: libopencv_imgcodecs.so.3.3: cannot enable executable stack as shared object requires: Invalid argument

とエラーがでます。

しかし、Python3.4 error - Cannot enable executable stack as shared object requires: Invalid argumentのとおり、

sudo execstack -c /usr/local/lib/*opencv*.so*

とすると、上の事象もdetectorのエラーも解消します。
しかし、またまたエラーが出ます。

Loading weights from yolov3.weights...Done!
video file: data/doga_nogisaka.mp4
QXcbConnection: Could not connect to display :0
Aborted (core dumped)

このエラー解消は。。。出来ませんでした
が、。。。QXcbConnection: Could not connect to display #14376 が同事象なのでつらつら読んでいると以下のコマンドでとりあえず解消するらしい。。。オフスクリーン^^;

export QT_QPA_PLATFORM=offscreen

そして、標準出力に。。。!!!

$ ./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights data/doga_nogisaka.mp4
Demo
layer     filters    size              input                output
    0 conv     32  3 x 3 / 1   416 x 416 x   3   ->   416 x 416 x  32  0.299 BFLOPs
    1 conv     64  3 x 3 / 2   416 x 416 x  32   ->   208 x 208 x  64  1.595 BFLOPs
    2 conv     32  1 x 1 / 1   208 x 208 x  64   ->   208 x 208 x  32  0.177 BFLOPs
    3 conv     64  3 x 3 / 1   208 x 208 x  32   ->   208 x 208 x  64  1.595 BFLOPs
    4 res    1                 208 x 208 x  64   ->   208 x 208 x  64
    5 conv    128  3 x 3 / 2   208 x 208 x  64   ->   104 x 104 x 128  1.595 BFLOPs
    6 conv     64  1 x 1 / 1   104 x 104 x 128   ->   104 x 104 x  64  0.177 BFLOPs
    7 conv    128  3 x 3 / 1   104 x 104 x  64   ->   104 x 104 x 128  1.595 BFLOPs
    8 res    5                 104 x 104 x 128   ->   104 x 104 x 128
    9 conv     64  1 x 1 / 1   104 x 104 x 128   ->   104 x 104 x  64  0.177 BFLOPs
   10 conv    128  3 x 3 / 1   104 x 104 x  64   ->   104 x 104 x 128  1.595 BFLOPs
   11 res    8                 104 x 104 x 128   ->   104 x 104 x 128
   12 conv    256  3 x 3 / 2   104 x 104 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   13 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   14 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   15 res   12                  52 x  52 x 256   ->    52 x  52 x 256
   16 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   17 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   18 res   15                  52 x  52 x 256   ->    52 x  52 x 256
   19 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   20 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   21 res   18                  52 x  52 x 256   ->    52 x  52 x 256
   22 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   23 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   24 res   21                  52 x  52 x 256   ->    52 x  52 x 256
   25 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   26 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   27 res   24                  52 x  52 x 256   ->    52 x  52 x 256
   28 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   29 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   30 res   27                  52 x  52 x 256   ->    52 x  52 x 256
   31 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   32 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   33 res   30                  52 x  52 x 256   ->    52 x  52 x 256
   34 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   35 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   36 res   33                  52 x  52 x 256   ->    52 x  52 x 256
   37 conv    512  3 x 3 / 2    52 x  52 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   38 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   39 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   40 res   37                  26 x  26 x 512   ->    26 x  26 x 512
   41 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   42 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   43 res   40                  26 x  26 x 512   ->    26 x  26 x 512
   44 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   45 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   46 res   43                  26 x  26 x 512   ->    26 x  26 x 512
   47 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   48 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   49 res   46                  26 x  26 x 512   ->    26 x  26 x 512
   50 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   51 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   52 res   49                  26 x  26 x 512   ->    26 x  26 x 512
   53 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   54 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   55 res   52                  26 x  26 x 512   ->    26 x  26 x 512
   56 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   57 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   58 res   55                  26 x  26 x 512   ->    26 x  26 x 512
   59 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   60 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   61 res   58                  26 x  26 x 512   ->    26 x  26 x 512
   62 conv   1024  3 x 3 / 2    26 x  26 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   63 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   64 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   65 res   62                  13 x  13 x1024   ->    13 x  13 x1024
   66 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   67 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   68 res   65                  13 x  13 x1024   ->    13 x  13 x1024
   69 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   70 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   71 res   68                  13 x  13 x1024   ->    13 x  13 x1024
   72 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   73 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   74 res   71                  13 x  13 x1024   ->    13 x  13 x1024
   75 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   76 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   77 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   78 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   79 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   80 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   81 conv    255  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 255  0.088 BFLOPs
   82 detection
   83 route  79
   84 conv    256  1 x 1 / 1    13 x  13 x 512   ->    13 x  13 x 256  0.044 BFLOPs
   85 upsample            2x    13 x  13 x 256   ->    26 x  26 x 256
   86 route  85 61
   87 conv    256  1 x 1 / 1    26 x  26 x 768   ->    26 x  26 x 256  0.266 BFLOPs
   88 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   89 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   90 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   91 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   92 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   93 conv    255  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 255  0.177 BFLOPs
   94 detection
   95 route  91
   96 conv    128  1 x 1 / 1    26 x  26 x 256   ->    26 x  26 x 128  0.044 BFLOPs
   97 upsample            2x    26 x  26 x 128   ->    52 x  52 x 128
   98 route  97 36
   99 conv    128  1 x 1 / 1    52 x  52 x 384   ->    52 x  52 x 128  0.266 BFLOPs
  100 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
  101 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
  102 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
  103 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
  104 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
  105 conv    255  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 255  0.353 BFLOPs
  106 detection
Loading weights from yolov3.weights...Done!
video file: data/doga_nogisaka.mp4
QFontDatabase: Cannot find font directory /usr/lib/x86_64-linux-gnu/fonts - is Qt installed correctly?
QFontDatabase: Cannot find font directory /usr/lib/x86_64-linux-gnu/fonts - is Qt installed correctly?
QFontDatabase: Cannot find font directory /usr/lib/x86_64-linux-gnu/fonts - is Qt installed correctly?
QFontDatabase: Cannot find font directory /usr/lib/x86_64-linux-gnu/fonts - is Qt installed correctly?
This plugin does not support propagateSizeHints()
This plugin does not support propagateSizeHints()

FPS:2898.6
Objects:

FPS:0.1
Objects:

FPS:0.1
Objects:

person: 99%

FPS:0.1
Objects:

person: 99%

FPS:0.1
Objects:

person: 99%

FPS:0.1
Objects:

person: 99%

FPS:0.1
Objects:

person: 99%

FPS:0.1
Objects:

person: 99%

FPS:0.1
Objects:

person: 99%

FPS:0.1
Objects:

person: 99%

FPS:0.1
Objects:

person: 99%

FPS:0.1
Objects:

person: 99%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%

FPS:0.1
Objects:

person: 100%
^C
MuAuan@DESKTOP-S5LF5OV:/mnt/c/Users/user/darknet$ ./darknet detector demo cfg/coco.data cfg/yolov2.cfg yolov2.weights da
ta/doga_nogisaka.mp4
Demo
layer     filters    size              input                output
    0 conv     32  3 x 3 / 1   416 x 416 x   3   ->   416 x 416 x  32  0.299 BFLOPs
    1 max          2 x 2 / 2   416 x 416 x  32   ->   208 x 208 x  32
    2 conv     64  3 x 3 / 1   208 x 208 x  32   ->   208 x 208 x  64  1.595 BFLOPs
    3 max          2 x 2 / 2   208 x 208 x  64   ->   104 x 104 x  64
    4 conv    128  3 x 3 / 1   104 x 104 x  64   ->   104 x 104 x 128  1.595 BFLOPs
    5 conv     64  1 x 1 / 1   104 x 104 x 128   ->   104 x 104 x  64  0.177 BFLOPs
    6 conv    128  3 x 3 / 1   104 x 104 x  64   ->   104 x 104 x 128  1.595 BFLOPs
    7 max          2 x 2 / 2   104 x 104 x 128   ->    52 x  52 x 128
    8 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
    9 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   10 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   11 max          2 x 2 / 2    52 x  52 x 256   ->    26 x  26 x 256
   12 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   13 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   14 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   15 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   16 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   17 max          2 x 2 / 2    26 x  26 x 512   ->    13 x  13 x 512
   18 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   19 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   20 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   21 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   22 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   23 conv   1024  3 x 3 / 1    13 x  13 x1024   ->    13 x  13 x1024  3.190 BFLOPs
   24 conv   1024  3 x 3 / 1    13 x  13 x1024   ->    13 x  13 x1024  3.190 BFLOPs
   25 route  16
   26 conv     64  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x  64  0.044 BFLOPs
   27 reorg              / 2    26 x  26 x  64   ->    13 x  13 x 256
   28 route  27 24
   29 conv   1024  3 x 3 / 1    13 x  13 x1280   ->    13 x  13 x1024  3.987 BFLOPs
   30 conv    425  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 425  0.147 BFLOPs
   31 detection
mask_scale: Using default '1.000000'
Loading weights from yolov2.weights...Done!
video file: data/doga_nogisaka.mp4
QFontDatabase: Cannot find font directory /usr/lib/x86_64-linux-gnu/fonts - is Qt installed correctly?
QFontDatabase: Cannot find font directory /usr/lib/x86_64-linux-gnu/fonts - is Qt installed correctly?
QFontDatabase: Cannot find font directory /usr/lib/x86_64-linux-gnu/fonts - is Qt installed correctly?
QFontDatabase: Cannot find font directory /usr/lib/x86_64-linux-gnu/fonts - is Qt installed correctly?
This plugin does not support propagateSizeHints()
This plugin does not support propagateSizeHints()

FPS:1104.9
Objects:

FPS:0.2
Objects:

FPS:0.2
Objects:

person: 91%

FPS:0.2
Objects:

person: 91%

FPS:0.2
Objects:

person: 91%

FPS:0.2
Objects:

person: 91%

FPS:0.2
Objects:

person: 91%

FPS:0.2
Objects:

person: 91%

FPS:0.2
Objects:

person: 91%

FPS:0.2
Objects:

person: 91%

FPS:0.2
Objects:

person: 91%

FPS:0.2
Objects:

person: 92%

FPS:0.2
Objects:

person: 92%

FPS:0.2
Objects:

person: 92%

FPS:0.2
Objects:

person: 92%

FPS:0.2
Objects:

person: 92%

FPS:0.2
Objects:

person: 92%

FPS:0.2
Objects:

person: 92%

FPS:0.2
Objects:

person: 92%

FPS:0.2
Objects:

person: 92%

FPS:0.2
Objects:

person: 92%

FPS:0.2
Objects:

person: 92%

FPS:0.2
Objects:

person: 92%

FPS:0.2
Objects:

person: 92%

ということで、動きました!

。。。スクリーン無しの物体検出だけど(笑)

GPU使えないとだし、画面に動画を表示したい。。
>>>QTのインストールとCUDAのインストールからかな??

希望は以下の記事かな??
>>ここまで完成したら、パソコンを一応再起動します。そしたら、完了です。

そして、マシン変えよう。。。

2
7
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
7