• Stars
    star
    143
  • Rank 257,007 (Top 6 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Deep learning based object tracking with line crossing and area intrusion detection

Object Tracking with Line Crossing and Area Intrusion Detection

This program uses an object detection deep learning model and a re-identification model to find and track the objects in a movie. Then, the program will track the trajectory of the objects and check if the objects cross the defined virtual lines or the objects are inside the defined areas. The program uses Intel(r) Distribution of OpenVINO(tm) toolkit for deep learning inferencing.
To track the objects, the program extracts the feature vectors from the objects which consists of 256 FP values with the re-identification DL model. The program can identify which object is most similar to the objects in the previous frame and record the trajectory. The L2 norm (or the distance) of those feature vectores represents the similarity of the objects. This program uses cosine distance to check the similarity between the objects.
The line crossing check and area intrusion check are done by regular (meaning, non deep learning based) arithmetic algorithm.
The latest version playbacks sound when an event such as crossing a line or entering to an area happens.
You can learn how to use line-crossing and area intrusion function from simple test program (test-line-cross-area-intrusion.py)

このプログラムはディープラーニングの物体検出モデルと特徴抽出(re-identification)モデルを用いて、ムービーフレーム中のオブジェクトを検出し、追跡するプログラムです。プログラムは見つけたオブジェクトの軌跡を記録し、オブジェクトが定義された仮想ラインを超えたり定義されたエリアに侵入したことを検出します。ディープラーニングの推論にはIntel(r) Distribution of OpenVINO(tm) toolkitを利用しています。
オブジェクトの追跡のために、プログラムは特徴抽出モデルを使用して見つけたオブジェクトから256個の浮動小数点数値からなる特徴ベクトルを抽出します。この特徴ベクトル同士のL2ノルム(=距離)がオブジェクト同士の類似度を表します。このプログラムではノルムの計算にコサイン距離を使用しています。
ラインクロスとエリア侵入の判定には通常の(ディープラーニングベースではない)数学的アルゴリズムを使用しています。
最新版はラインクロスしたりエリア侵入したりなどのイベント発生時にオーディオを再生します。
コードを簡素化したテストプログラムも追加しました。ライン交差やエリア侵入判定関数の使い方などを学ぶことが可能です。(test-line-cross-area-intrusion.py)

[ Update - 04-Apr-2022 ] OpenVINO API 2.0 support. Program is now compatible with OpenVINO 2022.1 (and not compatible with OpenVINO 2021 and older ones)

Object Tracking and Line Crossing Demo

object-track

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-0031

You can download these 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

0. Prerequisites

  • OpenVINO 2021.3
    • If you haven't installed it, 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

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 and convert the downloaded model into OpenVINO IR models with Model Converter.

(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

(Linux) python3 object-detection-and-line-cross.py
(Win10) python object-detection-and-line-cross.py

Demo Output

The application draws the results on the screen.

Simple test program

test-line-cross-area-intrusion.py is a simple test program for line-crossing and area-intrusion detection. You can move mouse cursor to test how it works.
test-prog

Coordinates checker

You can utilize coordinates-checker to get the coordinates of point of interest to define boundary lines and area polygons. The coordinates-checker is also included in this project as a submodule. See coordinates-checker GitHub repo for details.
python coordinates-checker\coordinates-checker.py [image.jpg / movie.mp4 / 0 ]

Tested Environment

  • Windows 11 x64
  • Intel(r) Distribution of OpenVINO(tm) toolkit 2022.1
  • Python 3.7 x64

See Also

More Repositories

1

floppy_disk_shield_2d

This is a project to retain 2D/2DD floppy disk data as a raw bit-stream data. The project includes both HW and SW.
Python
47
star
2

gaze-estimation-with-laser-sparking

Deep learning based gaze estimation demo with a fun feature :-)
Python
40
star
3

handwritten-japanese-ocr

Handwritten Japanese OCR demo using touch panel to draw the input text using Intel OpenVINO toolkit
Python
36
star
4

person-detect-reidentification

Person or face detection and matching from multiple image inputs using Intel OpenVINO toolkit
Python
34
star
5

interactive-image-inpainting

Deep Learning Based Interactive Image Inpainting Demo
Python
32
star
6

blazepose_openvino

BlazePose model test program for Intel Distribution of OpenVINO toolkit
C++
29
star
7

dbface-on-openvino

Describes how to run DBFace, a real-time, single-shot face detection model on Intel OpenVINO
Jupyter Notebook
28
star
8

openvino-ep-enabled-onnxruntime

Describing How to Enable OpenVINO Execution Provider for ONNX Runtime
C++
18
star
9

human-pose-estimation-2d-demo

Deep learning based human pose estimation demo in Python using Intel OpenVINO toolkit
Python
18
star
10

objectron-3d-object-detection-openvino

Sample implementation of 3D object detection with Intel OpenVINO
Python
15
star
11

openvino-model-division-and-simple-custom-layer

Demonstrates how to divide a DL model into multiple IR model files (division) and introduce a simplest way to implement a custom layer works with OpenVINO IR models.
Python
12
star
12

openvino_open_model_zoo_toolkit

Python wrapper library for Intel distribution of OpenVINO and Open Model Zoo (OMZ) models. User can use DL by simple function calls with this library.
Python
11
star
13

openvino-real-time-noise-suppression-demo

Modified version of OpenVINO noise_suppression_demo. This version can handle real-time audio stream from microphone and output to headphone.
Python
11
star
14

openvino-multi-ncs2-throughput-mode

Describing How to Use Throughput Mode to Run Inference Effectively on Multiple NCS2 Devices with Intel (r) OpenVINO toolkit
Python
10
star
15

openvino-segment-anything-interactive-demo

Segment Anything Model (SAM) interactive demo with OpenVINO
Python
10
star
16

openvino-ir-utility

Utility tool for Intel(r) OpenVINO(tm) IR models. The tool can display detailed model information, layer information and can check compatibility. The tool also can extract weight data and feature map from the IR model.
Python
10
star
17

openvino_auto_benchmark

Semi-automated OpenVINO benchmark_app with variable parameters. User can specify multiple options for any parameters in the benchmark_app and the progam runs the benchmark with all combinations of given options.
Python
10
star
18

openvino-sound-classification-demo-rt

Real-time version of sound_classification_demo in OpenVINO toolkit. Captures audio from microphone, do classification, and display result on the screen with illustration.
Python
10
star
19

openvino-wrapper

This is a tiny Python class library to wrap and abstract the OpenVINO Inference Engine.
Python
9
star
20

openvino-model-server-wrapper

Python wrapper class for OpenVINO Model Server. User can submit inference request to OVMS with just a few lines of code.
Python
9
star
21

openvino-visual-performance-demo

Intel OpenVINO visual performance demo - Supports classification models.
Python
9
star
22

fdc_bitstream

FDC emulator for 2D MFM floppy bitstream image data
C++
8
star
23

object-detection-with-adaptive-partitioning

Object detection demo with adaptive partitioning to improve the detection rate
Python
8
star
24

openvino-people-detection-sample

OpenVINO Python sample program - Face detection, People detection, Age/gender estimation, Pose estimation
Python
8
star
25

pyopenvino

Experimental Python implementation of OpenVINO Inference Engine (very slow, limited functionality). All codes are written in Python. Easy to read and modify.
Python
7
star
26

openvino-workshop-jp

OpenVINO hands-on workshop contents (Japanese, 日本語版)
Jupyter Notebook
7
star
27

openvino-semantic-segmentation-demos

Semantic segmentation demos - Object extraction and Background swapping
Python
6
star
28

openvino-auto-thermometer

AI based face recognition with non-contact body temperature measurement system.
Python
6
star
29

openvino-onnx-importer-api

Demonstrate how to use ONNX importer API in Intel OpenVINO toolkit. This API allows user to load an ONNX model and run inference with OpenVINO Inference Engine.
C++
6
star
30

openvino-llm-minimal-code

Most simple and minimal code to run an LLM chatbot from HuggingFace hub with OpenVINO
Python
5
star
31

coordinates-checker

A tool to check the coordinate of points in an picture. You can know the (X,Y) coordination of the points by mouse operation. The tool provides magnify feature for easy point pick up.
Python
5
star
32

pseudo-stereo-picture

Deep learning based pseudo stereo image generation demo using Intel(r) Distribution of OpenVINO(tm) toolkit
Python
5
star
33

devcloud-workshop-en

Hands-on workshop contents to learn about Intel DevCloud for the Edge
Jupyter Notebook
5
star
34

devcloud-workshop-jp

Intel DevCloud for the Edge hands-on workshop contents (Japanese, 日本語版)
Jupyter Notebook
5
star
35

openvino-docker-ssh

Dockerfile to enable ssh and X11 redirect for developer convenience. You can start OpenVINO development in 5min.
Dockerfile
4
star
36

csm_voice_encode_synthesis_python

Expermental code for CSM voice synthesis + CSM data generation
Jupyter Notebook
4
star
37

openvino-chatbot-rag-pdf

LLM Chatbot-RAG by OpenVINO. The chatbot can read a PDF file and answer to the related questions.
Python
4
star
38

python-cpp-extension-sample-code

Sample code of Python C++ extension module. Demonstrates how to deal with Numpy objects in C++ codes. Also, OpenCV Mat and Numpy interaction code example is included.
C++
4
star
39

camera-calibration-for-openvino-demos

Utility program to generate camera calibration data for OpenVINO sample programs (human_pose_estimation_3d_demo)
Python
4
star
40

openvino-auto-feature-visualization

This is a set of test program to visualize the behavior of "AUTO" plugin device switching and auto-batching feature that is newly introduced from OpenVINO 2022.1 version.
Python
4
star
41

simple-annotation-toolkit

The most simple ROI annotation toolkit for object detection task
Python
3
star
42

openvino-llm-chatbot-rag

LLM chatbot example using OpenVINO with RAG (Retrieval Augmented Generation).
Python
3
star
43

openvino-multi-camera-position-estimation-demo

Using multiple cameras to estimate the people's position. Works with OpenVINO toolkit.
Python
3
star
44

openvino-model-experiment-package

Utility functions to help analyzing the inference result of the OpenVINO models
Jupyter Notebook
3
star
45

xm7-related-tools

Tools for XM7, an emulator for Fujitsu FM-7 series 8bit computers.
C++
2
star
46

M3U8-playlist-organizer

A simple Python script to sort M3U8 format playlist entries and remove duplicates
Python
2
star
47

csm_voice_synthesis_ym2203_python

An experimental code of CSM (composite sinusoidal modeling) voice synthesis with Python
Jupyter Notebook
2
star
48

openvino_japanese_chatbot_youri-7b-chat

WebUI LLM Japanese chatbot demo using Intel OpenVINO toolkit. This program uses rinna/youri-7b-chat model developed by Rinna Co.,Ltd..
Jupyter Notebook
2
star
49

openvino-workshop-en

Hands-on workshop contents to learn Intel distribution of OpenVINO toolkit - a deep learning inferencing library
Jupyter Notebook
2
star
50

openvino_genai_sample_codes

OpenVINO.genai sample codes with a helper class that supports vLLM-like iterator-based streaming output.
Python
2
star
51

MTB_practice_video_recorder

Playback video from webCam or a movie file, keeps frames of the latest 10min, and allow you to watch your desired point with several playback options/modes.
Python
1
star
52

openvino-gna-example-with-mnist

Sample code to demonstrate how to use GNA unit in Intel CPUs for inferencing.
Python
1
star
53

openvino-custom-layer-development-guide

OpenVINO Custom Layer Development Guide
1
star
54

python-dpcpp-extension-sample-code

Python extension sample code using Intel oneAPI DPC++. The extension does a simple image processing using DPC++ kernel.
C++
1
star
55

face-feature-visualization

This program demonstrates how to plot face feature vectors on a 2-D chart using t-SNE method to compress dimension of the vectors
Python
1
star