-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the Flask web app #9
Comments
Implemented testing environment on local network. # app.py
from flask import Flask, render_template, Response
import socket
import numpy as np
import cv2
host = "192.168.1.4"
port = 5005
server_address = (host, port)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(server_address)
print('starting up on %s:%s' % server_address)
app = Flask(__name__)
def gen():
while True:
data, address = sock.recvfrom(65535)
# nparr = np.frombuffer(data, np.uint8)
# img = cv2.imdecode(nparr, cv2.IMREAD_COLOR)
yield (b'--frame\r\n'
b'Content-Type: image/jpeg\r\n\r\n' + data + b'\r\n')
@app.route('/')
def index():
return render_template('index.html')
@app.route('/video_feed')
def video_feed():
return Response(gen(), mimetype='multipart/x-mixed-replace; boundary=frame')
if __name__ == '__main__':
app.run(ssl_context='adhoc')
|
kcuric
added a commit
that referenced
this issue
Jan 3, 2020
Fixed a bug as Miro suggested. Live Streaming with one camera is now possible. Frames are being sent via UDP.
kcuric
added a commit
that referenced
this issue
Jan 3, 2020
Face detection is now a thing. I've added some CSS too.
mkristofic
added a commit
that referenced
this issue
Jan 4, 2020
Because of the error while trying to run the server, the option to reuse socket address was set to true.
kcuric
added a commit
that referenced
this issue
Jan 4, 2020
Streamer and Recorder class are now completly separated! Meaning they are truly independent.
kcuric
added a commit
that referenced
this issue
Jan 4, 2020
Two cameras can now be used simuntaniosly. The plan is to make an implementation that can use n cameras in the future. The problem is the dynamic allocation of the ports and the dynamic allocation of the gui elements for the video streaming. But more on that perhaps in the future.
kcuric
added a commit
that referenced
this issue
Jan 4, 2020
Face detection (from each camera) is now provided in GUI. Further styling will be done. This was mainly achieved via AJAX, jQuery andjsonify module from Flask.
To run the client script user now must provide arguments.Needed arguments for the client script:
If the user uses only one camera than providing the camera number is not necessary. |
kcuric
added a commit
that referenced
this issue
Jan 4, 2020
Default value 0 for the camera number argument now works properly if not specified.
kcuric
added a commit
that referenced
this issue
Jan 8, 2020
mkristofic
added a commit
that referenced
this issue
Jan 9, 2020
Changed the spelling from 'Survailence' to 'Surveillance'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Implement the Flask web application that will be running on the created GCP VM Instance.
The text was updated successfully, but these errors were encountered: