In this post, I will share how to deploy a pre-trained model to a locally hosted computer with Flask, OpenCV and Keras. I initially deployed this model on PythonAnywhere using Flask, Keras and jquery. The application was designed for remote school classroom or workplace settings that require students or employees to shave their facial hair.

The application allowed users to upload a photo, and click a button to send a post request with the encoded image data to the backend of the website. The image transformation and classification were handled on the backend, and the results were returned to the front-end in an html response. The response updated the page dynamically, as Shaved or Unshaved.

The backend of the application was built in Flask, but I wanted to allow a live video stream that would detect a user’s face, labeling the classification on screen. So since I already had a model and a basic Flask framework, I wanted to use OpenCV to do the rest on my local machine.

#python #opencv #flask #keras #computer-vision

How to Deploy a Pre-trained Keras Model with OpenCV and Flask
7.00 GEEK