Showing
5 changed files
with
148 additions
and
0 deletions
flask/app.py
0 → 100644
1 | +from flask import Flask, render_template, Response, request | ||
2 | +import cv2 | ||
3 | +import numpy as np | ||
4 | +import time | ||
5 | +import datetime | ||
6 | +import sys | ||
7 | + | ||
8 | +faceCascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml") | ||
9 | +num = 3 | ||
10 | +app = Flask(__name__) | ||
11 | + | ||
12 | +@app.route('/') | ||
13 | +def index(): | ||
14 | + """Video streaming home page.""" | ||
15 | + return render_template('index.html') | ||
16 | + | ||
17 | + | ||
18 | +@app.route('/submit', methods=['POST']) | ||
19 | +def submit(): | ||
20 | + image = request.args.get('image') | ||
21 | + print(type(image)) |
flask/cert.pem
0 → 100644
1 | +-----BEGIN CERTIFICATE----- | ||
2 | +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 | ||
32 | +YelbBzWX2wmX | ||
33 | +-----END CERTIFICATE----- |
flask/haarcascade_frontalface_default.xml
0 → 100644
This diff could not be displayed because it is too large.
flask/key.pem
0 → 100644
1 | +-----BEGIN PRIVATE KEY----- | ||
2 | +MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDn9up5AI6gvsiJ | ||
3 | +v+SMzeQFtmy6LtgjoyU5QvqiONulDYIu4gCXIfwaG8Nvee6CYDgqvzckDuyBtyAn | ||
4 | +UmGpMLrvcbYc5UYewKDB22txQpAff5eqDMfd4RdrC/95nkOvqqV8HrCM8HipZJNL | ||
5 | +lC9xKNCbKmQ4s8m1GI4kCS2+XdG2oc+L3vHIDil93/u3lKEhtGlRxgYuKyjp1w8D | ||
6 | +H7GAfiVcVOQER5ymfm4bml/Mr+n7SxwduYbb4gcTWVHiq67I7m8kH5KotRWze0XK | ||
7 | +5XL2V9AJXaOL4qbPmIWqhB0LeJFAsshB3GxAGmpmtpc1T/oQc7X+1SX45a0Msdbo | ||
8 | +RYkuf3HCoGkNv/qNtmNQvDq3VrJA/S5BBOOHlasI87fm6Wy7IwVm1ju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42RTsUZB0yZobaPD7Vy+KyS0GNg4nWApwPoBgbkYqmtyMLhAqjKp | ||
39 | +Q4aS+hyIBEbXbj3f3F6TYGbl/NXGHeqO2+3sLVxaBM+C7VVPX9hWSJBfehJyfM5L | ||
40 | +j24KS7QgH+Q49uGQu3Ia7l6vNNCU0/bQSMeMh6kCggEAcMdOkQ2jpKbQBfn3kGxY | ||
41 | +KY7mGC1XmlEWQe7lLQ3tCU2LW5dm8sqa0yhW6SVo0A+rrEsMeScvIAA+/dgSqGiD | ||
42 | +U7XEkMGarGbbZw1rJITeiwm1uOks2v0j82VYKRKgN5DQ36OjM57hPT54+9bdgpPi | ||
43 | +dE+HeFkfocWQB+81KdjrfKUekwN+t+tsq/JME9nxDGVKmUtlPioczh4w0uBT2FVt | ||
44 | +0BK5ybnlQG3BCzG73wJAKBv5nk1HbX7li5PqSfxpoGsdF/OEw6GlDDe+t27TGMFL | ||
45 | +qSDEzuIh9uGZxQGLJmOJaapvW510C2AhHVgcv8nKmFjrc7+E9OYop5F+lu7WYmaR | ||
46 | +lQKCAQEA6F4s+NTV6yAivr+TP/ZAF9YZz556bVu0v4t6CMI9X9EmldqLjrKBDmfW | ||
47 | +INVld1YY05BMBPyWUaJqPnfXCSPzo3arpA4eonSWoaZis7PP2AORazFzEt0BBqAs | ||
48 | +Y37ppv4dedLARKyPdaRefqX2vd5WSXH8RpgB3+KhIKoPy9tS/Ju4oDZuDwkRkkj/ | ||
49 | +Pyr/bUtVFEvd149HqDn4s8obK8LaLAo+SWHvSMHTuzuS+64slq++vS/Yewomwdrm | ||
50 | +yZHhGr0MIRN/s0J51MolW9g2kGFkQZx3kY8nuPeNlK66eAeCDO66DInNzF9+qTbZ | ||
51 | +X6NfUO/Z6C2B9RWM0ZqwJAfbp87zJw== | ||
52 | +-----END PRIVATE KEY----- |
flask/templates/index.html
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | +<head> | ||
4 | +<meta charset="utf-8"> | ||
5 | +<title>Display Webcam Stream</title> | ||
6 | + | ||
7 | +<style> | ||
8 | +#container { | ||
9 | + margin: 0px auto; | ||
10 | + width: 500px; | ||
11 | + height: 375px; | ||
12 | + border: 10px #333 solid; | ||
13 | +} | ||
14 | +#videoElement { | ||
15 | + width: 500px; | ||
16 | + height: 375px; | ||
17 | + background-color: #666; | ||
18 | +} | ||
19 | +</style> | ||
20 | +</head> | ||
21 | + | ||
22 | +<body> | ||
23 | +<div id="container"> | ||
24 | + <video autoplay="true" id="videoElement"> <!-- style="visibility: hidden"--> | ||
25 | + | ||
26 | + </video> | ||
27 | + <canvas id='canvasOutput'> | ||
28 | + </canvas> | ||
29 | +</div> | ||
30 | +<script type='text/javascript'> | ||
31 | +var video = document.querySelector("#videoElement"); | ||
32 | +if (navigator.mediaDevices.getUserMedia){ | ||
33 | + navigator.mediaDevices.getUserMedia({ video: true }) | ||
34 | + .then(function (stream) { | ||
35 | + video.srcObject = stream; | ||
36 | + }).catch(function (err0r) { | ||
37 | + console.log("Something went wrong!"); | ||
38 | + }); | ||
39 | +} | ||
40 | +</script> | ||
41 | +</body> | ||
42 | +</html> |
-
Please register or login to post a comment