diff --git a/docs/annotation/jingling_demo/outputs/annotations/aa63d7e6db0d03137883772c246c6761fc201059.png b/docs/annotation/jingling_demo/outputs/annotations/aa63d7e6db0d03137883772c246c6761fc201059.png index 8dfbff7b73bcfff7ef79b904667241731641d4a4..526acefdcdd8317c5778a5d47495d7049a46269d 100644 Binary files a/docs/annotation/jingling_demo/outputs/annotations/aa63d7e6db0d03137883772c246c6761fc201059.png and b/docs/annotation/jingling_demo/outputs/annotations/aa63d7e6db0d03137883772c246c6761fc201059.png differ diff --git a/docs/annotation/labelme_demo/annotations/2011_000025.png b/docs/annotation/labelme_demo/annotations/2011_000025.png index dcf7c96517d4870f6e83293cef62e3285e5b37e3..0b5a56dda153c92f4411ac7d71665aaf93111e10 100644 Binary files a/docs/annotation/labelme_demo/annotations/2011_000025.png and b/docs/annotation/labelme_demo/annotations/2011_000025.png differ diff --git a/docs/data_prepare.md b/docs/data_prepare.md index 89f036f81588d1fa1b6fe833aad58e078873f10a..6d93992e481cd6737bc505089f2613919fe0d4d8 100644 --- a/docs/data_prepare.md +++ b/docs/data_prepare.md @@ -3,8 +3,11 @@ ## 数据标注 ### 标注协议 -PaddleSeg采用单通道的标注图片,每一种像素值代表一种类别,类别从0开始,例如0,1,2,3表示有4种类别。 +PaddleSeg采用单通道的标注图片,每一种像素值代表一种类别,像素标注类别需要从0开始递增,例如0,1,2,3表示有4种类别。 +**NOTE:** 标注图像请使用PNG无损压缩格式的图片。标注类别最多为256类。 + +### 灰度标注vs伪彩色标注 一般的分割库使用单通道灰度图作为标注图片,往往显示出来是全黑的效果。灰度标注图的弊端: 1. 对图像标注后,无法直接观察标注是否正确。 2. 模型测试过程无法直接判断分割的实际效果。 @@ -51,9 +54,7 @@ PddleSeg已支持2种标注工具:LabelMe、精灵数据标注工具。标注 ### 文件列表规范 -PaddleSeg采用通用的文件列表方式组织训练集、验证集和测试集。像素标注类别需要从0开始递增。 - -**NOTE:** 标注图像请使用PNG无损压缩格式的图片 +PaddleSeg采用通用的文件列表方式组织训练集、验证集和测试集。 以Cityscapes数据集为例, 我们需要整理出训练集、验证集、测试集对应的原图和标注文件列表用于PaddleSeg训练即可。 diff --git a/docs/imgs/annotation/image-7.png b/docs/imgs/annotation/image-7.png index b65d56e92b2b5c1633f5c3168eee2971b476e8f3..7c24ca50361e0f602bc5a603e6377af021dbb63d 100644 Binary files a/docs/imgs/annotation/image-7.png and b/docs/imgs/annotation/image-7.png differ diff --git a/docs/imgs/annotation/jingling-5.png b/docs/imgs/annotation/jingling-5.png index 59a15567a3e25df338a3577fe9a9035c5bd0c719..5106559099570140fe91a94e2cdffffe2fdbdaca 100644 Binary files a/docs/imgs/annotation/jingling-5.png and b/docs/imgs/annotation/jingling-5.png differ diff --git a/docs/imgs/tensorboard_image.JPG b/docs/imgs/tensorboard_image.JPG index 2d5d0ceb001cb7fc9f68622842710afd9d032463..b38aeef080ece4fc0e6506ad6ad6e0b5b7751a67 100644 Binary files a/docs/imgs/tensorboard_image.JPG and b/docs/imgs/tensorboard_image.JPG differ diff --git a/docs/imgs/tensorboard_scalar.JPG b/docs/imgs/tensorboard_scalar.JPG index 2de89c32a3469764631352597f0e55f8a431ad4b..06723b925e243ecc54a9baf054be870c1e0916e1 100644 Binary files a/docs/imgs/tensorboard_scalar.JPG and b/docs/imgs/tensorboard_scalar.JPG differ diff --git a/docs/imgs/usage_vis_demo.jpg b/docs/imgs/usage_vis_demo.jpg index 50bedf2f547d11cb4aaefa0435022acc0392ba3c..fc0974359e74e7746b29c7c5a64e3180c3250964 100644 Binary files a/docs/imgs/usage_vis_demo.jpg and b/docs/imgs/usage_vis_demo.jpg differ diff --git a/docs/imgs/usage_vis_demo2.jpg b/docs/imgs/usage_vis_demo2.jpg deleted file mode 100644 index 9665e9e2f4d90d6db75411d43d0dc5a34d8b28e7..0000000000000000000000000000000000000000 Binary files a/docs/imgs/usage_vis_demo2.jpg and /dev/null differ diff --git a/docs/imgs/usage_vis_demo3.jpg b/docs/imgs/usage_vis_demo3.jpg deleted file mode 100644 index 318c06bcf7debf76b7bff504648df056802130df..0000000000000000000000000000000000000000 Binary files a/docs/imgs/usage_vis_demo3.jpg and /dev/null differ diff --git a/docs/usage.md b/docs/usage.md index e38d16e047b4b97a71278b1ba17682d20c4586ee..596d4cf112ef3c439edd3c5068720d45483f4748 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -33,7 +33,6 @@ python pdseg/train.py BATCH_SIZE 1 --cfg configs/cityscapes.yaml |--tb_log_dir|train|TensorBoard的日志路径|None|| |--do_eval|train|是否在保存模型时进行效果评估|False|| |--vis_dir|vis|保存可视化图片的路径|"visual"|| -|--also_save_raw_results|vis|是否保存原始的预测图片|False|| ## OPTIONS @@ -129,12 +128,10 @@ python pdseg/vis.py --use_gpu \ --cfg configs/unet_pet.yaml \ TEST.TEST_MODEL saved_model/unet_pet/final ``` -执行上述脚本后,会在主目录下产生一个visual/visual_results文件夹,里面存放着测试集图片的预测结果,我们选择其中几张图片进行查看,可以看到,在测试集中的图片上的预测效果已经很不错: +执行上述脚本后,会在主目录下产生一个visual文件夹,里面存放着测试集图片的预测结果,我们选择其中几张图片进行查看,可以看到,在测试集中的图片上的预测效果已经很不错: ![](./imgs/usage_vis_demo.jpg) -![](./imgs/usage_vis_demo2.jpg) -![](./imgs/usage_vis_demo3.jpg) `NOTE` -1. 可视化的图片会默认保存在visual/visual_results目录下,可以通过`--vis_dir`来指定输出目录 +1. 可视化的图片会默认保存在visual目录下,可以通过`--vis_dir`来指定输出目录 2. 训练过程中会使用DATASET.VIS_FILE_LIST中的图片进行可视化显示,而vis.py则会使用DATASET.TEST_FILE_LIST diff --git a/pdseg/vis.py b/pdseg/vis.py index fc524d91c39e8927d1e31eff71ecd41ba83e14cf..d94221c0be1a0b4abe241e75966215863d8fd35d 100644 --- a/pdseg/vis.py +++ b/pdseg/vis.py @@ -87,7 +87,7 @@ def to_png_fn(fn): def visualize(cfg, vis_file_list=None, use_gpu=False, - vis_dir="visual_predict", + vis_dir="visual", ckpt_dir=None, log_writer=None, local_test=False, @@ -117,7 +117,7 @@ def visualize(cfg, fluid.io.load_params(exe, ckpt_dir, main_program=test_prog) - save_dir = os.path.join('visual', vis_dir) + save_dir = vis_dir makedirs(save_dir) fetch_list = [pred.name]