|
| 1 | +# EISeg |
| 2 | + |
| 3 | +[](https://www.python.org/downloads/release/python-360/) [](LICENSE) [](https://pepy.tech/project/eiseg) |
| 4 | +<!-- [](https://github.com/PaddleCV-SIG/iseg/releases) --> |
| 5 | + |
| 6 | +English | [简体中文](README.md) |
| 7 | + |
| 8 | +## Latest Developments |
| 9 | + |
| 10 | +- Our paper on interactive segmentation named [EdgeFlow](https://arxiv.org/abs/2109.09406) is accepted by ICCV 2021 Workshop. |
| 11 | +- We release EISeg 0.3.0 with more functions and support for Polygon editing. |
| 12 | + |
| 13 | +## Introduction |
| 14 | + |
| 15 | +EISeg (Efficient Interactive Segmentation) is an efficient and intelligent interactive segmentation annotation software developed based on PaddlePaddle. It relies on the interactivate image segmentation methods [RITM](https://github.com/saic-vul/ritm_interactive_segmentation) and [EdgeFlow](https://arxiv.org/abs/2109.09406) .It covers a large number of high-quality segmentation models in different directions such as *high-performance* and *lightweight*, 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 prediction. |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +## Model Preparation |
| 20 | + |
| 21 | +Please download the model parameters before using EIseg. EISeg provides four annotation models trained on COCO+LVIS and large-scale portrait data to meet the needs of both generic and portrait scenarios. 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. |
| 22 | + |
| 23 | +| Model Type | Applicable Scenarios | Model Architecture | Download Link | |
| 24 | +| ---------------------- | ------------------------------------- | ------------------ | ------------------------------------------------------------ | |
| 25 | +| High Performance Model | Image annotation in generic scenarios | HRNet18_OCR64 | [hrnet18_ocr64_cocolvis](https://bj.bcebos.com/paddleseg/dygraph/interactive_segmentation/ritm/hrnet18_ocr64_cocolvis.pdparams) | |
| 26 | +| Lightweight Model | Image annotation in generic scenarios | HRNet18s_OCR48 | [hrnet18s_ocr48_cocolvis](https://bj.bcebos.com/paddleseg/dygraph/interactive_segmentation/ritm/hrnet18s_ocr48_cocolvis.pdparams) | |
| 27 | +| High Performance Model | Annotation in portrait scenarios | HRNet18_OCR64 | [hrnet18_ocr64_human](https://bj.bcebos.com/paddleseg/dygraph/interactive_segmentation/ritm/hrnet18_ocr64_human.pdparams) | |
| 28 | +| Lightweight Model | Annotation in portrait scenarios | HRNet18s_OCR48 | [hrnet18s_ocr48_human](https://bj.bcebos.com/paddleseg/dygraph/interactive_segmentation/ritm/hrnet18s_ocr48_human.pdparams) | |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +## Installation |
| 33 | + |
| 34 | +EISeg provides multiple ways of installation, among which [pip](#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. |
| 35 | + |
| 36 | +System Requirements: |
| 37 | + |
| 38 | +* PaddlePaddle >= 2.2.0 |
| 39 | + |
| 40 | +For more details of the installation of PaddlePaddle, please refer to our [official website](https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/install/pip/windows-pip.html)。 |
| 41 | + |
| 42 | +### Clone |
| 43 | + |
| 44 | +Clone PaddleSeg to your local system through git: |
| 45 | + |
| 46 | +```shell |
| 47 | +git clone https://github.com/PaddlePaddle/PaddleSeg.git |
| 48 | +``` |
| 49 | + |
| 50 | +Enable EISeg by running eiseg after installing the needed environment: |
| 51 | + |
| 52 | +```shell |
| 53 | +cd PaddleSeg\contrib\EISeg |
| 54 | +python -m eiseg |
| 55 | +``` |
| 56 | + |
| 57 | +Or you can run exe.py in eiseg: |
| 58 | + |
| 59 | +```shell |
| 60 | +cd PaddleSeg\contrib\EISeg\eiseg |
| 61 | +python exe.py |
| 62 | +``` |
| 63 | + |
| 64 | +### PIP |
| 65 | + |
| 66 | +Install pip as follows: |
| 67 | + |
| 68 | +```shell |
| 69 | +pip install eiseg |
| 70 | +``` |
| 71 | + |
| 72 | +pip will install dependencies automatically. After that, enter the following at the command line: |
| 73 | + |
| 74 | +```shell |
| 75 | +eiseg |
| 76 | +``` |
| 77 | + |
| 78 | +Now, you can run pip. |
| 79 | + |
| 80 | +### Windows exe |
| 81 | + |
| 82 | +EISeg uses [QPT](https://github.com/GT-ZhangAcer/QPT) to package. You can download the latest EISeg from [here](https://paddleseg.bj.bcebos.com/eiseg/EISeg0.3.0.1.7z), unzip it, and run the program by double-clicking its .exe. The program will initialize the packages needed for installation in its first run, please be patient. |
| 83 | + |
| 84 | +## Using |
| 85 | + |
| 86 | +After opening the software, make the following settings before annotating: |
| 87 | + |
| 88 | +1. **Load Model Parameter** |
| 89 | + |
| 90 | + Select the appropriate network and load the corresponding model parameters. Currently, networks in EISeg are `HRNet18s_OCR48` and `HRNet18_OCR64`, which provide model parameters for portrait and generic scenarios respectively. Successful loading is shown at the status bar in the lower right corner, while a mismatch between the network parameters and model parameters will trigger a warning of failure load, requiring to be reloaded. 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. |
| 91 | + |
| 92 | +2. **Load Image** |
| 93 | + |
| 94 | + 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`. |
| 95 | + |
| 96 | +3. **Add/Load Label** |
| 97 | + |
| 98 | + 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. |
| 99 | + |
| 100 | +4. **Autosave** |
| 101 | + |
| 102 | + You can choose the right folder and have the `autosave` set up, so that the annotated image will be saved automatically when switching images. |
| 103 | + |
| 104 | +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. |
| 105 | + |
| 106 | +| Keys/Shortcut Keys | Function | |
| 107 | +| --------------------------------- | ------------------------------ | |
| 108 | +| Left Mouse Button | Add Positive Sample Points | |
| 109 | +| Right Mouse Button | Add Negative Sample Points | |
| 110 | +| Middle Mouse Button | Image Panning | |
| 111 | +| Ctrl+Middle Mouse Button(wheel) | Image Zooming | |
| 112 | +| S | Previous Image | |
| 113 | +| F | Next Image | |
| 114 | +| Space | Finish Annotation/Switch State | |
| 115 | +| Ctrl+Z | Undo | |
| 116 | +| Ctrl+Shift+Z | Clear | |
| 117 | +| Ctrl+Y | Redo | |
| 118 | +| Ctrl+A | Open Image | |
| 119 | +| Shift+A | Open Folder | |
| 120 | +| E | Open Shortcut Key List | |
| 121 | +| Backspace | Delete Polygon | |
| 122 | +| Double Click(point) | Delete Point | |
| 123 | +| Double Click(edge) | Add Point | |
| 124 | + |
| 125 | +## Instruction of New Functions |
| 126 | + |
| 127 | +- **Polygon** |
| 128 | + |
| 129 | +1. 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. |
| 130 | +2. The polygon can be dragged and 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. |
| 131 | +3. 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. |
| 132 | + |
| 133 | +- **Save Format** |
| 134 | + |
| 135 | +1. Polygons will be recorded and automatically loaded after setting `JSON Save` or `COCO Save`. |
| 136 | +2. With no specified save path, the image is save to the label folder under the current image folder by default. |
| 137 | +3. If there are images with the same name but different suffixes, you can open `labels and images with the same extensions`. |
| 138 | +4. You can also save as grayscale, pseudo-color or matting image, see tools 7-9 in the toolbar |
| 139 | + |
| 140 | +- **Generate mask** |
| 141 | + |
| 142 | +1. 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. |
| 143 | + |
| 144 | +- **Interface Module** |
| 145 | + |
| 146 | +1. 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. |
| 147 | + |
| 148 | + |
| 149 | +## Version Updates |
| 150 | + |
| 151 | +- 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. |
| 152 | +- 2021.07.07 **0.2.0**: Newly added contrib:EISeg,which enables rapid interactive annotation of portrait and generic images. |
| 153 | + |
| 154 | +## Developer |
| 155 | + |
| 156 | +[Yuying Hao](https://github.com/haoyuying), [Lin Han](https://github.com/linhandev/), [Yizhou Chen](https://github.com/geoyee), [Yiakwy](https://github.com/yiakwy), [GT](https://github.com/GT-ZhangAcer), [Zhiliang Yu](https://github.com/yzl19940819) |
| 157 | + |
| 158 | +## Academic Citation |
| 159 | + |
| 160 | +If you find our project useful in your research, please consider citing : |
| 161 | + |
| 162 | +```latex |
| 163 | +@article{hao2021edgeflow, |
| 164 | + title={EdgeFlow: Achieving Practical Interactive Segmentation with Edge-Guided Flow}, |
| 165 | + 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}, |
| 166 | + journal={arXiv preprint arXiv:2109.09406}, |
| 167 | + year={2021} |
| 168 | +} |
| 169 | +``` |
0 commit comments