Skip to content

Commit

Permalink
add demo
Browse files Browse the repository at this point in the history
  • Loading branch information
FengLi-ust committed Jul 17, 2023
1 parent 986fe98 commit 4432ca3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ __pycache__
*/__pycache__
*/*/__pycache__
*/*/*/__pycache__
.gitignore
.gitattributes
*.gitignore
*.gitattributes
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ The currently released checkpoints are only trained with SA-1B data.

</tbody></table>

### Demo
For interactive segmentation.
```shell
python demo.py
```
For mask auto-generation.
```shell
python demo_auto_generation.py
```

### Evaluation
We do zero-shot evaluation on COCO val2017.
`$n` is the number of gpus you use
Expand Down Expand Up @@ -120,13 +130,7 @@ python train_net.py --resume --num-gpus $n --config-file configs/semantic_sam_o
python train_net.py --resume --num-gpus $n --config-file configs/semantic_sam_reproduce_sam_swinL.yaml COCO.TEST.BATCH_SIZE_TOTAL=$n SAM.TEST.BATCH_SIZE_TOTAL=$n SAM.TRAIN.BATCH_SIZE_TOTAL=$n MODEL.WEIGHTS=/path/to/weights
```
This is a swinL backbone. The only difference of this script is to use many-to-one matching and 3 prompts as in SAM.
### Demo
```shell
python demo.py
```
```shell
python demo_auto_generation.py
```

## Comparison with SAM and SA-1B Ground-truth
![compare_sam_v3](https://github.com/UX-Decoder/Semantic-SAM/assets/34880758/6c7b50eb-6fe4-4a4f-b3cb-71920e30193e)

Expand Down

0 comments on commit 4432ca3

Please sign in to comment.