Skip to content

Instantly share code, notes, and snippets.

@pranjalAI
Created April 12, 2021 13:55
Show Gist options
  • Save pranjalAI/665f6e35be3994a5850129ed3d753673 to your computer and use it in GitHub Desktop.
Save pranjalAI/665f6e35be3994a5850129ed3d753673 to your computer and use it in GitHub Desktop.
url = 'https://images.pexels.com/photos/5045947/pexels-photo-5045947.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260' #@param {type:"string"}
response = requests.get(url)
img = PIL.Image.open(BytesIO(response.content)).convert("RGB")
img_t = T.ToTensor()(img)
img_fast = Image(img_t)
show_image(img_fast, figsize=(8,8), interpolation='nearest');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment