First of all, clone the code
git clone https://github.com/WeizhenLiuBioinform/stomatal_index.git
- Python 3.7
- Pytorch 1.5
- CUDA 10.0 or higher
- Opencv
- ...
The complete list of the required python packages and their version information can be found at requirements.txt
- PASCAL_VOC format: Please follow the instructions in py-faster-rcnn to prepare stomatal datasets.
- ResNet101: Dropbox, VT Server Download them and put it into the FRcnn_pytorch/data/pretrained_model/.
cd FRcnn_pytorch/lib
python setup.py build develop
Configure your own settings in FRcnn_pytorch/cfgs/train.yml to adapt to your environment. To train a Faster R-CNN model with pascal_voc format, simply run:
python Frcnn_train.py
- Put images into the UNet_Pytorch_pytorch/data/imgs/
- Put masks into the FRcnn_pytorch/data/masks/
Configure your own settings in UNet_pytorch/cfgs/train.yml to adapt to your environment. To train a U-Net model, simply run:
python UNet_train.py
Change the arguments "image_dir", "frcnn_load_name" and "unet_load_name" in "stomatal_index.py" to adapt to your environment.
python stomatal_index.py
If you want to visualize the prediction results of stomata and cells, you can set the parameter "is_vis = True", which means that extra time will be consumed.