Giter Site home page Giter Site logo

openspyrit / spyrit Goto Github PK

View Code? Open in Web Editor NEW
29.0 29.0 14.0 7.61 MB

A Python toolbox for deep image reconstruction, with emphasis on single-pixel imaging.

Home Page: https://spyrit.readthedocs.io/en/master

License: GNU Lesser General Public License v3.0

Python 100.00%
deep-learning image-reconstruction medical-imaging pypi python single-pixel-camera torch

spyrit's People

Contributors

cmouton avatar guilhermebene avatar jabascal avatar nducros avatar pre-commit-ci[bot] avatar romainphan avatar talaoui avatar tbaudier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

spyrit's Issues

Remove fht

In #29

@nducros

Great. So this is the right time to discard it!

You should only need to replace this line with
H = wh.walsh2_matrix(n)/n

Both Stat_h and optim_had are no longer necessary as I reimplemented the walsh version of both functions (already included)

I started a new branch here
#34

Package spyrit

I open this issue to put together all information to create the package for spyrit.

  • Add FHT (https://github.com/nbarbey/fht) as submodule. The pypi package is not available for all python version and distribution. See (https://pypi.org/project/fht/#files). It seems that it works for Linux and python 3.6 only.
  • Compile and create the wheel localy
  • Create a github actions to create the wheel on ManyLinux, Mac and (Windows ?) and multiple python versions
  • Push on pypi the github actions wheel

Measurement simulation (in meas.py)

Instead of having LinearDynamic inheriting of Linear, what about having Linearinheriting of LinearDynamic ? To me this seems logical because looking at a still picture is a particular case of a moving picture.
Also, the adjoint / pinv methods that we currently inherit from Linear would be redefined only in the child class, which would avoid having useless methods.
@nducros ?

Error when creating a DenoiCompNet

Following the updates from PR #37, where misc/statistics was added, I am now getting an error when creating a DenoiCompNet using spas. It seems Cov2Var cannot be found.

Traceback (most recent call last):

  File "C:\Users\beneti\spas\scripts\acquisition-recon-sequential.py", line 63, in <module>
    model, device = setup_reconstruction(cov_path, mean_path, H, model_root, network_params)

  File "c:\users\beneti\spas\spas\reconstruction_nn.py", line 146, in setup_reconstruction
    model = DenoiCompNet(

  File "c:\users\beneti\spyrit\spyrit\learning\model_Had_DCAN.py", line 598, in __init__
    super().__init__(n, M, Mean, Cov, variant, N0, sig, H, Ord)

  File "c:\users\beneti\spyrit\spyrit\learning\model_Had_DCAN.py", line 531, in __init__
    super().__init__(n, M, Mean, Cov, variant, H, Ord)

  File "c:\users\beneti\spyrit\spyrit\learning\model_Had_DCAN.py", line 336, in __init__
    Ord = Cov2Var(Cov)

NameError: name 'Cov2Var' is not defined

Reconstruction with multiple channels

In spyrit.learning.model_Had_DCAN, the function forward_N0_maptoimage_expe works for reconstruction of a batch (b != 0) but does not work for a multichannel reconstruction (c != 0).
The problem comes from the following lines:

N0_est = self.max(x_est);
N0_est = N0_est.view(b*c,1,1);
N0_est = N0_est.repeat(1,1,self.M)
x = torch.div(x,N0_est)

N0_est has the dimensions (b*c, 1, self.M) , whereas x has the dimensions (b, c, self.M).

It seems a possible solution would be to convert x to the same dimensions as N0_est at the beginning of the function.

builds are back

P... Je me suis fais avoir sur towards_v2 ! Je pensais être sur "ma" branche et aussi que towards_v2 était protégée, mais non.
Je suis vraiment confus Thomas, j'aurais dû vérifier je connais la procédure maintenant

@TALAOUI : Ne pull pas surtout !

Import errors

I am getting some errors due to import issues.

  • In spas/misc/statistics.py the following line is used import spyrit.misc.walsh_hadamard as wh but then some function calls do not start by wh as in:

    H = walsh_matrix(len(img))
    h_img = walsh_ordered2(img, H1d);
    In this case it seems I cannot train a new network because Stat_had() will fail.

  • As mentioned in #39 some imports in spas/learning/model_Had_DCAN.py do not work, I have noticed 3 factors that may contribute to this: circular imports, imports using * (star imports) and relative and absolute imports being used in a same file.

  • In a same file, imports like from ..misc.pattern_choice import Hadamard, matrix2conv (which is a relative import) and from spyrit.misc.statistics import * (which is not) are used, which I believe is not a best practice.

I believe it would be a good idea to review most of the imports in all relevant files, choose to use a method, i.e. relative imports, avoid star imports as much as possible and remove unnecessary legacy imports in file headers.

Renaming of walsh_ordered

Hello,
It seems that some methods related to Hadamard have been renamed, causing the deprecation of some code.

For example, here
and there

walsh_ordered is called but I could not find a definition of walsh_ordered.

Probably walsh_ordered should be replaced by its new name?

push under windows and fht

git status outputs

modified: fht
modified: spyrit/fht (untracked content)

What should I do?

Can I git add -A and push ? Will it break fht (e.g. under linux)?

drunet

To get the tuto on drunet, check this branch after the paper branch is merged with master.

API examples

  1. Copy the long examples of the API documentation in files (e.g., 'test/test_forward.py')
  2. Keep API examples as short as possible (limit the number of variables to a minimum)

Rename models

DCAN stands for deep convolutional auto-encoder
network, named after Higham et al 2018 paper.
Our models are more general

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.