fastapi-tator A RESTful API for bulk operations on a Tator database on clustered, labeled, localization data. It uses the Python web framework FastAPI.
This accelerates machine learning workflows that use clustered, labeled, localization data with foundational models.
It is currently live at http://mantis.shore.mbari.org:8001/docs.
This API can, for example,
- Get a list of all unique labels for a given project
- Change a localization label in a given sdcat generated cluster by query criteria, e.g. media (partial) name, model version
- Delete localizations with low saliency scores in a given project
- Report how many localizations for a given project are flagged for deletion
- Delete all localizations flagged for deletion in a given project
- Change a localization label for a particular database id
For deployment, you will need:
For development, you will need:
git clone https://github.com/mbari-org/fastapi-tator
cd fastapi-tator
make tator
Create an API token for a user with full admin and set that in the .env file along with the Tator server URL.
echo "TATOR_API_HOST=http://localhost" > .env
echo "TATOR_API_TOKEN=15a0f486cde0f09329b09f3274de1b962c2273a4" >> .env
./bin/docker_build.sh
./bin/run_prod.sh
Optionally, set the environment variable TATOR_DEFAULT_PROJECT
to the value of the project you would like to default to.
export TATOR_DEFAULT_PROJECT="901103-biodiversity"
Your server is now running at http://localhost:8000/docs
Open the browser to http://localhost:8000/docs to see the API documentation.
Check the health of the server by going to http://localhost:8000/health
. You should see the following response:
{"status":"ok"}
- https://github.com/mbari-org/sdcat [Sliced Detection and Clustering Analysis Toolkit]