glenn-jocher
commited on
Commit
•
e5d7122
1
Parent(s):
1479737
Update README.md
Browse files
README.md
CHANGED
@@ -121,19 +121,18 @@ Done. (0.103s)
|
|
121 |
|
122 |
### PyTorch Hub
|
123 |
|
124 |
-
|
125 |
```python
|
126 |
import torch
|
127 |
|
128 |
# Model
|
129 |
model = torch.hub.load('ultralytics/yolov5', 'yolov5s')
|
130 |
|
131 |
-
#
|
132 |
-
|
133 |
-
imgs = [dir + f for f in ('zidane.jpg', 'bus.jpg')] # batch of images
|
134 |
|
135 |
# Inference
|
136 |
-
results = model(
|
137 |
results.print() # or .show(), .save()
|
138 |
```
|
139 |
|
|
|
121 |
|
122 |
### PyTorch Hub
|
123 |
|
124 |
+
Inference with YOLOv5 and [PyTorch Hub](https://github.com/ultralytics/yolov5/issues/36):
|
125 |
```python
|
126 |
import torch
|
127 |
|
128 |
# Model
|
129 |
model = torch.hub.load('ultralytics/yolov5', 'yolov5s')
|
130 |
|
131 |
+
# Image
|
132 |
+
img = 'https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg'
|
|
|
133 |
|
134 |
# Inference
|
135 |
+
results = model(img)
|
136 |
results.print() # or .show(), .save()
|
137 |
```
|
138 |
|