Our society is governed by lines (or queues as they call it on the other side of the pond). We see lines everywhere from checkout lines to security lines at airports to lines to visit tourist attractions to lines of cars waiting during a traffic jam. When it comes to lines, the most important question always seems to be, "when will I get out of this line." The goal of Tarbas is to find this answer.
Our software system takes an image of any format, determines where the individuals are in this image, and then determines whether these individuals are in a line.
The main file which is used to draw bounding boxes and determine the coordinates of individuals in an image is person_detection.py
. It is based on the Google TensorFlow Object Detection API and the file is based on the work of Norman Di Palo as found here. All images in the directory specified by IMAGES_DIRECTORY
in Tarbas.java
will be processed. It will output processed images with bounding boxes identifying individuals as shown below.
The central point of each bounding box is also saved as a (x, y)
pair in a CSV file for that image so that this data can later be used to identify lines.
Without Bounding Boxes | With Bounding Boxes |
---|---|
A linear regression test alone is not sufficient to determine if there is a line in an image. We need to also determine if there are individuals grouped together which compose something that is similar to a line. In GroupQueue.java
, we take a list of (x, y)
datapoints and determines if these can be clustered together into either groups or other forms which resemble a line. It then returns the largest of these queues for consideration for linear regression.
In order to determine whether the sets of (x, y)
points approximate a line, we use a basic linear regression algorithm provided by scikit-learn in linear_regression.py
. This returns a R^2 score which we use to determine how closely these (x, y)
points meet a model of a line.
In order to estimate the time an individual might spend waiting in a line, a group of coordinates of individuals in a line along with an estimated waiting time per each individual in the line is provided to EstimateTime.java
. It then returns the amount of time an individual has to spend in line.
Training data for what constitutes a line can be generated from LineGenerator.java
. This creates a randomly generated queue in terms of (x, y)
coordinates with some deviation and adds randomly generated extraneous datapoints. This data has labels identifying if the point is in the queue (1) or not (0).
All scripts (Java and Python) are run directly from Tarbas.java.
All configuration can be specified in the file. Images can be placed in the designated directory for processing.
Contributors: Alexander Asfar, Michel Majdalani, Cyril Yared