Skip to content

Commit

Permalink
Update predict.md
Browse files Browse the repository at this point in the history
  • Loading branch information
LutaoChu authored Sep 24, 2021
1 parent e7f415d commit 8d909cc
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions docs/predict/predict.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,36 +108,4 @@ If you don't specify the output location, `added_prediction` and `pseudo_color_p
| |--...
## 4.Custom Color Map
After prediction, what we get is the predicted segmentation result depend on default color map. Take the medical video disc segmentation dataset as an example:
![](./color_map/before_mapped.jpeg)
​ pseudo map / blended prediction
In the segmentation result, the foreground is marked in red, and the background is marked in black. If you want to use other colors, you can refer to the following command:
```python
python predict.py \
--config configs/quick_start/bisenet_optic_disc_512x512_1k.yml \
--model_path output/iter_1000/model.pdparams \
--image_path data/optic_disc_seg/JPEGImages/H0003.jpg \
--save_dir output/result \
--custom_color 0 0 0 255 255 255
```
The segmentation results are as follows:
![](./color_map/after_mapped.jpeg)

​ pseudo map / blended prediction

- Parameters
- You can see that we added `--custom_color 0 0 0 255 255 255` at the end. What does this mean? In the RGB image, the final color of each pixel is determined by the components of the three RGB channels, so every three digits after the command line parameter represent the color of a pixel, and the color of each class in `label.txt` is releated to 3 digits sequentially.
- If you use a custom color map, the number of input `color values` should be equal to `3 * pixel classes` (depending on the dataset you are using). For example, if your data set has 3 types of pixels, you can consider run:
```pythons
python predict.py \
--config configs/quick_start/bisenet_optic_disc_512x512_1k.yml \
--model_path output/iter_1000/model.pdparams \
--image_path data/optic_disc_seg/JPEGImages/H0003.jpg \
--save_dir output/result \
--custom_color 0 0 0 100 100 100 200 200 200
```

We recommend that you refer to the RGB color value comparison table to set `--custom_color`.

0 comments on commit 8d909cc

Please sign in to comment.