Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Language Segment-Anything

English | 中文

This is a MindSpore Implementation of Language SAM.

Language SAM is built on Meta model, Segment Anything Model 2, and the GroundingDINO detection model. Is can be used for object detection and image segmentation given text prompt.

Lang_SAM

📦 Requirements

mindspore ascend driver cann
>=2.6.0 >=24.1.RC1 >=8.1.RC1
  1. Install CANN 8.1.RC1 and MindSpore according to the official instructions.
  2. Install requirements
    cd examples/lang_sam
    pip install -r requirements.txt
  3. Install mindone
    cd mindone
    pip install -e .
    
    Try python -c "import mindone". If no error occurs, the installation is successful.

🔆 Features

  • 📍 Language SAM with the following features
    • ✅ Prediction of masks given a static image and a textual prompt.

You contributions are welcome.

🚀 Quick Start

Checkpoints

Please download checkpoints using:

cd checkpoints && \
./download_ckpts.sh && \
cd ..

Image Prediction

predict_image.py is a script to infer the mask given an input image and a text prompt. Please download the images for inference first:

mkdir -p assets
wget -P assets https://raw.githubusercontent.com/luca-medeiros/lang-segment-anything/refs/heads/main/assets/car.jpeg

Then run python predict_image.py.