Coder Social home page Coder Social logo

socialdistancingai's Introduction

Aqeel's GitHub Banner

Visits Badge LinkedIn Badge Medium Badge

Hello,

I am Aqeel, a PhD candidate at Georgia Institute of Technology, working towards energy-effecient machine learning systems design.

socialdistancingai's People

Contributors

aqeelanwar 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  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  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  avatar  avatar  avatar  avatar

socialdistancingai's Issues

Which algorithm?

You have not specified any particular algorithm but just the platform , could you pls answer?

Bounding box colours and saving output

Is it possible to to modify the code so that the bounding boxes too can get different colours as per the violation?
It would also be nice if the final output of the analyzer can be saved locally, by writing a video file in real time.

d_thresh calculation issue !!! i guess could you please explain reason behind it. ?

May i know the reason "d_thresh" calculation is not scaled with the birds eye view height and width where points and all re scaled with height and width of birds eye view ?

d_thresh = np.sqrt(
(warped_pt[0][0] - warped_pt[1][0]) ** 2
+ (warped_pt[0][1] - warped_pt[1][1]) ** 2
)

warped_pt_scaled = [int(warped_pt[0] * scale_w), int(warped_pt[1] * scale_h)]

query about getting distancing between pair pedestrians in bounding box

Hi

thanks for sharing. i noted from the code the pedestrian bounding boxes are subsequently transformed into bird eye view and then checked for 6 feet/10 feet violation. i wish to get only the violating subject pairs (in bounding boxes or midpoints) among the list of bounding boxes. May i know how can i do so to filter the bounding boxes to know which pair has the violation?

thanks

New video issues

When I try to run the same code with some other video file, I get a highly magnified video and hence much of the original video data is getting lost.

How can I configure it to avoid such a problem, because as of now I cannot choose the points I desire for ROI

Thanks!

reg:tfflite

hi,
is there a chance to convert frozen_inference_graph.pb to tfflite..if yes what are the inputs and outputs..are they default..please help me..iam new to tensor flow..thanks in advance!

OpenCV(4.2.0) CAP_IMAGES: can't find starting number

[ERROR:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap.cpp (415) cv::VideoWriter::open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): pedestrian_detect.avi in function 'cv::icvExtractPattern'

[ERROR:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap.cpp (415) cv::VideoWriter::open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): pedestrian_bird.avi in function 'cv::icvExtractPattern'

Anyone facing this problem? Would need some help here. Thank you

issue when run

/Users/userName/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
/Users/userName/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/Users/userName/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
/Users/userName/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/Users/userName/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
/Users/userName/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
Traceback (most recent call last):
File "main.py", line 4, in
from network_model import model
File "/Users/userName/Downloads/master/test_distance/SocialDistancingAI-dependabot-pip-tensorflow-1.15.2/network_model.py", line 5, in
import backbone
File "/Users/userName/Downloads/master/test_distance/SocialDistancingAI-dependabot-pip-tensorflow-1.15.2/backbone.py", line 6, in
import tensorflow as tf
File "/Users/userName/opt/anaconda3/lib/python3.7/site-packages/tensorflow/init.py", line 35, in
from tensorflow._api.v1 import compat
File "/Users/userName/opt/anaconda3/lib/python3.7/site-packages/tensorflow/_api/v1/compat/init.py", line 22, in
from tensorflow._api.v1.compat import v2
File "/Users/userName/opt/anaconda3/lib/python3.7/site-packages/tensorflow/_api/v1/compat/v2/init.py", line 303, in
from tensorboard.summary._tf import summary
File "/Users/userName/opt/anaconda3/lib/python3.7/site-packages/tensorboard/summary/init.py", line 25, in
from tensorboard.summary import v1
File "/Users/userName/opt/anaconda3/lib/python3.7/site-packages/tensorboard/summary/v1.py", line 46, in
pr_curve_pb = _pr_curve_summary.pb
AttributeError: module 'tensorboard.plugins.pr_curve.summary' has no attribute 'pb'

Function issue plot_lines_between_nodes

In the function plot_lines_between_nodes() the for loop is made to run through range(len(dd[0]))/2) due to which all pairs of nodes are not getting taken into account.

Consider the following example:

dist = np.array([[0,173.66634677,194.6715182,1173.33413826],
                 [173.66634677,0,24.35159132, 1077.55324694],
                 [194.6715182, 24.35159132, 0, 1056.10037402],
                 [1173.33413826, 1077.55324694, 1056.10037402, 0]])

thresh =  350

dd = np.where(dist < thresh *  6 / 10)

close_p = []

for i in range(int(np.ceil(len(dd[0]) / 2))):
    if dd[0][i] != dd[1][i]:
        point1 = dd[0][i]
        point2 = dd[1][i]

        close_p.append([point1, point2])

The resultant points in close_p are [[0, 1], [0, 2], [1, 0]]
and it misses out on pairs [[1,2], [2,1]]

Close 10 feet calculation

The formula used in the function plot_lines_between_nodes to calculate points which are close to 10 feet is dd = np.where(dist < d_thresh * 6 / 10)
Could you explain this calculation?
Because a different formula is used for ten_feet_violations list
ten_feet_violations = len(np.where(dist_condensed < 10 / 6 * d_thresh)[0])

Thank you!

Some question regarding implementation

Thanks for sharing ...!!!
I have some questions with respect to implementation part of it.

  1. scale_w = 1.2 / 2 scale_h = 4 / 2 how did you select you with respect to image size?
  2. It looks like you are doing cv2.getperspective transform for a selected polygon points, for 6 feet person's two points you are using cv2.perspectivetransform,
    pts = src = np.float32(np.array([four_points[4:]]))
    warped_pt = cv2.perspectiveTransform(pts, M)[0]
    But while coding you are taking three points rather two points can you specify the significance of this ?
  3. for ten feet violations you used,
    ten_feet_violations = len(np.where(dist_condensed < 10 / 6 * d_thresh)[0])
    Can you convert this formula for generic distance calculation like for 1 feet , 2 feet ..etc.
  4. what is that calculate_stay_at_home_index functions;ity?

Doubt regarding block diagram

Even though they are completed, why Project pedestrian location on bird's eye view and Find distance between pedestrians are separated without any dotted line. What does that dotted line signify?

image

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.