How to Use - rickyota/CSML GitHub Wiki
Contents
Images
You have to prepare 3 kinds of images, training images, labeled images and inference images. Training Images and Labeled images are used to optimize classifier. Segmented Images of inference images are returned.
Format of Images can be a folder containing images, one tiff file or one other image file. Just Drag & Drop them when you use application. When you use codes, just put them into CSML/data/
and specify in csml.sh
bash file. Format of returned images is png files for folder input or tiff file for tiff input.
Training Images
Training images should be fluorescent images of embryos and corresponding to labeled images.
The images can be color images or grayscale images. Refer example to CSML/data/folder_train/example_train.png
.
Labeled Images
Labeled images should be contoured binary images of training images. Only completely surrounded regions are used.
The images should be binary images. Refer example to CSML/data/folder_label/example_train.png
.
Inference Images
Inference images should be fluorescent images of embryos like training images. Inference Images whose segmented images you want are set.
The images can be color images or grayscale images. Refer example to CSML/data/folder_label/example_infer.png
.
CSML Application
Installation
Download from Releases.
Usage
- Launch CSML.exe.
- Train model (only for the first time).
- Drag & Drop the images file and the corresponding binary images file.
- Specify name of model.
- Adjust the parameters if you want.
- Press "Start Training" button.
- Infer images.
- Drag & Drop the images file which you want to segment.
- Select the model which you want to use.
- Adjust the parameters if you want.
- Select output folder.
- Press "Start Infering" button.
- Get segmented images file in output folder.
Notes
- Click "Run with Example" to use examples.
- Format of Images can be a folder containing images, one tiff file or one other image file.
- Accuracy displayed in model list is dot accuracy.
CSML Codes
Please refer to this section if you want to run the codes directly.
Requirement
- conda
Installation
git clone https://github.com/rickyota/CSML.git
You need to use conda
to install python dependencies.
conda env create --file environment.yml
Usage
Training Classifier and Inferring Images
If you have no trained classifiers, you have to train classifier first.
-
Add training, labeled and inference images to
./data/
.
The format can be a folder containing images, one tiff file or one other image file.
Make sure that you indicate the same image name inlabel
andtrain
folder. -
Use
csml.sh
or edit values incsml_paras.sh
. -
Execute
$ bash csml.sh
-
Inferred images are saved in
./result/
.
Only Inferring Images
If you have trained classifier, you can only infer images.
-
Add training, inference images to
./data/
.
The format can be a folder containing images, one tiff file or one other image file. -
Use
csml_onlyinfer.sh
$ bash csml_onlyinfer.sh
-
Inferred images are saved in
./result/
.