Use git to clone the repository:
git clone https://github.com/unica-isde/isde-projects-2024-F
Optional but recommended - create conda environment: https://docs.conda.io/projects/miniconda/en/latest/
conda create --name isde python=3.10
conda activate isde
And install the requirements with
pip install -r requirements.txt
Configure the service by editing the file config.py
.
It is recommended to pre-download images and models before running the server. This is to avoid unnecessary waits for users.
Run prepare_images.py
and prepare_models.py
. Models will
be stored in your PyTorch cache directory, while the path for
the image directory can be found in the config.py
file.
python app/prepare_images.py
python app/prepare_models.py
or
python -m app.prepare_images.py
python -m app.prepare_models.py
Since, for some reason, Sphinx was not satisfied with
the from config import Configuration
statement in those files,
we had to modify it to from .config import Configuration
.
However, this change may cause issues when running the previous commands,
so the use of the other two is recommended.
To run the code without containers, it is sufficient to run separately the server,
uvicorn main:app --reload