nielsr HF staff commited on
Commit
f183d05
1 Parent(s): e2c7cf5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -4
README.md CHANGED
@@ -35,17 +35,17 @@ 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
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-small-300')
46
  model = YolosForObjectDetection.from_pretrained('hustvl/yolos-small-300')
47
 
48
- inputs = feature_extractor(images=image, return_tensors="pt")
49
  outputs = model(**inputs)
50
 
51
  # model predicts bounding boxes and corresponding COCO classes
@@ -53,7 +53,7 @@ logits = outputs.logits
53
  bboxes = outputs.pred_boxes
54
  ```
55
 
56
- Currently, both the feature extractor and model support PyTorch.
57
 
58
  ## Training data
59
 
 
35
  Here is how to use this model:
36
 
37
  ```python
38
+ from transformers import YolosImageProcessor, YolosForObjectDetection
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
+ image_processor = YolosImageProcessor.from_pretrained('hustvl/yolos-small-300')
46
  model = YolosForObjectDetection.from_pretrained('hustvl/yolos-small-300')
47
 
48
+ inputs = image_processor(images=image, return_tensors="pt")
49
  outputs = model(**inputs)
50
 
51
  # model predicts bounding boxes and corresponding COCO classes
 
53
  bboxes = outputs.pred_boxes
54
  ```
55
 
56
+ Currently, both the image processor and model support PyTorch.
57
 
58
  ## Training data
59