From the course: Hands-On Introduction to PyTorch for Machine Learning

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

TorchVision for video and image understanding

TorchVision for video and image understanding - PyTorch Tutorial

From the course: Hands-On Introduction to PyTorch for Machine Learning

TorchVision for video and image understanding

- [Instructor] Now that you have a good understanding of the TorchVision library, let's walk through a lab, continuing with the use case of Piraeus. When presenting learning materials to students, we sometimes need to process the original images to achieve certain visual effects. We'll use the TorchVision image library together with large language models, LLMs, to generate captions and try a few transformation actions. First, let's show a caption generation example, use TorchVision and large language model. Step zero, we'll load some packages, including torch, torchvision, and image process, PIL, as well as transformers. Next step, we'll process the image, use TorchVision. Step two, we'll load the LLM from huggingface transformers. Here, we use a model from image caption from Salesforce. Next, we'll generate the caption. The caption reads, "a large, brown, and white vase with geometric designs," which is…

Contents