From c5c373b86094f016ffe3a8b15046b4e37e673448 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 15 Apr 2021 16:45:50 +0200 Subject: [PATCH] Update README.md (cherry picked from commit e5d71223b83b9de2911a3d53685de6a20a2dc0f1) --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3de9271232c1..27ea18da1932 100644 --- a/README.md +++ b/README.md @@ -121,19 +121,18 @@ Done. (0.103s) ### PyTorch Hub -To run **batched inference** with YOLOv5 and [PyTorch Hub](https://github.com/ultralytics/yolov5/issues/36): +Inference with YOLOv5 and [PyTorch Hub](https://github.com/ultralytics/yolov5/issues/36): ```python import torch # Model model = torch.hub.load('ultralytics/yolov5', 'yolov5s') -# Images -dir = 'https://github.com/ultralytics/yolov5/raw/master/data/images/' -imgs = [dir + f for f in ('zidane.jpg', 'bus.jpg')] # batch of images +# Image +img = 'https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg' # Inference -results = model(imgs) +results = model(img) results.print() # or .show(), .save() ```