Coder Social home page Coder Social logo

yas-sim / person-detect-reidentification Goto Github PK

View Code? Open in Web Editor NEW
34.0 2.0 6.0 34.11 MB

Person or face detection and matching from multiple image inputs using Intel OpenVINO toolkit

License: Apache License 2.0

Python 100.00%
intel openvino openvino-toolkit inference inference-engine people-detection face-detection matching-problems feature-extraction deep-learning

person-detect-reidentification's Introduction

Person / Face Detection and Re-identification Demo

This is a demo program to demonstrate how person or face detection DL model and re-identification model works with Intel(r) Distribution of OpenVINO(tm) toolkit.
This program finds the objects such as person or face from the multiple images, then assign ID and match objects in the pictures. The demo program suppors multiple camera or movie file inputs (the program should work with more than 2 inputs).
The re-identification model takes a cropped image of the object and generates a feature vector which consists of 256 FP values. This program calculates the cosine distance of those feature vectores of the objects to check the object similarity.
The found objects are registered to a database with the created time. The time in the record will be updated everytime the record is used so that the program can check the elapsed time from the last use. The record will be evicted when the specified time passes.

Intel(r) Distribution of OpenVINO(tm) toolkitを使った人・顔検出+マッチングデモプログラムです。
人検出、顔検出ディープラーニングモデルを使用して複数の画像から検出したオブジェクトに、re-identificationモデルを使用してマッチング、ID振りを行っています。
2つ以上のカメラ、あるいはムービーをサポートすることも可能です。
Re-identificationモデルは切り出されたオブジェクトのイメージから256個のFP数値からなる特徴ベクトルを生成します。このプログラムでは生成されたベクトル同士のコサイン距離の比較によってオブジェクトの類似度を判定しています。
見つかったオブジェクトは時刻とともにデータベースに記録されます。レコードの時刻はそのレコードが使用されるたびに更新され、最後に使用された時刻がわかるようになっています。使用されないまま指定された時間が経過したレコードはデータベースから除外されます。

Detection and Re-ID

You can track people in the images sent from multiple cameras track-face

Required DL Models to Run This Demo

The demo expects the following models in the Intermediate Representation (IR) format:

  • For person / pedestrian detection and re-identification

    • pedestrian-detection-adas-0002
    • person-reidentification-retail-0079
  • For face detection and re-identification

    • face-detection-adas-0001
    • face-reidentification-retail-0095

You can download those models from OpenVINO Open Model Zoo. In the models.lst is the list of appropriate models for this demo that can be obtained via Model downloader. Please see more information about Model downloader here.

How to Run

(Assuming you have successfully installed and setup OpenVINO 2020.2. If you haven't, go to the OpenVINO web page and follow the Get Started guide to do it.)

1. Install dependencies

The demo depends on:

  • opencv-python
  • numpy
  • scipy
  • munkres (for Hangarian combinational optimization method)

To install all the required Python modules you can use:

(Linux) pip3 install -r requirements.txt
(Win10) pip install -r requirements.txt

2. Download DL models from OMZ

Use Model Downloader to download the required models.

(Linux) python3 $INTEL_OPENVINO_DIR/deployment_tools/tools/model_downloader/downloader.py --list models.lst
(Win10) python "%INTEL_OPENVINO_DIR%\deployment_tools\tools\model_downloader\downloader.py" --list models.lst

3. Run the demo app

This program doesn't take any command line arguments. All file names and paths are hard coded in the source code.

(Linux) python3 person-detect-reid.py
(Win10) python person-detect-reid.py

In default, the program assumes that 2 USB webCams are attached to your PC. If you want to use movie files instead, modify the source code (it's easy :-) )

Demo Output

The application draws the boundinx boxes and ID numbers on the images.

Tested Environment

  • Windows 10 x64 1909 and Ubuntu 18.04 LTS
  • Intel(r) Distribution of OpenVINO(tm) toolkit 2020.2
  • Python 3.6.5 x64

See Also

person-detect-reidentification's People

Contributors

yas-sim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.