Giter VIP home page Giter VIP logo

ailia-apps-people-counter's Introduction

ailia APPS People Counter

Count the number of people crossing a line from a video using an AI model for people detection and tracking.

ailia APPS People Counter YouTube Video

Functions

  • People count using line crossing
  • Export count to csv

Options

  • Clip classification
  • Age gender classification
  • Person attributes classification
  • Google Analytics connection

Requirements

  • Windows, macOS, Linux
  • Python 3.7 and later
  • ailia SDK 1.2.13 and later
  • lap (pip3 install lap)
  • ftfy (pip3 install ftfy) if you use clip

Basic Usage

  1. Put this command to open GUI.
python3 ailia-apps-people-counter.py

Open GUI

  1. Push "Input video" button to select input video
  2. Push "Set crossing line" button to set crossing line

Set crossing line

Click on the screen to draw two lines.

  1. Push "Run" button to execute the app

Run app

Count (out) is incremented when passing through the line of in to go out. Count (in) is incremented when passing through the line of out to go in.

Other functions

Write output to video and csv

a. Push "Output video" button to select the path for video b. Push "Output csv" button to select the path for csv c. Push "Output image" button to select the folder for detected image

The examples of csv file.

sec , time, count(in) , count(out) , total_count(in) , total_count(out)
0 , 2023-02-18 12:32:52.289135 , 0 , 0 , 0 , 0
1 , 2023-02-18 12:32:53.794513 , 1 , 1 , 1 , 1
2 , 2023-02-18 12:32:55.195774 , 1 , 1 , 2 , 2

Vehicle count

Vehicles can be counted by specifying vehicle as the category. The model must specify yolo. Among yolo categories, count car, truck, and bus as vehicles.

Google Analytics Connection

You can send people count information to Google Analytics GA4 using Measurement Protocol.

Connect to Google Analytics

IP camera connection

You can set IP camera address from camera settings of menu bar. Please try to set these kind of ip camera address.

rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4

Architecture

classDiagram
`ailia APPS People Counter` <|-- `ByteTrack` : Person Tracking (ID assignment)
`ByteTrack` <|-- `ailia.detector` : Person Detection (Bounding box)
`ailia APPS People Counter` : Input Video, Output Video, Output csv
`ByteTrack` : Kalman Filter
`ailia.detector` <|-- `ailia.core` : Inference Engine
`ailia.core` <|-- `onnx` : Model
`ailia.detector` : ailiaDetectorCompute
`ailia.core` : ailiaCreate, ailiaPredict, ailiaDestroy
`ailia.core` <|-- Backend : Acceleration
`onnx` : mot17_s, mot17_tiny
`Backend` : CPU, GPU

FAQ

I want to detect multiple categories in a clip

Multiple categories can be specified by separating the category names with #.

man,woman#younger,older

UI not visible in DarkMode on macOS

Use brew's python3.10.

brew install [email protected]
brew install [email protected]
pip3.10 install -r requrements.txt
python3.10 ailia-people-counter.py

Failed to install lap

Use python3.10 instead of python3.11.

Test video

https://pixabay.com/videos/segway-scooter-people-move-28146/

ailia-apps-people-counter's People

Contributors

kyakuno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ailia-apps-people-counter's Issues

CLIPでカテゴリをグルーピングしたい

現在は、1カテゴリしか検知できないが、
・man, woman
・young, older
など、複数カテゴリを検知したい。

(man, woman), (young, older)のような記法でグルーピング可能にする。

Apply video fps

現在は20fps固定で出力しているので、ビデオのfpsを反映する。

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.