fix: issue argument passing

This commit is contained in:
rendies 2023-01-12 19:52:24 +07:00
parent 0d489e22aa
commit 7ecfaec6f0

View File

@ -24,6 +24,7 @@ lock = threading.Lock()
app = Flask(__name__) app = Flask(__name__)
cors = CORS(app) cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type' app.config['CORS_HEADERS'] = 'Content-Type'
args = None
@app.route("/counter") @app.route("/counter")
@cross_origin() @cross_origin()
@ -40,7 +41,7 @@ def video_feed():
return Response(generate(), return Response(generate(),
mimetype = "multipart/x-mixed-replace; boundary=frame") mimetype = "multipart/x-mixed-replace; boundary=frame")
def PeopleCounter(args): def PeopleCounter():
global outputFrame, lock, people_count global outputFrame, lock, people_count
# construct the argument parse and parse the arguments # construct the argument parse and parse the arguments
# ap = argparse.ArgumentParser() # ap = argparse.ArgumentParser()
@ -413,7 +414,7 @@ if __name__ == '__main__':
help="# of skip frames between detections") help="# of skip frames between detections")
args = vars(ap.parse_args()) args = vars(ap.parse_args())
# start a thread that will perform motion detection # start a thread that will perform motion detection
t = threading.Thread(target=PeopleCounter, args=(args)) t = threading.Thread(target=PeopleCounter)
t.daemon = True t.daemon = True
t.start() t.start()
# start the flask app # start the flask app