Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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.

License

Notifications You must be signed in to change notification settings

tungedng2710/Scene-change-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scene Change Detection

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.

Demo web app

Features

  • 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

Installation

Create a Python virtual environment and install the dependencies:

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Some packages (e.g. PyTorch models) can take a while to install. Alternatively, you can use the provided Dockerfile or docker-compose.yaml for a containerised setup.

Running the API

To launch the API locally after installing the requirements:

cd app
uvicorn main:app --host 0.0.0.0 --port 7866 --reload

Open your browser at http://localhost:7866 to access the demo page.

Docker

If you prefer Docker, build and run the image:

docker-compose up --build

API Usage

Send 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 "[email protected]" -F "[email protected]" http://localhost:7866/detect

License

This project is released under the MIT License. See LICENSE for details.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published