Code Monkey home page Code Monkey logo

jalotra / queue-detection Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 2.88 MB

A naive Algorithm that uses People Detection and Convex Hull as subroutines to solve this problem: "Given an image of people standing randomly, how many people can be a part of some queue {Q}. A queue {Q} is basically a line(y = mx + c) that minimises a custom loss function. "

Shell 7.20% Python 92.80%
yolo bounding-boxes yolov5x convex-optimization object objectdetection

queue-detection's Introduction

Queue-Detection

Objective and Approach:

  1. To find a possible queue vector which is basically a line or (y = mx + c) using People Detection as a subroutine and then answer this question : "How many people are standing in the queue".

  2. Assumption Taken : "Whatever be the camera angle is the queue is always a planar surface in a 3D world".

  3. Finds the bounding boxes around people using Yolo.

  4. Of all those bounding boxes the code tries to find the best params(m, c) such that maximum people lie on or some delta(eps) along this line.

  5. Takes 90% of all the points to remove outliers.

  6. Finding params(m, c) is done by solving an optimisation problem that uses Convex-Hull as a subroutine.

For more details refer the Presentation that I made : Presentation

Current Tasks

Yolo from here : https://github.com/ultralytics/yolov5

  1. To use the YOLO Algorithm to detect all the bounding boxes that are persons.
  2. Reading the Source Code of Darknet, learning about Yolo Layers and the implementation in Pytorch.
  3. Maybe Fine Tune the Model to only output bounding boxes around humans. Something like this : https://www.codeproject.com/Articles/5283660/AI-Queue-Length-Detection-Counting-the-Number-of-P

Setting Up the Development Arena

  1. You must have Conda installed, since it provides containerisation we dont have to worry about building and running on Different Platforms/ OSes.
  2. First run "bash setup_env.sh" -> This will create a Queue_Detection conda environment.
  3. Run conda activate Queue_Detection to activate the newly made env.
  4. Next run "bash setup.sh" -> This will install all the related dependencies.
  5. In case of error, read the *sh files and figure it out yourself.

Average Timings on Still Images

  1. Yolov5s -
  2. Yolov5m -
  3. Yolov5l -
  4. Yolov5x -
  5. Yolov5x + TTA -

Datasets to Check On

  1. Shanghai DataSet : https://www.kaggle.com/tthien/shanghaitech

Readings :

Ques : Why are there different versions of the same paper ?

  1. V1 : https://arxiv.org/pdf/1506.02640v1.pdf
  2. V2 : Somrthing Here
  3. V3 : Something Here
  4. V4 : https://arxiv.org/pdf/1506.02640v4.pdf
  5. https://blog.paperspace.com/how-to-implement-a-yolo-object-detector-in-pytorch/

Results :

Picture 1 :

Indian Queue

Picture 2 :

Indian Queue

Picture 3 :

Indian Queue

Picture 4 :

Indian Queue

Picture 5 :

Not Indian Queue

queue-detection's People

Contributors

jalotra avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

queue-detection's Issues

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.