IssueRaiser

Load YOLOv5 from PyTorch Hub โญ

๐Ÿ“š This guide explains how to load YOLOv5 ๐Ÿš€ from PyTorch Hub https://pytorch.org/hub/ultralytics_yolov5. See YOLOv5 [Docs](https://docs.ultralytics.com) for additional details. UPDATED 26 March 2023. ## Before You Start Install [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) in a [**Python>=3.7.0**](https://www.python.org/) environment, including [**PyTorch>=1.7**](https://pytorch.org/get-started/locally/). [Models](https://github.com/ultralytics/yolov5/tree/master/models) and [datasets](https://github.com/ultralytics/yolov5/tree/master/data) download automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases). ```bash pip install -r https://raw.githubusercontent.com/ultralytics/yolov5/master/requirements.txt ``` ๐Ÿ’ก ProTip: Cloning [https://github.com/ultralytics/yolov5](https://github.com/ultralytics/yolov5) is **not** required ๐Ÿ˜ƒ ## Load YOLOv5 with PyTorch Hub ### Simple Example This example loads a pretrained YOLOv5s model from PyTorch Hub as `model` and passes an image for inference. `'yolov5s'` is the lightest and fastest YOLOv5 model. For details on all available models please see the [README](https://github.com/ultralytics/yolov5#pretrained-checkpoints). ```python import torch # Model model = torch.hub.load('ultralytics/yolov5', 'yolov5s') # Image im = 'https://ultralytics.com/images/zidane.jpg' # Inference results = model(im) results.pandas().xyxy[0] # xmin ymin xmax ym

Posted by glenn-jocher on Jun 11, 2020, 4:14 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments

onboarding (Software)

Load YOLOv5 from PyTorch Hub โญ

glenn-jocherJun 11, 2020, 4:14 AM

๐Ÿ“š This guide explains how to load YOLOv5 ๐Ÿš€ from PyTorch Hub https://pytorch.org/hub/ultralytics_yolov5. See YOLOv5 [Docs](https://docs.ultralytics.com) for additional details. UPDATED 26 March 2023. ## Before You Start Install [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) in a [**Python>=3.7.0**](https://www.python.org/) environment, including [**PyTorch>=1.7**](https://pytorch.org/get-started/locally/). [Models](https://github.com/ultralytics/yolov5/tree/master/models) and [datasets](https://github.com/ultralytics/yolov5/tree/master/data) download automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases). ```bash pip install -r https://raw.githubusercontent.com/ultralytics/yolov5/master/requirements.txt ``` ๐Ÿ’ก ProTip: Cloning [https://github.com/ultralytics/yolov5](https://github.com/ultralytics/yolov5) is **not** required ๐Ÿ˜ƒ ## Load YOLOv5 with PyTorch Hub ### Simple Example This example loads a pretrained YOLOv5s model from PyTorch Hub as `model` and passes an image for inference. `'yolov5s'` is the lightest and fastest YOLOv5 model. For details on all available models please see the [README](https://github.com/ultralytics/yolov5#pretrained-checkpoints). ```python import torch # Model model = torch.hub.load('ultralytics/yolov5', 'yolov5s') # Image im = 'https://ultralytics.com/images/zidane.jpg' # Inference results = model(im) results.pandas().xyxy[0] # xmin ymin xmax ym

Comments (0)

No comments yet. Start the discussion.

Comment on this issue