Make sure your python version >= 3.8 to run pytorch.
You can check your python version by running the following command:
python --versionBefore running the server, please make sure you have set up a virtual environment and installed the necessary dependencies. Here are the steps:
-
Activate the virtual environment:
source <venv_name>/bin/activate # for Linux/Mac <venv_name>/Scripts/activate # for Windows
-
Install PyTorch and torchvision: check installation command based on your machine here or just
pip install torch torchvision
-
Install Server dependencies:
pip install flask flask-cors numpy pillow pillow-heif
Once you have completed these steps, you are ready to run the server using the following command:
flask run