diff --git a/README.md b/README.md index c1d997b..bd2e1f0 100644 --- a/README.md +++ b/README.md @@ -59,14 +59,16 @@ url = '' ``` python run.py --prototxt mobilenet_ssd/MobileNetSSD_deploy.prototxt --model mobilenet_ssd/MobileNetSSD_deploy.caffemodel ``` +> Set url = 0 for webcam. ## Features -The following are the added features. Note: You can easily on/off them in the config. options (mylib/config.py): +The following is an example of the added features. Note: You can easily on/off them in the config. options (mylib/config.py): ***1. Real-Time alert:*** -- If selected, we send an email alert in real-time. Use case: If the total number of people (say 30) exceeded in a store/building, we simply alert the staff. +- If selected, we send an email alert in real-time. Use case: If the total number of people (say 10 or 30) exceeded in a store/building, we simply alert the staff. +- You can set the max. people limit in config. (``` Threshold = 10 ```). - This is pretty useful considering the COVID-19 scenario. diff --git a/Run.py b/Run.py index 11ccc4a..a7f6fd7 100644 --- a/Run.py +++ b/Run.py @@ -239,10 +239,10 @@ def run(): # compute the sum of total people inside x.append(len(empty1)-len(empty)) #print("Total people inside:", x) - # Optimise number below: 10, 50, 100, etc., indicate the max. people inside limit - # if the limit exceeds, send an email alert - people_limit = 10 - if sum(x) == people_limit: + # if the people limit exceeds over threshold, send an email alert + if sum(x) >= config.Threshold: + cv2.putText(frame, "-ALERT: People limit exceeded-", (10, frame.shape[0] - 80), + cv2.FONT_HERSHEY_COMPLEX, 0.5, (0, 0, 255), 2) if config.ALERT: print("[INFO] Sending email alert..") Mailer().send(config.MAIL) diff --git a/mylib/__pycache__/centroidtracker.cpython-37.pyc b/mylib/__pycache__/centroidtracker.cpython-37.pyc new file mode 100644 index 0000000..47359b8 Binary files /dev/null and b/mylib/__pycache__/centroidtracker.cpython-37.pyc differ diff --git a/mylib/__pycache__/config.cpython-37.pyc b/mylib/__pycache__/config.cpython-37.pyc new file mode 100644 index 0000000..76ed42e Binary files /dev/null and b/mylib/__pycache__/config.cpython-37.pyc differ diff --git a/mylib/__pycache__/mailer.cpython-37.pyc b/mylib/__pycache__/mailer.cpython-37.pyc new file mode 100644 index 0000000..f37e204 Binary files /dev/null and b/mylib/__pycache__/mailer.cpython-37.pyc differ diff --git a/mylib/__pycache__/thread.cpython-37.pyc b/mylib/__pycache__/thread.cpython-37.pyc new file mode 100644 index 0000000..eae487a Binary files /dev/null and b/mylib/__pycache__/thread.cpython-37.pyc differ diff --git a/mylib/__pycache__/trackableobject.cpython-37.pyc b/mylib/__pycache__/trackableobject.cpython-37.pyc new file mode 100644 index 0000000..67c9af3 Binary files /dev/null and b/mylib/__pycache__/trackableobject.cpython-37.pyc differ diff --git a/mylib/config.py b/mylib/config.py index 1add681..de56b73 100644 --- a/mylib/config.py +++ b/mylib/config.py @@ -9,9 +9,10 @@ url = '' # ON/OFF for mail feature. Enter True to turn on the email alert feature. ALERT = False +# Set max. people inside limit. Optimise number below: 10, 50, 100, etc. +Threshold = 10 # Threading ON/OFF Thread = False - # Simple log to log the counting data Log = False # Auto run/Schedule the software to run at your desired time