Learn practical skills, build real-world projects, and advance your career
import requests
from PIL import Image
from io import BytesIO
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import torch
from torchvision import  models
from torchvision import transforms
from torchvision.utils import save_image

Loading the Images

res = requests.get('https://raw.githubusercontent.com/soumyajit4419/Neural_Style_Transfer/master/Assets/football.jpg?token=AK7VCIENMHRCFSXQKMOBRFS7BMB5W')
content = Image.open(BytesIO(res.content)).convert('RGB')

res = requests.get('https://raw.githubusercontent.com/soumyajit4419/Neural_Style_Transfer/master/Assets/paint.jpg?token=AK7VCIENG2TVRZIG4B7WJPS7BMB7S')
style = Image.open(BytesIO(res.content)).convert('RGB')

Converting them to tensor