From 7ecfaec6f0596cfdee75bcf31846a8a069021b30 Mon Sep 17 00:00:00 2001 From: rendies Date: Thu, 12 Jan 2023 19:52:24 +0700 Subject: [PATCH] fix: issue argument passing --- RunCounting.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RunCounting.py b/RunCounting.py index c5360ed..359ac45 100644 --- a/RunCounting.py +++ b/RunCounting.py @@ -24,6 +24,7 @@ lock = threading.Lock() app = Flask(__name__) cors = CORS(app) app.config['CORS_HEADERS'] = 'Content-Type' +args = None @app.route("/counter") @cross_origin() @@ -40,7 +41,7 @@ def video_feed(): return Response(generate(), mimetype = "multipart/x-mixed-replace; boundary=frame") -def PeopleCounter(args): +def PeopleCounter(): global outputFrame, lock, people_count # construct the argument parse and parse the arguments # ap = argparse.ArgumentParser() @@ -413,7 +414,7 @@ if __name__ == '__main__': help="# of skip frames between detections") args = vars(ap.parse_args()) # start a thread that will perform motion detection - t = threading.Thread(target=PeopleCounter, args=(args)) + t = threading.Thread(target=PeopleCounter) t.daemon = True t.start() # start the flask app