create .env.docker file from template; update environment variable values if needed
cp .env.docker.example .env.dockerbuild the Docker image
docker build -t biotune-ai .run the Docker container service
docker compose upcreate .env file from template; update environment variable values if needed
cp .env.example .envset up a dedicated virtual environment to run the service
# (install uv)
# curl -LsSf https://astral.sh/uv/install.sh | sh
# https://docs.astral.sh/uv/getting-started/installation/
uv python install 3.11
uv syncactivate the environment to run commands without the uv run prefix
source .venv/bin/activateinstall pre-commit git hook scripts
pre-commit installdownload default vit-h SAM model checkpoint
mkdir -p models
curl -OL https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth -o models/sam_vit_h_4b8939.pthstart the service
# development
fastapi dev --host 127.0.0.1 --port 54004 service.py
# production
uvicorn service:app --host 127.0.0.1 --port 54004segment image locally
# (activate project virtual environment)
source .venv/bin/activate
python segment.py -i <input image path> -o <output image path> -c <model checkpoint path> -m <model type>send test request to the service
IMAGE_PATH="<image path>"
curl -X POST "http://localhost:8000/process" \
-F "image=@$IMAGE_PATH" \
-F "filename=$(basename $IMAGE_PATH)"service documentation: http://127.0.0.1:54004/docs
NOTE: The service is designed to run locally and currently doesn't incorporate authentication or other security features.