Graduate

Make web

from flask import Flask, render_template, Response, request
import cv2
import numpy as np
import time
import datetime
import sys
faceCascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
num = 3
app = Flask(__name__)
@app.route('/')
def index():
"""Video streaming home page."""
return render_template('index.html')
@app.route('/submit', methods=['POST'])
def submit():
image = request.args.get('image')
print(type(image))
-----BEGIN CERTIFICATE-----
MIIFpTCCA42gAwIBAgIUD9HYp3PIpVF2N4BCMm5eEau7IV8wDQYJKoZIhvcNAQEL
BQAwYjELMAkGA1UEBhMCS1IxDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQKDAhHYWJp
YmluZzERMA8GA1UEAwwIZ2FiaWJpbmcxHTAbBgkqhkiG9w0BCQEWDmdhYmlAa2h1
LmFjLmtyMB4XDTIwMTExOTExNDAwNFoXDTIxMTExOTExNDAwNFowYjELMAkGA1UE
BhMCS1IxDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQKDAhHYWJpYmluZzERMA8GA1UE
AwwIZ2FiaWJpbmcxHTAbBgkqhkiG9w0BCQEWDmdhYmlAa2h1LmFjLmtyMIICIjAN
BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA5/bqeQCOoL7Iib/kjM3kBbZsui7Y
I6MlOUL6ojjbpQ2CLuIAlyH8GhvDb3nugmA4Kr83JA7sgbcgJ1JhqTC673G2HOVG
HsCgwdtrcUKQH3+XqgzH3eEXawv/eZ5Dr6qlfB6wjPB4qWSTS5QvcSjQmypkOLPJ
tRiOJAktvl3RtqHPi97xyA4pfd/7t5ShIbRpUcYGLiso6dcPAx+xgH4lXFTkBEec
pn5uG5pfzK/p+0scHbmG2+IHE1lR4quuyO5vJB+SqLUVs3tFyuVy9lfQCV2ji+Km
z5iFqoQdC3iRQLLIQdxsQBpqZraXNU/6EHO1/tUl+OWtDLHW6EWJLn9xwqBpDb/6
jbZjULw6t1ayQP0uQQTjh5WrCPO35ulsuyMFZtY7k4znVLc6Wc4+Nd/0CLAYOpRu
mhkibdAX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V34xefKUQ7gI92d
YelbBzWX2wmX
-----END CERTIFICATE-----
This diff could not be displayed because it is too large.
-----BEGIN PRIVATE KEY-----
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDn9up5AI6gvsiJ
v+SMzeQFtmy6LtgjoyU5QvqiONulDYIu4gCXIfwaG8Nvee6CYDgqvzckDuyBtyAn
UmGpMLrvcbYc5UYewKDB22txQpAff5eqDMfd4RdrC/95nkOvqqV8HrCM8HipZJNL
lC9xKNCbKmQ4s8m1GI4kCS2+XdG2oc+L3vHIDil93/u3lKEhtGlRxgYuKyjp1w8D
H7GAfiVcVOQER5ymfm4bml/Mr+n7SxwduYbb4gcTWVHiq67I7m8kH5KotRWze0XK
5XL2V9AJXaOL4qbPmIWqhB0LeJFAsshB3GxAGmpmtpc1T/oQc7X+1SX45a0Msdbo
RYkuf3HCoGkNv/qNtmNQvDq3VrJA/S5BBOOHlasI87fm6Wy7IwVm1juTjOdUtzpZ
zj413/QIsBg6lG6aGSJt0BcKF93wMbEXE9EP6T1inwjQg5+Dhu3+ZuHf5DEfC6Yq
Mytyoymg26IThQPKCLx73KdcE/tPsZGmtU1e4dY8SA3/jpIIl1wiQa9Wh9vDnS3i
8m3G6sHKzYXuBoVh3GSQc+qZPiz6AOXZtRMbQZKHZ8iBmLn1yG8YVEUE3JQQXfQ/
r8e8VMjNBYkVu7j3qsQXOKRW/zxI9nu615ByPSU6Daml0jNW+qCIVtXzZoevTkNo
Gno3H9HzPI2Ng/n58ttn3pwyAKRjfwIDAQABAoICABSMzWz23avj+wQpGehXfTH8
XVmJOOC/XVbbVjT08JCIx9W7c+3vttPhTckcdkLan186HXp2UAGV5aVWKQzCIm2A
F3Ar57BlxFgoRjZ8fSQtO5R3GWXQwTBcmb9+g+SWK575YQ67ZxUqsdnqQOG3ifOV
J9fWJbKDgGQ04/aPfTq+zxJHKAhfKNHb/ALhifzgbMwvzPBeJnvA77WJI0KM6mZp
puGyLnCZlsufO4l4tDP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51MolW9g2kGFkQZx3kY8nuPeNlK66eAeCDO66DInNzF9+qTbZ
X6NfUO/Z6C2B9RWM0ZqwJAfbp87zJw==
-----END PRIVATE KEY-----
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Display Webcam Stream</title>
<style>
#container {
margin: 0px auto;
width: 500px;
height: 375px;
border: 10px #333 solid;
}
#videoElement {
width: 500px;
height: 375px;
background-color: #666;
}
</style>
</head>
<body>
<div id="container">
<video autoplay="true" id="videoElement"> <!-- style="visibility: hidden"-->
</video>
<canvas id='canvasOutput'>
</canvas>
</div>
<script type='text/javascript'>
var video = document.querySelector("#videoElement");
if (navigator.mediaDevices.getUserMedia){
navigator.mediaDevices.getUserMedia({ video: true })
.then(function (stream) {
video.srcObject = stream;
}).catch(function (err0r) {
console.log("Something went wrong!");
});
}
</script>
</body>
</html>