Skip to content

RESTful API for bulk operations on a Tator database on clustered, labeled, localization data. It uses the Python web framework FastAPI.

License

Notifications You must be signed in to change notification settings

mbari-org/fastapi-tator

Repository files navigation

MBARI Python License

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

Requirements

For deployment, you will need:

For development, you will need:

Deployment

Clone the repository and run the docker compose file

git clone https://github.com/mbari-org/fastapi-tator
cd fastapi-tator
make tator

Fetch your API key for 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

tatorAPItoken

Build and start the docker containers

./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

Try it out

Open the browser to http://localhost:8000/docs to see the API documentation.

Health Check

Check the health of the server by going to http://localhost:8000/health. You should see the following response:

{"status":"ok"}

Related work

About

RESTful API for bulk operations on a Tator database on clustered, labeled, localization data. It uses the Python web framework FastAPI.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published