-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
2,050 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
datasets/* | ||
*.pkl | ||
*.bak | ||
*.sh | ||
*pth | ||
aws* | ||
.ipynb_checkpoints* | ||
temp* | ||
count* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Evaluation SAM with DSDL | ||
|
||
![demo](demo.png) | ||
|
||
## steps | ||
|
||
### 1. install | ||
|
||
``` | ||
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 | ||
``` | ||
|
||
### 2. prepare dsdl datasets | ||
|
||
please visit our [opendatalab](https://opendatalab.com/) 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 | ||
└── ... | ||
``` | ||
|
||
### 3. download sam model | ||
|
||
default or vit_h: [ViT-H SAM model](https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth). | ||
|
||
vit_l: [ViT-L SAM model](https://dl.fbaipublicfiles.com/segment_anything/sam_vit_l_0b3195.pth). | ||
|
||
vit_b: [ViT-B SAM model](https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth). | ||
|
||
|
||
### 3. set location config | ||
|
||
to evaluate sam with python code, please change location config in `./data_cfgs.json`, you can also read our [tutorials](https://opendatalab.github.io/dsdl-docs/getting_started/quick_start/) to get more details about how to load dataset in python code. | ||
|
||
### 4. evaluation sam | ||
|
||
``` | ||
python evaluation_sa.py | ||
``` | ||
notebook users can open `evaluation_sa.ipynb` to read details about evaluation code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
{ | ||
"cfgs": [ | ||
{ | ||
"data_name": "BBBC038v1", | ||
"split": "stage1_train", | ||
"dsdl_dir": "datasets/BBBC038v1", | ||
"working_dir": "s3://dsdl_bucket/segmentation/simple_version/BBBC038v1/prepared", | ||
"petrel_cfg": "~/petreloss.conf", | ||
"sample_nums": 227 | ||
}, | ||
{ | ||
"data_name": "DOORS", | ||
"split": "DS1_T", | ||
"dsdl_dir": "datasets/DOORS", | ||
"working_dir": "s3://dsdl_bucket/segmentation/simple_version/DOORS/prepared", | ||
"petrel_cfg": "~/petreloss.conf", | ||
"sample_nums": 10000 | ||
}, | ||
{ | ||
"data_name": "TimberSeg", | ||
"split": "original", | ||
"dsdl_dir": "datasets/TimberSeg", | ||
"working_dir": "s3://dsdl_bucket/segmentation/simple_version/TimberSeg/original", | ||
"petrel_cfg": "~/petreloss.conf", | ||
"sample_nums": 220 | ||
}, | ||
{ | ||
"data_name": "NDD20", | ||
"split": "ABOVE", | ||
"dsdl_dir": "datasets/NDD20", | ||
"working_dir": "s3://dsdl_bucket/segmentation/simple_version/NDD20/prepared", | ||
"petrel_cfg": "~/petreloss.conf", | ||
"sample_nums": 4402 | ||
}, | ||
{ | ||
"data_name": "LVIS", | ||
"split": "val", | ||
"dsdl_dir": "datasets/LVIS", | ||
"working_dir": "s3://dsdl_bucket/segmentation/simple_version/LVIS/original", | ||
"petrel_cfg": "~/petreloss.conf", | ||
"sample_nums": 945 | ||
}, | ||
{ | ||
"data_name": "STREETS", | ||
"split": "train", | ||
"dsdl_dir": "datasets/STREETS", | ||
"working_dir": "s3://dsdl_bucket/segmentation/simple_version/STREETS/prepared", | ||
"petrel_cfg": "~/petreloss.conf", | ||
"sample_nums": 819 | ||
}, | ||
{ | ||
"data_name": "ZeroWaste-f", | ||
"split": "train", | ||
"dsdl_dir": "datasets/ZeroWaste-f", | ||
"working_dir": "s3://dsdl_bucket/segmentation/simple_version/ZeroWaste-f/original", | ||
"petrel_cfg": "~/petreloss.conf", | ||
"sample_nums": 2947 | ||
}, | ||
{ | ||
"data_name": "iShape", | ||
"split": "antenna_train", | ||
"dsdl_dir": "datasets/iShape", | ||
"working_dir": "s3://dsdl_bucket/segmentation/simple_version/iShape/prepared", | ||
"petrel_cfg": "~/petreloss.conf", | ||
"sample_nums": 754 | ||
}, | ||
{ | ||
"data_name": "OVIS", | ||
"split": "train", | ||
"dsdl_dir": "datasets/OVIS", | ||
"working_dir": "s3://dsdl_bucket/segmentation/simple_version/OVIS/prepared", | ||
"petrel_cfg": "~/petreloss.conf", | ||
"sample_nums": 2044 | ||
}, | ||
{ | ||
"data_name": "NDISPark", | ||
"split": "train", | ||
"dsdl_dir": "datasets/NDISPark", | ||
"working_dir": "s3://dsdl_bucket/segmentation/simple_version/NDISPark/original", | ||
"petrel_cfg": "~/petreloss.conf", | ||
"sample_nums": 111 | ||
}, | ||
{ | ||
"data_name": "Plittersdorf", | ||
"split": "test", | ||
"dsdl_dir": "datasets/Plittersdorf", | ||
"working_dir": "s3://dsdl_bucket/segmentation/simple_version/Plittersdorf/original", | ||
"petrel_cfg": "~/petreloss.conf", | ||
"sample_nums": 187 | ||
}, | ||
{ | ||
"data_name": "TrashCan", | ||
"split": "instance_train", | ||
"dsdl_dir": "datasets/TrashCan", | ||
"working_dir": "s3://dsdl_bucket/segmentation/simple_version/TrashCan/original", | ||
"petrel_cfg": "~/petreloss.conf", | ||
"sample_nums": 5936 | ||
}, | ||
|
||
{ | ||
"data_name": "DRAM", | ||
"split": "impressionism", | ||
"dsdl_dir": "datasets/DRAM", | ||
"working_dir": "s3://myBuck/evaluation_datasest/SAM/DRAM/prepared", | ||
"petrel_cfg": "~/petreloss_liushuo.conf", | ||
"sample_nums": 718 | ||
}, | ||
{ | ||
"data_name": "GTEA", | ||
"split": "train", | ||
"dsdl_dir": "datasets/GTEA", | ||
"working_dir": "s3://myBuck/evaluation_datasest/SAM/GTEA/prepared", | ||
"petrel_cfg": "~/petreloss_liushuo.conf", | ||
"sample_nums": 652 | ||
} | ||
] | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.