This guide provides step-by-step instructions for setting up and running the face recognition server as part of the signage solution project. Follow these steps to ensure the server is configured and operational.
- Navigate to the Flask Directory:
cd signage_solution/flask
Note: It is important to use Python 3.9 for this setup. Using different versions, such as Python 3.11, has been known to cause errors, particularly during the Flask execution phase. To ensure compatibility and avoid potential issues, please stick to Python 3.9.
-
Check if Python 3.9 is installed by running:
python3.9 -V
If Python 3.9 is not installed, you can install it using Homebrew on MacOS or download it from the Python website for Windows users:
For MacOS:brew install [email protected]
For Windows:
- Download the Python 3.9 installer from the official Python website.
- Run the installer and follow the prompts to install Python 3.9.
-
After installing Python 3.9, go back to
/signage_solution/flask
directory and set up a virtual environment namedenv
using:python3.9 -m venv env
-
Activate the virtual environment with the following command: For MacOS/Linux
source env/bin/activate
For Windows
env\Scripts\activate
-
Install Dependencies in the virtual environment
pip install -r requirements.txt
-
Create a
.env
file in the/flask
directory. This file will store environment-specific variables, which are essential for configuring the server settings.Here is an example of what the contents of the
.env
file might look like:user=<database username> e.g. root password=<database password> e.g. pass host=<database host> e.g. localhost database_name=<database name> e.g. kioskDB korean_font_path=<path to Korean font file> e.g. /System/Library/Fonts/AppleSDGothicNeo.ttc
-
Setting Complete! if you want to deactivate the
env
virtual environment, run:deactivate
-
If
env
virtual environment is not activated run:
For MacOS/Linuxsource env/bin/activate
For Windows
env\Scripts\activate
-
Run:
python app.py
-
Complete! if you want to quit server and deactivate the
env
virtual environment,Ctrl+c
and run:deactivate