Learn practical skills, build real-world projects, and advance your career

Due to the lack of GPU on my local machine, I used Google Colab for this part of the code as it involves training the model with a ResNet-50 architecture.

I then saved the model and tested it with real time data on my local machine.

import torch
print(torch.__version__)
1.6.0+cu101
pip install jovian --upgrade --quiet
pip install xmltodict
Collecting xmltodict Downloading https://files.pythonhosted.org/packages/28/fd/30d5c1d3ac29ce229f6bdc40bbc20b28f716e8b363140c26eff19122d8a5/xmltodict-0.12.0-py2.py3-none-any.whl Installing collected packages: xmltodict Successfully installed xmltodict-0.12.0
import os
import cv2
import xmltodict
import numpy as np
import torch 
import torchvision.transforms as tt
import torchvision.datasets 
from torchvision.datasets import ImageFolder
from torch.utils.data.dataloader import DataLoader
import torch.nn.functional as F
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
import jovian