mistake feature_extractor should be processor
#9
by
hugpowr
- opened
README.md
CHANGED
@@ -41,7 +41,7 @@ model = SegformerForSemanticSegmentation.from_pretrained("nvidia/segformer-b0-fi
|
|
41 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
42 |
image = Image.open(requests.get(url, stream=True).raw)
|
43 |
|
44 |
-
inputs =
|
45 |
outputs = model(**inputs)
|
46 |
logits = outputs.logits # shape (batch_size, num_labels, height/4, width/4)
|
47 |
```
|
|
|
41 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
42 |
image = Image.open(requests.get(url, stream=True).raw)
|
43 |
|
44 |
+
inputs = processor(images=image, return_tensors="pt")
|
45 |
outputs = model(**inputs)
|
46 |
logits = outputs.logits # shape (batch_size, num_labels, height/4, width/4)
|
47 |
```
|