Skip to content

Kazuhito00/Person-Detection-using-RaspberryPi-CPU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[Japanese/English]

Person-Detection-using-RaspberryPi-CPU

Raspberry Pi 4のCPU動作を想定した人検出モデルとデモスクリプトです。

Demo.mp4

PINTOさんの「TensorflowLite-bin」を使用し4スレッド動作時で45~60ms程度で動作します ※1スレッドは75ms前後
ノートPC等でも動作しますが、精度が必要であれば本リポジトリ以外の物体検出モデルをおすすめします。
また、ノートPC使用時は「model.onnx」のほうが高速なケースが多いです。※Core i7-8750Hで10ms前後

Requirement

opencv-python 4.5.3.56 or later
tensorflow 2.8.0 or later ※TensorflowLite-binの使用を推奨
onnxruntime 1.9.0 or later ※model.onnxを使用する場合のみ

Demo

デモの実行方法は以下です。

python demo.py
  • --device
    カメラデバイス番号の指定
    デフォルト:0
  • --movie
    動画ファイルの指定 ※指定時はカメラデバイスより優先
    デフォルト:指定なし
  • --width
    カメラキャプチャ時の横幅
    デフォルト:640
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:360
  • --model
    ロードするモデルの格納パス
    デフォルト:model/model.tflite
  • --score_th
    検出閾値
    デフォルト:0.4
  • --nms_th
    NMSの閾値
    デフォルト:0.5
  • --num_threads
    使用スレッド数 ※TensorFlow-Lite使用時のみ有効
    デフォルト:None

Demo(ROS2)

ROS2向けのデモです。

ターミナル1

ros2 run v4l2_camera v4l2_camera_node

ターミナル2

python3 ./demo_ros2.py

Application Example

Reference

Author

高橋かずひと(https://twitter.com/KzhtTkhs)

License

Person-Detection-using-RaspberryPi-CPU is under Apache 2.0 License.

License(Movie)

サンプル動画はNHKクリエイティブ・ライブラリーイギリス・ロンドン リージェント・ストリートを使用しています。

About

Raspberry Pi 4のCPU動作を想定した人検出モデルとデモスクリプト

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages