Skip to content

Commit

Permalink
add segformer
Browse files Browse the repository at this point in the history
  • Loading branch information
jimexist committed Mar 3, 2024
1 parent 6980774 commit 79fe76a
Show file tree
Hide file tree
Showing 8 changed files with 1,645 additions and 0 deletions.
23 changes: 23 additions & 0 deletions candle-examples/examples/segformer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# candle-segformer

- [HuggingFace Segformer Model Card][segformer]
- [`mit-b0` - An encoder only pretrained model][encoder]
- [`segformer-b0-finetuned-ade-512-512` - A fine tuned model for segmentation][ade512]

[segformer]: https://huggingface.co/docs/transformers/model_doc/segformer
[encoder]: https://huggingface.co/nvidia/mit-b0
[ade512]: https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512

## How to run

```bash
# run image classification task
cargo run --example segformer classify candle-examples/examples/segformer/assets/burger.jpg
```

Example output:

```text
classification logits [3.275261e-5, 0.0008562019, 0.0008868563, 0.9977506, 0.0002465068, 0.0002241473, 2.846596e-6]
label: hamburger
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 79fe76a

Please sign in to comment.