Hi,

Was there ever a time when you did something the hard way, only because you weren't aware that there was an easy way?

One of the great things about education is that it teaches you new ways, often more efficient ways, of doing things. It also teaches you how to go in search of new and more efficient methods. 

At PyImageSearch, we understand this, too. And we want to show you a more efficient way of programming code and machine learning research for reproducibility.

Maybe you created code and wanted to make it available for wide-scale use but worried that others would not produce the same results. Or you wondered about a certain program's code and wanted to attempt to reproduce it but didn't know where to start.

A few years ago, the creators of PyTorch designed Torch Hub as a library of resources that make reproducing machine learning research easier. 

Today, you're going to learn how to use PyTorch's Torch Hub to store and publish pre-trained models for wide-scale use.

The big picture: Torch Hub is an Application Programmable Interface (API) and workflow for easy research reproducibility. It hosts a variety of pre-trained models, such as the ones pictured above, that you can draw from when coding with Python.

In today's blog, you'll learn:

  • What Torch Hub is 
  • How to use Torch Hub's models on your projects
  • How to build a simple neural network using Torch Hub

How it works: Torch Hub gives you access to dozens of pre-trained models, saving you time and resources from having to train them yourself. Using the torch.hub.load() API, you can load a model entry point and build on it from there.

Stay smart: As with any program, Torch Hub does have some limitations. For one, you can't use it to load two branches of the same repository.

But if you are interested in creating reproducible code, you need to understand how Torch Hub works and get some hands-on practice.

Click here to read the full tutorial

PyImageSearch University

This lesson is part of PyImageSearch University, our flagship program to help you master computer vision, deep learning, and OpenCV.  PyImageSearch University is updated each week with new lessons.

Don't know Python?  No problem, we've got you covered with a short and sweet Python course to get you going.

Having problems with your local development environment or IDE?  Fortunately, our pre-configured Colab Notebooks mean you can run code the moment you join PyImageSearch University.  But of course, you don't want to be a sys-admin, so don't waste time messing with your development environment.  

You can find the current lesson under Torch Hub 101 —  Practical Applications of Torch Hub. The direct link can be found here.

Want to master computer vision and deep learning?

Do you think mastering computer vision and deep learning has to be time-consuming, overwhelming, and complicated? Or has to involve complex mathematics and equations? Or requires a degree in computer science?

That's not the case. All you need to master computer vision and deep learning is for someone to explain things to you in simple, intuitive terms. And that's exactly what we do. Our mission is to change education and how complex Artificial Intelligence topics are taught.

Inside PyImageSearch University, you'll find:

  • 30 courses on the hottest computer vision, deep learning, and OpenCV topics
  • 30 Certificates of Completion (one for each course)
  • 39+ hours of on-demand video
  • Pre-configured Jupyter Notebooks running in Google Colab
  • Run all code examples in your web browser — works on Windows, macOS, and Linux (no dev environment configuration required!)
  • Access to centralized code repos for all 500+ tutorials on the PyImageSearch blog
  • Easy one-click downloads for code, datasets, pre-trained models, etc.
  • Access on mobile, laptop, desktop, etc.
  • New courses released regularly, ensuring you can keep up with state-of-the-art techniques

Click here to join PyImageSearch University

PyImageSearch Team