/sa

A backend service which implement segment anything

Primary LanguagePythonMIT LicenseMIT

SA

A backend service which implement segment anything

Requirement environment

poetry installation guide: https://python-poetry.org/docs/#installation

Installation dependencies

poetry install

Configuration file

  • .env
# COS config
COS_SECRET_ID=<your cos secret id>
COS_SECRET_KEY=<your cos secret key>
COS_REGION=<your cos region>
COS_BUCKET=<your cos bucket>

# SAM
SAM_MODEL_CHECKPOINT=./sam_vit_h_4b8939.pth
SAM_MODEL_TYPE=vit_h

Start server

  • run with python
python main.py
  • run with uvicorn
uvicorn main:app --reload
  • run with poetry
poetry run uvicorn main:app --reload