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/07/08 17:06] twagner [Training a model for your data] |
janni_tutorial [2019/09/16 13:21] shaikh [Start 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 ==== | ||
You can find the download and installation instructions here: [[janni|Download and Installation]] | You can find the download and installation instructions here: [[janni|Download and Installation]] | ||
+ | ==== Start JANNI ==== | ||
+ | If you followed the installation instructions, | ||
+ | < | ||
+ | source activate janni | ||
+ | </ | ||
+ | |||
+ | You can use JANNI either by command line or with the GUI. Typically, most users prefer to use the GUI (but we will also provide the command line commands in this tutorial). You can start the GUI with: | ||
+ | < | ||
+ | janni_denoise.py | ||
+ | </ | ||
+ | |||
+ | The GUI is essentially 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 ' | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | It will tell you if something goes wrong. Pressing ' | ||
==== Training a model for your data ==== | ==== Training a model for your data ==== | ||
- | In case you don' | + | In case you want to use the general model ([[janni# |
- | <code json config.json> | + | |
- | { | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | }, | + | |
- | "train": { | + | In case you would like to train a model for your data, you need to copy a couple of movie files into a separate |
- | " | + | |
- | " | + | === Configuration === |
- | "odd_dir": | + | In the GUI choose the action |
- | " | + | {{ :: |
- | "learning_rate": | + | |
- | " | + | 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**: | + | </hidden> |
- | * **odd_dir**: For each movie in movie_dir, an average based on the // | + | |
- | * **batch_size**: | + | |
- | * **learning_rate**: | + | |
- | * **nb_epoch**: | + | |
- | * **saved_weights_name**: | + | |
- | In principle you only have to adapt the paths. The other could keep as they are. | + | |
- | We typically use at least 30 movies to train the model. Less might also work, more work often much better. | + | |
+ | === Training === | ||
+ | In principle you just have to specify the config file. However, you might want to specify the GPU ID as well. You find the GPU option in the //Optional arguments// tab. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | 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 ==== | ||
- | After you trained | + | 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# | + | <hidden **Run prediction in the command line**> |
+ | In case you need a description of all available parameters type: | ||
+ | < | ||
+ | janni_denoise.py predict -h | ||
+ | </ | ||
- | There are couple of **optional** parameters that you use: | + | The following command will run the denoise |
- | * **%%-ol%%**: | + | |
- | * **%%-bs%%**: | + | |
- | * **%%-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 the with your model file '' | + | |
- | + | ||
- | The following command | + | |
< | < | ||
- | janni_denoise.py predict / | + | janni_denoise.py predict / |
</ | </ | ||
+ | </ | ||
+ | |||
+ | |||