load_url_image#

deepinv.utils.load_url_image(url=None, img_size=None, grayscale=False, resize_mode='crop', device='cpu', dtype=torch.float32)[source]#

Load an image from a URL and return a torch.Tensor.

Parameters:
  • url (str) – URL of the image file.

  • img_size (int, tuple[int]) – Size of the image to return.

  • grayscale (bool) – Whether to convert the image to grayscale.

  • resize_mode (str) – If img_size is not None, options are "crop" or "resize".

  • device (str) – Device on which to load the image (gpu or cpu).

Returns:

torch.Tensor containing the image.

Examples using load_url_image:#

Reconstructing an image using the deep image prior.

Reconstructing an image using the deep image prior.

Pattern Ordering in a Compressive Single Pixel Camera

Pattern Ordering in a Compressive Single Pixel Camera

Building your custom MCMC sampling algorithm.

Building your custom MCMC sampling algorithm.

Image reconstruction with a diffusion model

Image reconstruction with a diffusion model

Uncertainty quantification with PnP-ULA.

Uncertainty quantification with PnP-ULA.