Update README.md
Browse files
README.md
CHANGED
|
@@ -31,11 +31,11 @@ You can use the raw model for semantic segmentation. See the [model hub](https:/
|
|
| 31 |
Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
|
| 32 |
|
| 33 |
```python
|
| 34 |
-
from transformers import
|
| 35 |
from PIL import Image
|
| 36 |
import requests
|
| 37 |
|
| 38 |
-
|
| 39 |
model = SegformerForSemanticSegmentation.from_pretrained("nvidia/segformer-b0-finetuned-ade-512-512")
|
| 40 |
|
| 41 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
|
|
|
| 31 |
Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
|
| 32 |
|
| 33 |
```python
|
| 34 |
+
from transformers import SegformerImageProcessor, SegformerForSemanticSegmentation
|
| 35 |
from PIL import Image
|
| 36 |
import requests
|
| 37 |
|
| 38 |
+
processor = SegformerImageProcessor.from_pretrained("nvidia/segformer-b0-finetuned-ade-512-512")
|
| 39 |
model = SegformerForSemanticSegmentation.from_pretrained("nvidia/segformer-b0-finetuned-ade-512-512")
|
| 40 |
|
| 41 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|