Pytorch library for solving inverse problems with deep learning
Project description
Introduction
Deep Inverse is an open-source pytorch library for solving imaging inverse problems using deep learning. The goal of deepinv is to accelerate the development of deep learning based methods for imaging inverse problems, by combining popular learning-based reconstruction approaches in a common and simplified framework, standardizing forward imaging models and simplifying the creation of imaging datasets.
deepinv features
A large collection of predefined imaging operators (MRI, CT, deblurring, inpainting, etc.)
Training losses for inverse problems (self-supervised learning, regularization, etc.)
Many pretrained deep denoisers which can be used for plug-and-play restoration
A framework for building datasets for inverse problems
Easy-to-build unfolded architectures (ADMM, forward-backward, deep equilibrium, etc.)
Sampling algorithms for uncertainty quantification (Langevin, diffusion, etc.)
A large number of well-explained examples, from basics to state-of-the-art methods
Documentation
Read the documentation and examples at https://deepinv.github.io.
Install
To install the latest stable release of deepinv, you can simply do:
pip install deepinv
You can also install the latest version of deepinv directly from github:
pip install git+https://github.com/deepinv/deepinv.git#egg=deepinv
You can also install additional dependencies needed for some modules in deepinv.datasets and deepinv.models:
pip install deepinv[dataset,denoisers]
# or
pip install git+https://github.com/deepinv/deepinv.git#egg=deepinv[dataset,denoisers]
Getting Started
Try out the following plug-and-play image inpainting example:
import deepinv as dinv
from deepinv.utils import load_url_image
url = ("https://huggingface.co/datasets/deepinv/images/resolve/main/cameraman.png?download=true")
x = load_url_image(url=url, img_size=512, grayscale=True, device='cpu')
physics = dinv.physics.Inpainting((1, 512, 512), mask = 0.5, \
noise_model=dinv.physics.GaussianNoise(sigma=0.01))
data_fidelity = dinv.optim.data_fidelity.L2()
prior = dinv.optim.prior.PnP(denoiser=dinv.models.MedianFilter())
model = dinv.optim.optim_builder(iteration="HQS", prior=prior, data_fidelity=data_fidelity, \
params_algo={"stepsize": 1.0, "g_param": 0.1})
y = physics(x)
x_hat = model(y, physics)
dinv.utils.plot([x, y, x_hat], ["signal", "measurement", "estimate"], rescale_mode='clip')
Also try out one of the examples to get started.
Contributing
DeepInverse is a community-driven project and welcomes contributions of all forms. We are ultimately aiming for a comprehensive library of inverse problems and deep learning, and we need your help to get there! The preferred way to contribute to deepinv is to fork the main repository on GitHub, then submit a “Pull Request” (PR). See our contributing guide for more details.
Finding help
If you have any questions or suggestions, please join the conversation in our Discord server. The recommended way to get in touch with the developers is to open an issue on the issue tracker.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file deepinv-0.2.1.tar.gz
.
File metadata
- Download URL: deepinv-0.2.1.tar.gz
- Upload date:
- Size: 266.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87c6dfb737a2fb0834f395521287f0095ee7fbede906cae258ca691a84bcad3d |
|
MD5 | 9c35667f01918fdc0be3ba8d313b45b7 |
|
BLAKE2b-256 | 11eb52e352e145148f83366da5df5a420e9352e74e8897d457ce2944ff29417d |
File details
Details for the file deepinv-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: deepinv-0.2.1-py3-none-any.whl
- Upload date:
- Size: 337.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc8d0aaadde8db70f6503ed583c9f524d0a86d66d5ad7205bfdc506aeff9a8a3 |
|
MD5 | a00845d5ed34b91d76d2dbd9bfdc80b6 |
|
BLAKE2b-256 | c945d5e1f4ac837081e28660d28fa98150977eb044158b30b6abf403b6ccda08 |