Skip to content

Latest commit

 

History

History
204 lines (136 loc) · 15.8 KB

README_EN.md

File metadata and controls

204 lines (136 loc) · 15.8 KB

English | 简体中文

EISeg

Python 3.6 PaddlePaddle 2.2 License Downloads

Latest Developments

  • Added interactive model of ResNet50_DeeplabV3+ and ResNet18_DeeplabV3+ for chest Xray in medical scenarios. The pretrained model refers to MoCo comparative learning to match the characteristics of X-ray.
  • Added an MRI spine interactive model, which cooperates with Guangzhou First People's Hospital. It is trained on MRSpineSeg dataset, which can realize one-click identification of intermediate-level lumbar vertebral cones and accessories on transvers plane.
  • Added a defect inspection model for aluminum plate, which is trained based on Baidu's self-built data set. It can annotate common aluminum plate defects such as black spots, small white lines, foreign objects and other defects.

Introduction

EISeg (Efficient Interactive Segmentation), built on RITM and EdgeFlow, is an efficient and intelligent interactive segmentation annotation software developed based on PaddlePaddle. It covers a large number of high-quality segmentation models in different directions such as general scenarios, portrait, remote sensing, medical treatment, defect inspection, etc., providing convenience to the rapid annotation of semantic and instance labels with reduced cost. In addition, by applying the annotations obtained by EISeg to other segmentation models provided by PaddleSeg for training, high-performance models with customized scenarios can be created, integrating the whole process of segmentation tasks from data annotation to model training and inference.

4a9ed-a91y1

Model Preparation

Please download the model parameters before using EIseg. EISeg 0.5.0 provides seven direction models trained on COCO+LVIS, large-scale portrait data, mapping_challenge, MRSpineSeg, Chest Xray, LiTS and Self-built aluminum plate quality inspection data set to meet the labeling needs of generic and portrait scenarios as well as architecture, medical and industrial images. The model architecture corresponds to the network selection module in EISeg interactive tools, and users need to select different network structures and loading parameters in accordance with their own needs.

Model Type Applicable Scenarios Model Architecture Download Link
High Performance Model Image annotation in generic scenarios HRNet18_OCR64 static_hrnet18_ocr64_cocolvis
Lightweight Model Image annotation in generic scenarios HRNet18s_OCR48 static_hrnet18s_ocr48_cocolvis
High Performance Model Annotation in portrait scenarios HRNet18_OCR64 static_hrnet18_ocr64_human
High Performance Model Image annotation in generic scenarios EdgeFlow static_edgeflow_cocolvis
Lightweight Model Annotation in portrait scenarios HRNet18s_OCR48 static_hrnet18s_ocr48_human
Lightweight Model Annotation of remote sensing building HRNet18s_OCR48 static_hrnet18_ocr48_rsbuilding_instance
Lightweight Model Annotation of liver in medical scenarios HRNet18s_OCR48 static_hrnet18s_ocr48_lits
High Performance Model * Annotation of chest Xray in medical scenarios Resnet50_DeeplabV3+ static_resnet50_deeplab_chest_xray *
High Performance Model * Annotation of chest Xray in medical scenarios Resnet18_DeeplabV3+ static_resnet18_deeplab_chest_xray *
Lightweight Model * Annotation of Spinal Structures in medical scenarios HRNet18s_OCR48 static_hrnet18s_ocr48_MRSpineSeg
Lightweight Model * Annotation of Aluminum plate defects in industrial scenarios HRNet18s_OCR48 static_hrnet18s_ocr48_aluminium

NOTE: The downloaded model structure *.pdmodel and the corresponding model parameters *.pdiparams should be put into the same directory. When loading the model, you only need to decide the location of the model parameter at the end of *.pdiparams, and *.pdmodel will be loaded automatically. When using EdgeFlow model, please turn off Use Mask, and check Use Mask when adopting other models. For High Performance Model, we recommend to utilize the computer with gpu for a smoother annotation experience.

Installation

