Recommended to use uv to manage virtual environment and pip packages.
Create virtual environment:
uv venvInstall dependencies:
uv pip install -r requirements.txtNote: The following names and passwords are only for development purposes, and will be different in production.
Create a PostgreSQL database with PostGIS enabled, then set:
docker run --name utd-postgis \
-e POSTGRES_USER=utd \
-e POSTGRES_PASSWORD=utdpass \
-e POSTGRES_DB=utd_data \
-p 5432:5432 \
-d postgis/postgis:16-3.4If this not the first time running, use now:
docker start utd-postgisMake sure your environment has the variable DATABASE_URL which corresponds to the new DB.
export DATABASE_URL='postgresql+psycopg://utd:utdpass@localhost:5432/utd_data'Run both parsing and DB loading in one command:
python3 util/preprocess-data.py ../test_images_labels_targets/test --output data-exampleIf parsed images are not under data-example, point the API to the parser output root:
export PARSED_DATA_DIR='data-example'uvicorn app.main:app --reload