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)
Minecraft Dungeons II (1912410)
We are seeing the realtime result of MS buying Github and buying influence.
macOS 15 Sequoia clobbers _nixbld1-4 users
News + Polls
Implement Pylint
Add Zig
Unable to run sandboxed process when run as elevated under applocker
[Feature request] Show browser error overlay for runtime errors
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
Comments (0)
No comments yet. Start the discussion.