Skip to content

PacktPublishing/Modern-Computer-Vision-with-PyTorch-2E

Repository files navigation

Modern Computer Vision with PyTorch, Second Edition

This is the code repository for Modern Computer Vision with PyTorch, Second Edition, published by Packt.

A practical roadmap from deep learning fundamentals to advanced applications and Generative AI

V Kishore Ayyadevara, Yeshwanth Reddy

      Free PDF       Graphic Bundle       Amazon      

About the book

Unity Cookbook, Fifth Edition

Whether you are a beginner or are looking to progress in your computer vision career, this book guides you through the fundamentals of neural networks (NNs) and PyTorch and how to implement state-of-the-art architectures for real-world tasks.

The second edition of Modern Computer Vision with PyTorch is fully updated to explain and provide practical examples of the latest multimodal models, CLIP, and Stable Diffusion.

You’ll discover best practices for working with images, tweaking hyperparameters, and moving models into production. As you progress, you'll implement various use cases for facial keypoint recognition, multi-object detection, segmentation, and human pose detection. This book provides a solid foundation in image generation as you explore different GAN architectures. You’ll leverage transformer-based architectures like ViT, TrOCR, BLIP2, and LayoutLM to perform various real-world tasks and build a diffusion model from scratch. Additionally, you’ll utilize foundation models' capabilities to perform zero-shot object detection and image segmentation. Finally, you’ll learn best practices for deploying a model to production.

By the end of this deep learning book, you'll confidently leverage modern NN architectures to solve real-world computer vision problems.

Key Learnings

  • Get to grips with various transformer-based architectures for computer vision, CLIP, Segment-Anything, and Stable Diffusion, and test their applications, such as in-painting and pose transfer
  • Combine CV with NLP to perform OCR, key-value extraction from document images, visual question-answering, and generative AI tasks
  • Implement multi-object detection and segmentation
  • Leverage foundation models to perform object detection and segmentation without any training data points
  • Learn best practices for moving a model to production

Chapters

