SegFormer Finetuned for Seal Segmentation
BaseOn https://huggingface.co/nvidia/mit-b0
How to use
Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
from transformers import AutoImageProcessor, SegformerForSemanticSegmentation
from PIL import Image
import requests
image_processor = AutoImageProcessor.from_pretrained("Fantast/segformer-mit-b0-finetuned-for-seal")
model = SegformerForSemanticSegmentation.from_pretrained("Fantast/segformer-mit-b0-finetuned-for-seal")
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
inputs = image_processor(images=image, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits # shape (batch_size, num_labels, height/4, width/4)
list(logits.shape)
For more code examples, we refer to the documentation.
License The license for this model can be found here.
BibTeX entry and citation info @article{DBLP:journals/corr/abs-2105-15203, author = {Enze Xie and Wenhai Wang and Zhiding Yu and Anima Anandkumar and Jose M. Alvarez and Ping Luo}, title = {SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers}, journal = {CoRR}, volume = {abs/2105.15203}, year = {2021}, url = {https://arxiv.org/abs/2105.15203}, eprinttype = {arXiv}, eprint = {2105.15203}, timestamp = {Wed, 02 Jun 2021 11:46:42 +0200}, biburl = {https://dblp.org/rec/journals/corr/abs-2105-15203.bib}, bibsource = {dblp computer science bibliography, https://dblp.org} }
license: mit
- Downloads last month
- 4