git clone https://github.com/wufan-tb/sam_with_dsdl.git
cd sam_with_dsdl
pip install git+https://github.com/facebookresearch/segment-anything.git
pip install opencv-python pycocotools matplotlib dsdl
please visit our opendatalab platform to download sam evaluation datasets and dsdl files into ./datasets
folder. after downlad and unzip process, the datasets folder should like this:
./datasets
├── ADE20K
│ ├── config.py
│ ├── defs
│ ├── README.md
│ ├── set-train
│ ├── set-val
│ └── tools
├── BBBC038v1
├── DOORS
├── DRAM
├── GTEA
├── iShape
├── LVIS
├── NDD20
├── NDISPark
├── OVIS
├── Plittersdorf
├── PPDLS
├── STREETS
├── TimberSeg
├── TrashCan
├── WoodScape
└── ZeroWaste-f
└── ...
default or vit_h: ViT-H SAM model.
vit_l: ViT-L SAM model.
vit_b: ViT-B SAM model.
to evaluate sam with python code, please change location config in ./data_cfgs.json
, you can also read our tutorials to get more details about how to load dataset in python code.
python evaluation_sa.py
notebook users can open evaluation_sa.ipynb
to read details about evaluation code.