Auto Generated Code Documentation

created on May 13, 2019

@author: Fiorella Tenorio, Chris Olley, Luke Qi, Randy Ma, Byron Han, Julia Tavares

class app.routes.UploadFileForm(formdata=<object object>, **kwargs)[source]

Class for uploading file when submitted

file_selector = <UnboundField(FileField, ('File',), {'validators': [<flask_wtf.file.FileRequired object>]})>
submit = <UnboundField(SubmitField, ('Submit',), {})>
app.routes.demo()[source]

Test page for demo

app.routes.get_user_div(counter)[source]

Displays registered users

app.routes.image()[source]

Tests capturing images directly from webcam

app.routes.list_images()[source]

Get a list of images to search

app.routes.login()[source]

User login page

app.routes.main_page()[source]

Main page of the application

app.routes.new_user_form()[source]

Allows a new user to register

app.routes.svg()[source]

Add the svg overlay to stream

app.routes.test_stream()[source]

Test page for stream

app.routes.unauthorized(e)[source]

Handle login errors

app.routes.upload(name, listfile)[source]

Upload a file from a client machine.

app.routes.user_names()[source]

Return user names div

class app.classes.User(name, username, email, password)[source]

Class to store user information

check_password(password)[source]
email
id
name
password_hash
set_password(password)[source]
username
app.classes.load_user(id)[source]

Route to load a user from the user database

face_detection_process.align_face(img, pnet, rnet, onet)[source]

Detect and align faces from a frame, returning the detected faces and the bounding boxes for the faces.

face_detection_process.identify_person(image_vector, feature_names, feature_np, k=9)[source]

Calculates the Euclidean distance between a face embedding and the stored embeddings, returning the identity of the stored embedding most similar to the face embedding and the distance between these embeddings.

face_detection_process.load_and_align_data(image_paths, image_size=160, margin=44)[source]

Load user images and detect faces. Returns processed images with faces detected in them.

face_detection_process.load_img(img, do_random_crop, do_random_flip, image_size, do_prewhiten=True)[source]

Process the captured images from the webcam, prewhitening, cropping and flipping as required. Returns processed image.

face_detection_process.resize_image(img, image_size, do_prewhiten=True)[source]

Processes a single image by whitening and cropping

face_detection_process.write_svg_facenet(stream_url)[source]

Reads an alternative facenet model, and connects to the in-memory Redis database. Detects faces (no identification) in the specified stream and calculates the corresponding bounding boxes. Writes the bounding boxes for all detected faces to an svg overlay which is then saved to Redis to be accessed by other processes.

face_detection_process.write_svg_facenet_emb(stream_url)[source]

Reads the facenet model and the saved embeddings from disk, and connects to the in-memory Redis database. Detects faces in the specified stream and calculates the corresponding bounding boxes. Writes the bounding boxes for all detected and identified faces to an svg overlay which is then saved to Redis to be accessed by other processes.

yolo_detection_process.draw_svg(boxes, frame, cls_names, detection_size, is_letter_box_image=True)[source]

Draw svg

yolo_detection_process.yolo_write_svg(stream_url)[source]

Write the svg