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.

Image transforms for equivariance & augmentations

Image transforms for equivariance & augmentations

A tour of forward sensing operators

A tour of forward sensing operators

A tour of blur operators

A tour of blur operators

Random phase retrieval and reconstruction methods.

Random phase retrieval and reconstruction methods.

Expected Patch Log Likelihood (EPLL) for Denoising and Inpainting

Expected Patch Log Likelihood (EPLL) for Denoising and Inpainting

Plug-and-Play algorithm with Mirror Descent for Poisson noise inverse problems.

Plug-and-Play algorithm with Mirror Descent for Poisson noise inverse problems.

Vanilla PnP for computed tomography (CT).

Vanilla PnP for computed tomography (CT).

PnP with custom optimization algorithm (Condat-Vu Primal-Dual)

PnP with custom optimization algorithm (Condat-Vu Primal-Dual)

Uncertainty quantification with PnP-ULA.

Uncertainty quantification with PnP-ULA.

Image reconstruction with a diffusion model

Image reconstruction with a diffusion model

Building your custom sampling algorithm.

Building your custom sampling algorithm.

Implementing DPS

Implementing DPS

Implementing DiffPIR

Implementing DiffPIR

Image transformations for Equivariant Imaging

Image transformations for Equivariant Imaging