Chapters Colab Kaggle Gradient Studio Lab
Chapter 1: Artificial Neural Network Fundamentals
  • Back_propagation.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Chain_rule.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Feed_forward_propagation.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Gradient_descent.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Learning_rate.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 2: PyTorch Fundamentals
  • Auto_gradient_of_tensors.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Building_a_neural_network_using_PyTorch_on_a_toy_dataset.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Fetching_values_of_intermediate_layers.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Implementing_custom_loss_function.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Initializing_a_tensor.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Numpy_Vs_Torch_object_computation_speed_comparison.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Operations_on_tensors.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Sequential_method_to_build_a_neural_network.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Specifying_batch_size_while_training_a_model.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • save_and_load_pytorch_model.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 3: Building a Deep Neural Network with PyTorch
  • Batch_normalization.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Impact_of_building_a_deeper_neural_network.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Impact_of_dropout.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Impact_of_regularization.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Inspecting_color_images.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Inspecting_grayscale_images.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Learning_rate_annealing.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Preparing_our_data.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Scaling_the_dataset.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Steps_to_build_a_neural_network_on_FashionMNIST.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Varying_batch_size.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Varying_learning_rate_on_non_scaled_data.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Varying_learning_rate_on_scaled_data.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Varying_loss_optimizer.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 4: Introducing Convolutional Neural Networks
  • CNN_on_FashionMNIST.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • CNN_working_details.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Cats_Vs_Dogs.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Data_augmentation_with_CNN.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Image_augmentation.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Issues_with_image_translation.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Time_comparison_of_augmentation_scenario.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Visualizing_the_filters'_learning.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 5: Transfer Learning for Image Classification
  • 2D_and_3D_facial_keypoints.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Facial_keypoints_detection.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Implementing_ResNet18_for_image_classification.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Implementing_VGG16_for_image_classification.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Resnet_block_architecture.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • VGG_architecture.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • age_gender_prediction.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • age_gender_torch_snippets.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 6: Practical Aspects of Image Classification
  • Class_activation_maps.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Road_sign_detection.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 7: Basics of Object Detection
  • Calculating_intersection_over_union.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Training_Fast_R_CNN.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Training_RCNN.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Understanding_selectivesearch.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 8: Advanced Object Detection
  • Training_YOLO_v8.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Training_Faster_RCNN.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Training_SSD.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Training_YOLO.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 9: Image Segmentation
  • Instance_Segmentation.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Semantic_Segmentation_with_U_Net.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • predicting_multiple_instances_of_multiple_classes.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 10: Applications of Object Detection and Segmentation
  • Human_pose_detection.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Image_colorization.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Multi_object_segmentation.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • action_recognition.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • crowd_counting.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 11: Autoencoders and Image Manipulation
  • Generating_deep_fakes.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • VAE.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • adversarial_attack.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • conv_auto_encoder.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • neural_style_transfer.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • simple_auto_encoder_with_different_latent_size.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 12: Image Generation Using GANs
  • Face_generation_using_Conditional_GAN.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Face_generation_using_DCGAN.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Handwritten_digit_generation_using_GAN.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 13: Advanced GANs to Manipulate Images
  • Customizing_StyleGAN2.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • CycleGAN.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Image_super_resolution_using_SRGAN.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • pix2pix.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 14: Combining Computer Vision and Reinforcement Learning
  • Building_Q_table.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Deep_Q_Learning_Cart_Pole_balancing.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Pong_Deep_Q_Learning_with_Fixed_targets.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Understanding_the_Gym_environment.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • train-self-driving-agent.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 15: Combining Computer Vision and NLP Techniques
  • LayoutLMv3_passports.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Handwriting_transcription.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Image_captioning.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Object_detection_with_DETR.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • TrOCR_fine_tuning.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • ViT_Image_classification.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Visual_Question_answering.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • self-attention.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • transformers-from-scratch.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 16: Foundation Models in Computer Vision
  • CLIP_from_scratch.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Conditional_Diffuser_training.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Diffusion_Pytorch.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • FastSAM.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • ImageBind.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • OpenAI_clip.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • SAM.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • SAMTrack.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Stable_Diffusion_pipeline.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Unet_Components_from_scratch.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 17: Applications of Stable Diffusion
  • ControlNet-Inference.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Depth-to-Image.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Image-Inpainting.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • SDXL-Turbo.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • Text-Image-to-Video.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 18: Moving a Model to Production
  • convert_to_onnx.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • measuring_drift.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • quantization.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
  • vector_stores.ipynb
Open In Colab
Open In Kaggle
Open In Gradient
Open In Studio Lab
Chapter 19: Appendix

Requirements for this book

Chapter Software required OS required
1 - 18 Minimum 8 GB RAM, Intel i5 processor or better Windows, Mac OS X, and Linux (Any)
NVIDIA 8+ GB graphics card – GTX1070 or better
Minimum 50 Mbps internet speed
Python 3.6 and above
PyTorch 1.7
Google Colab (can run in any browser)

Get to know Authors

V Kishore Ayyadevara Kishore Ayyadevara is an entrepreneur and a hands-on leader working at the intersection of technology, data, and AI to identify and solve business problems. With over a decade of experience in leadership roles, Kishore has established and grown successful applied data science teams at American Express and Amazon, as well as a top health insurance company. In his current role, he is building a start-up focused on making AI more accessible to healthcare organizations. Outside of work, Kishore has shared his knowledge through his five books on ML/AI, is an inventor with 12 patents, and has been a speaker at multiple AI conferences.

Yeshwanth Reddy Yeshwanth Reddy is a highly accomplished data scientist manager with 9+ years of experience in deep learning and document analysis. He has made significant contributions to the field, including building software for end-to-end document digitization, resulting in substantial cost savings. Yeshwanth's expertise extends to developing modules in OCR, word detection, and synthetic document generation. His groundbreaking work has been recognized through multiple patents. He has also created a few Python libraries. With a passion for disrupting unsupervised and self-supervised learning, Yeshwanth is dedicated to reducing reliance on manual annotation and driving innovative solutions in the field of data science.

Other Related Books

About

Modern Computer Vision with PyTorch, 2E, Published by Packt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published