from flask import Flask, jsonify
|
from face_detector import FaceDetector
|
import cv2
|
|
app = Flask(__name__)
|
|
@app.route('/perform_face_detection', methods=['GET'])
|
def perform_face_detection():
|
cap = cv2.VideoCapture(0)
|
win_width = 640
|
win_height = 480
|
detector = FaceDetector(cap, win_width, win_height)
|
result = detector.detect_face_local()
|
cap.release()
|
return jsonify({"is_live": result})
|
|
if __name__ == '__main__':
|
app.run(debug=False, host='127.0.0.1', port=5000)
|