srinivasgs commited on
Commit
bbd712b
1 Parent(s): 199695c

swtiched to YolosImageProcessor

Browse files
Files changed (1) hide show
  1. README.md +5 -5
README.md CHANGED
@@ -35,18 +35,18 @@ You can use the raw model for object detection. See the [model hub](https://hugg
35
  Here is how to use this model:
36
 
37
  ```python
38
- from transformers import YolosFeatureExtractor, YolosForObjectDetection, AutoImageProcessor
39
  from PIL import Image
 
40
  import requests
41
 
42
- url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
43
  image = Image.open(requests.get(url, stream=True).raw)
44
 
45
- feature_extractor = YolosFeatureExtractor.from_pretrained('hustvl/yolos-tiny')
46
  model = YolosForObjectDetection.from_pretrained('hustvl/yolos-tiny')
47
- image_processor = AutoImageProcessor.from_pretrained("hustvl/yolos-tiny")
48
 
49
- inputs = feature_extractor(images=image, return_tensors="pt")
50
  outputs = model(**inputs)
51
 
52
  # model predicts bounding boxes and corresponding COCO classes
 
35
  Here is how to use this model:
36
 
37
  ```python
38
+ from transformers import YolosImageProcessor, YolosForObjectDetection
39
  from PIL import Image
40
+ import torch
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
  model = YolosForObjectDetection.from_pretrained('hustvl/yolos-tiny')
47
+ image_processor = YolosImageProcessor.from_pretrained("hustvl/yolos-tiny")
48
 
49
+ inputs = image_processor(images=image, return_tensors="pt")
50
  outputs = model(**inputs)
51
 
52
  # model predicts bounding boxes and corresponding COCO classes