Skip to content

Adding networks

Volker edited this page Aug 12, 2020 · 5 revisions
  1. Fork the dl4mic-project.
  2. Clone the code of your forked repository.

cloned-repository

  1. In the folder dl4mic/networks add a folder with the name of your network.

my-network-folder

  1. You need two python-scripts in the newly created folder: train.py and predict.py. A third script evaluate.py can be provided to run an evaluation of the trained network.

scripts

  1. Add three yml-files train.ylm, predict.yml and evaluate.yml defining and describing the options of each script. These files will define the command-line options of the python scripts and they will be read by ImageJ. ImageJ will use them to create a parameter-dialog and pass the values to the python scripts.

yml-files

  1. In your scripts use parser = ParserCreator.createArgumentParser("./evaluate.yml") to create a parser from the corresponding yml-file and use the parser to parse the command line options args = parser.parse_args(argv[1:])

  2. Pass the option values on to your network and run the training, prediction or evaluation.

  3. When finished the script must output a marker, so that ImageJ will know that it finished. Use print("---training done---"), print("---evaluation done---") or print("---prediction done---") in the corresponding scripts.

  4. Put a html file named info.html about your network into the folder of the network. It can use an image named picture.png from the same folder. This file will be displayed when the user presses the info-button in ImageJ.

info-html

  1. Test and when everything works, push everything to your forked git-hub repository and make a pull-request.
Clone this wiki locally