EISeg provides multiple ways of installation, among which pip and [run code](#run code) are compatible with Windows, Mac OS and Linux. It is recommended to install in a virtual environment created by conda for fear of environmental conflicts.For more details of the installation of PaddlePaddle, please refer to our official website.

Dependency of EISeg and PaddlePaddle::

EISeg version PaddlePaddle version Tips
release/0.5 >= 2.2.0 Static mode
release/0.4 >= 2.2.0 Static mode
release/0.3 >= 2.1.0 Dygraph mode
release/0.2 >= 2.1.0 Dygraph mode

Clone

Clone PaddleSeg to your local system through git:

git clone https://github.com/PaddlePaddle/PaddleSeg.git

Install the required environment (if you need to use GDAL and SimpleITK, please refer to Vertical Segmentation for installation).

pip install -r requirements.txt

Enable EISeg by running eiseg after installing the needed environment:

cd PaddleSeg\EISeg
python -m eiseg

Or you can run exe.py in eiseg:

cd PaddleSeg\EISeg\eiseg
python exe.py

PIP

Install pip as follows:

pip install eiseg

pip will install dependencies automatically. After that, enter the following at the command line:

eiseg

Now, you can run pip.

Using

After opening the software, make the following settings before annotating:

  1. Load Model Parameter

    Select the appropriate network and load the corresponding model parameters. EISeg0.4.0 witnesses the conversion of dynamic graph inference to static one and comprehensive improvements of the inference speed of a single click. After downloading and decompressing the right model and parameters, the model structure *.pdmodel and the corresponding model parameters *.pdiparams should be put into the same directory, and only the location of the model parameter at the end of *.pdiparamsneed to be selected when loading the model. The initialization of the static model takes some time, please wait patiently until the model is loaded. The correctly loaded model parameters will be recorded in Recent Model Parameters, which can be easily switched, and the exiting model parameter will be loaded automatically the next time you open the software.

  2. Load Image

    Open the image or image folder. Things go well when you see that the main screen image is loaded correctly and the image path is rightly shown in Data List.

  3. Add/Load Label

    Add/load labels. New labels can be created by Add Label, which are divided into 4 columns corresponding to pixel value, description, color and deletion. The newly created labels can be saved as txt files by Save Label List, and other collaborators can import labels by Load Label List. Labels imported by loading will be loaded automatically after restarting the software.

  4. Autosave

    You can choose the right folder and have the autosave set up, so that the annotated image will be saved automatically when switching images.

Start the annotation when the above are all set up. Here are the commonly used keys/shortcut keys by default, press E to modify them as you need.

Keys/Shortcut Keys Function
Left Mouse Button Add Positive Sample Points
Right Mouse Button Add Negative Sample Points
Middle Mouse Button Image Panning
Ctrl+Middle Mouse Button(wheel) Image Zooming
S Previous Image
F Next Image
Space Finish Annotation/Switch State
Ctrl+Z Undo
Ctrl+Shift+Z Clear
Ctrl+Y Redo
Ctrl+A Open Image
Shift+A Open Folder
E Open Shortcut Key List
Backspace Delete Polygon
Double Click(point) Delete Point
Double Click(edge) Add Point

Instruction of New Functions

  • Polygon

    • Click Space key to complete interactive annotation, then appears the polygon boundary.
    • When you need to continue the interactive process inside the polygon, click Space to switch to interactive mode so the polygon cannot be selected and changed.
    • The polygon can be deleted. Use the left mouse to drag the anchor point, double-click the anchor point to delete it, and double-click a side to add an anchor point.
    • With Keep Maximum Connected Blocks on, only the largest area will remain in the image, the rest of the small areas will not be displayed and saved.
  • Save Format

    • Polygons will be recorded and automatically loaded after setting JSON Save or COCO Save.
    • With no specified save path, the image is save to the label folder under the current image folder by default.
    • If there are images with the same name but different suffixes, you can open labels and images with the same extensions.
    • You can also save as grayscale, pseudo-color or matting image, see tools 7-9 in the toolbar.
  • Generate mask

    • Labels can be dragged by holding down the second column, and the final generated mask will be overwritten from top to bottom according to the label list.
  • Interface Module

    • You can select the interface module to be presented in Display, and the normal exit status and location of the interface module will be recorded, and loaded automatically when you open it next time.
  • Vertical Segmentation

    EISeg now supports remote sensing images and medical images segmentation, and additional dependencies need to be installed for their functioning.

  • Scripting Tool

    EISeg currently provides scripting tools including annotation to PaddleX dataset, delineation of COCO format and semantic labels to instance labels, etc. See Scripting Tools Usage for more details.

Version Updates

  • 2022.04.10 0.5.0:【1】Add chest_xray interactive model 【2】Add MRSpineSeg interactive model 【3】Add industrial quality inspection model
  • 2021.12.14 0.4.1: 【1】Fix the bug of crashing; 【2】Newly add the post-labeling operation of remote sensing building images.
  • 2021.11.16 0.4.0: 【1】 Convert dynamic graph inference into static graph inference with ten times' increase in the speed of single click; 【2】 Add the function of remote sensing image labeling, support the selection of multi-spectral data channels; 【3】 Support the processing of slicing (multi squre division) of large size data; 【4】 Add medical image labeling function, support the reading dicom format and the selection of window width and position.
  • 2021.09.16 0.3.0:【1】Complete the function of polygon editing with support for editing the results of interactive annotation;【2】Support CH/EN interface;【3】Support saving as grayscale/pseudo-color labels and COCO format;【4】More flexible interface dragging;【5】Achieve the dragging of label bar, and the generated mask is overwritten from top to bottom.
  • 2021.07.07 0.2.0: Newly added contrib:EISeg,which enables rapid interactive annotation of portrait and generic images.

Acknowledgement

Citation

If you find our project useful in your research, please consider citing :

@article{hao2021edgeflow,
  title={EdgeFlow: Achieving Practical Interactive Segmentation with Edge-Guided Flow},
  author={Hao, Yuying and Liu, Yi and Wu, Zewu and Han, Lin and Chen, Yizhou and Chen, Guowei and Chu, Lutao and Tang, Shiyu and Yu, Zhiliang and Chen, Zeyu and others},
  journal={arXiv preprint arXiv:2109.09406},
  year={2021}
}