Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shawonis08/07a418a894f0386595b8cdd1b21fb925 to your computer and use it in GitHub Desktop.
Save shawonis08/07a418a894f0386595b8cdd1b21fb925 to your computer and use it in GitHub Desktop.
Loading custom trained model weights using pytorch hub
model = torch.hub.load('ultralytics/yolov5', 'custom', path='path/to/best.pt') # default
model = torch.hub.load('path/to/yolov5', 'custom', path='path/to/best.pt', source='local') # local repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment