.devcontainer
Docker container specification and setup scripts.vscode
VS Code settings and recommended extensionsdata
Contains the input/output images and resultski67
Core python scripts of the presented solutionnotebooks
Jupyter Notebook containing model trainingmain.py
Entry script
The whole solution and experiments are built upon the MAGDA 👧 library |
---|
Within the ki67
folder you can find:
interfaces
with Data Transfer Objects used by modulesmodules
with single-responsibility pieces of the solution, grouped by their logical rolespipelines
with YML configs describing the experiments/data flow and helper classes to run themservices
helper classes used by the modules
The modules are combined into a pipeline depending on their purpose. You can find
pipelines in ki67/pipelines/configs directory.
You can run them with the main.py
script.
Prerequisites:
- Open project in Visual Studio Code
- Ensure you have installed Remote Development Extension (
ms-vscode-remote.vscode-remote-extensionpack
) - Type command (
F1
):Remote-Containers: Reopen in Container
(the docker container will be created according to devcontainer specification)
- Make sure you have installed
Python 3.7
andpip
. - Install all dependencies listed in requirements.txt.
.devcontainer doesn't work with GPU |
---|
Install dependencies manually or run the repository within the nvidia/cuda container to enable GPU(s) |
Move your data to the specific folders:
Example files structure BEFORE performing experiments
┌ data
├─┬ experiments
│ └── config.json
├── results
└─┬ source
├── img-001.png
├── img-001.xml
├── ...
├── ...
├── img-095.png
└── img-095.xml
The source
directory should contain all slides (pROI saved as .png
files) and correspoding markers (exported by ImageJ to .xml
files). The config file splits images into chunks, e.g.
config.json
{
"testing": ["img-003", ... "img-094"],
"shards": {
"amy": ["img-001", ... "img-058"],
"ben": ["img-002", ... "img-026"],
"charlie": ["img-005", ... "img-013"]
}
}
After performing training (each model is saved within the data/experiments
directory) and evaluating the source images (all results are saved within the corresponding directories in data/results
) the files structures should look like:
Example files structure AFTER training and experiments
┌ data
├─┬ experiments
│ ├─┬ densenet121-f48-s48-m0
│ │ ├─┬ amy
│ │ │ └─┬ weights.hdf5
│ │ │ └ ...
│ │ ├─┬ ben
│ │ │ └─┬ weights.hdf5
│ │ │ └ ...
│ │ └─┬ charlie
│ │ └─┬ weights.hdf5
│ │ └ ...
│ └── config.json
│
├─┬ results
│ ├─┬ img-001
│ │ └── ...
│ ├── ...
│ └─┬ img-095
│ └── ...
│
└─┬ source
├── img-001.png
├── img-001.xml
├── ...
├── ...
├── img-095.png
└── img-095.xml
💡 In case of different data format 💡 |
---|
You can modify and combine modules into a new pipelines to adjust the solution to your data format. |
You can run solution through main.py
which invokes the pipelines. Please note that
some pipelines should be run before and some after training. You can find
the appropriate comments within the script.
The source code within this repository is distributed under the Apache-2.0 License.