Skip to content

brkyzdmr/segment-anything-flask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask Application of Meta's Segment Anything Model

Official Project Page: https://github.com/facebookresearch/segment-anything.git

This is a Flask application that implements Meta's Segment Anything Model for segmenting images by mouse click in real-time performance. There are 3 images in the project, they will sequentially load, and you will interact with them by mouse click.

Requirements

To install the necessary Python packages, run the following command:

pip install -r requirements.txt

If you want to use your CUDA cores, you can download the necessary toolkit with the following command (default is CPU):

conda install -c anaconda cudatoolkit=11.8

Installing Models

ViT-H SAM model (default) - 2.4 GB ViT-L SAM model - 1.2 GB ViT-B SAM model - 358 MB

Configuration

There is a file called config.yaml, where you can set your configs.

checkpoint: 'models\sam_vit_h_4b8939.pth'
onnx_model: 'models\sam_onnx_quantized_example.onnx'
images_folder: 'static\images'
model_type: 'default'

Running the Application

By default, the application runs in Onnx runtime, which provides real-time execution performance. To run the application, execute the following command:

flask --app app.py run

Examples

People

Istanbul

Book Shelf

About

Flask implementation of Meta's Segment Anything Model.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published