This project provides a small FastAPI service that detects changes between two images. It uses the Segment Any Change model to produce an overlay mask and can optionally describe the differences with a vision language model.
- REST API built with FastAPI
- Change detection using pre-trained Segment Any Change weights
- Optional description of changes via Gemini or Ollama
- Dockerfile and docker-compose configuration for GPU inference
Create a Python virtual environment and install the dependencies:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtSome packages (e.g. PyTorch models) can take a while to install. Alternatively, you can use the provided
Dockerfileordocker-compose.yamlfor a containerised setup.
To launch the API locally after installing the requirements:
cd app
uvicorn main:app --host 0.0.0.0 --port 7866 --reloadOpen your browser at http://localhost:7866 to access the demo page.
If you prefer Docker, build and run the image:
docker-compose up --buildSend a POST request to /detect with two image files (ref_img and test_img).
The response contains logs, the percentage of changed pixels and a link to the
mask overlay image.
Example using curl:
curl -F "ref_img=@ref.png" -F "test_img=@test.png" http://localhost:7866/detectThis project is released under the MIT License. See LICENSE for details.
