two changes have to made to remove deprecation warning. DPTFeatureExtractor has to be replaced by DPTImageProcessor in two locations
#4
by
Chesebrough
- opened
README.md
CHANGED
@@ -36,14 +36,14 @@ fine-tuned versions on a task that interests you.
|
|
36 |
Here is how to use this model:
|
37 |
|
38 |
```python
|
39 |
-
from transformers import
|
40 |
from PIL import Image
|
41 |
import requests
|
42 |
|
43 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
44 |
image = Image.open(requests.get(url, stream=True).raw)
|
45 |
|
46 |
-
feature_extractor =
|
47 |
model = DPTForSemanticSegmentation.from_pretrained("Intel/dpt-large-ade")
|
48 |
|
49 |
inputs = feature_extractor(images=image, return_tensors="pt")
|
|
|
36 |
Here is how to use this model:
|
37 |
|
38 |
```python
|
39 |
+
from transformers import DPTImageProcessor , DPTForSemanticSegmentation
|
40 |
from PIL import Image
|
41 |
import requests
|
42 |
|
43 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
44 |
image = Image.open(requests.get(url, stream=True).raw)
|
45 |
|
46 |
+
feature_extractor = DPTImageProcessor.from_pretrained("Intel/dpt-large-ade")
|
47 |
model = DPTForSemanticSegmentation.from_pretrained("Intel/dpt-large-ade")
|
48 |
|
49 |
inputs = feature_extractor(images=image, return_tensors="pt")
|