This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
janni_tutorial [2019/09/16 09:11] twagner [Start JANNI] |
janni_tutorial [2019/09/16 13:19] shaikh [Just Another Noise 2 Noise Implementation (JANNI)] |
||
---|---|---|---|
Line 4: | Line 4: | ||
[[https:// | [[https:// | ||
- | JANNI can be used a command line tool but also provides an simple interface to be integrated into other programs. | + | Besides |
==== Download and Installation ==== | ==== Download and Installation ==== | ||
Line 19: | Line 19: | ||
janni_denoise.py | janni_denoise.py | ||
</ | </ | ||
+ | |||
+ | The GUI is basically a visualization of the command line interface: | ||
{{ :: | {{ :: | ||
+ | |||
+ | On the left side, you can see all available actions: | ||
+ | * **config**: To create a config file, which is needed to train JANNI. | ||
+ | * **train**: This action let you train a model for your data. | ||
+ | * **denoise**: | ||
+ | |||
+ | Each action has several parameters which are organized in tabs. Once you chosen your settings you can press “Start”, | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | It will tell you when something went wrong. Pressing “edit” brings you back to your settings, where you can either edit the settings (in case something went wrong) or go to the next action. | ||
==== Training a model for your data ==== | ==== Training a model for your data ==== | ||
In case you want to use the general model ([[janni# | In case you want to use the general model ([[janni# | ||
- | In case you would like to train a model for your data, the first thing you have to do is to create a configuration file for JANNI. | + | In case you would like to train a model for your data, you need to copy a couple of movie files into a separate directory. We typically use at least 30 movies (unaligned) to train the model. Less might also work, more work often much better. |
- | <code json config.json> | + | |
- | { | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | }, | + | |
- | | + | === Configuration === |
- | "movie_dir": | + | In the GUI choose the action |
- | " | + | {{ :: |
- | " | + | |
- | " | + | Press "start" |
- | " | + | <hidden **Generate the configuration file with the command line**> |
- | " | + | If you would like to use the command line, you can get a description of all parameters with: |
- | " | + | < |
- | } | + | janni_denoise.py config -h |
- | } | + | |
</ | </ | ||
- | The fields have the following | + | The following |
- | * **architecture**: | + | < |
- | * **patch_size**: | + | janni_denoise.py config ~/ |
- | * **movie_dir**: | + | </code> |
- | * **even_dir**: | + | </ |
- | * **odd_dir**: For each movie in movie_dir, an average based on the // | + | |
- | * **batch_size**: | + | === Training === |
- | * **learning_rate**: | + | In principle |
- | * **nb_epoch**: Number of epochs to train. More epochs seems to only slightly improve the results. | + | |
- | * **saved_weights_name**: Filename of your model. | + | {{:jann_train_01.png? |
- | In principle you only have to adapt the paths. The other could keep as they are. | + | |
- | We typically use at least 30 movies (unaligned) | + | Press " |
+ | <hidden **Run the training with the command line**> | ||
To run the training on gpu 0: | To run the training on gpu 0: | ||
< | < | ||
janni_denoise.py train config.json -g 0 | janni_denoise.py train config.json -g 0 | ||
</ | </ | ||
+ | </ | ||
==== Denoise ==== | ==== Denoise ==== | ||
- | With a trained model (either trained by you or the general model) you can directly denoise either your movies or averages. In our experience, denoising the motion corrected averages works better. | + | With a trained model (either trained by you or the general model ([[janni# |
+ | {{ :: | ||
- | To denoise a set if images you have to tell JANNI three **mandatory** arguments: | + | You might also want to change the GPU ID in //Optional arguments// tab. After that press the //Start// button. JANNI will denoise your images with roughly 1s per micrograph. |
- | - //input_path//: This path points to the directory with your images. | + | |
- | - // | + | |
- | - //model_path//: This path points to the model you want to use (the .h5 file). | + | |
- | As model you can either use the model you trained for your data or the general model ([[janni# | + | < |
- | + | In case you need a description | |
- | There are couple of **optional** parameters that you use: | + | < |
- | * **%%-ol%%**: | + | janni_denoise.py predict -h |
- | * **%%-bs%%**: | + | </code> |
- | * **%%-g%%**: GPU ID to run JANNI on. Multiple GPUs are not supported yet. | + | |
- | + | ||
- | Here is now how you do the actual denoising: | + | |
- | It is assumed that you run the command in a directory with your model file '' | + | |
- | The following command will run the denoising on GPU 0: | + | The following command will run the denoise the images in ''/ |
< | < | ||
- | janni_denoise.py predict / | + | janni_denoise.py predict / |
</ | </ | ||
+ | </ | ||
+ | |||
+ | |||