diff --git a/docs/examples/meter_reader.md b/docs/examples/meter_reader.md index 114046d16ba4db837e143a63d47b1fcdfdd26680..016e472419b128c9b93a3360cb0e2df7bbbcf030 100644 --- a/docs/examples/meter_reader.md +++ b/docs/examples/meter_reader.md @@ -90,19 +90,19 @@ export CUDA_VISIBLE_DEVICES= * 预测单张图片 ```shell -python3 reader_infer.py --detector_dir /path/to/det_inference_model --segmenter_dir /path/to/seg_inference_model --image /path/to/meter_test/20190822_168.jpg --save_dir ./output --use_erode +python reader_infer.py --detector_dir /path/to/det_inference_model --segmenter_dir /path/to/seg_inference_model --image /path/to/meter_test/20190822_168.jpg --save_dir ./output --use_erode ``` * 预测多张图片 ```shell -python3 reader_infer.py --detector_dir /path/to/det_inference_model --segmenter_dir /path/to/seg_inference_model --image_dir /path/to/meter_test --save_dir ./output --use_erode +python reader_infer.py --detector_dir /path/to/det_inference_model --segmenter_dir /path/to/seg_inference_model --image_dir /path/to/meter_test --save_dir ./output --use_erode ``` * 开启摄像头预测 ```shell -python3 reader_infer.py --detector_dir /path/to/det_inference_model --segmenter_dir /path/to/seg_inference_model --save_dir ./output --use_erode --use_camera +python reader_infer.py --detector_dir /path/to/det_inference_model --segmenter_dir /path/to/seg_inference_model --save_dir ./output --use_erode --use_camera ``` ## 推理部署 @@ -259,12 +259,12 @@ step 5. 推理预测: * 表盘检测的训练 ``` -python3 /path/to/PaddleX/examples/meter_reader/train_detection.py +python /path/to/PaddleX/examples/meter_reader/train_detection.py ``` * 指针和刻度分割的训练 ``` -python3 /path/to/PaddleX/examples/meter_reader/train_segmentation.py +python /path/to/PaddleX/examples/meter_reader/train_segmentation.py ``` diff --git a/docs/examples/remote_sensing.md b/docs/examples/remote_sensing.md index 26c13b005fdf8642f232132266f943855e9f50e9..0085aa61b83c62329fe34f0fb6c98de84dbba2ec 100644 --- a/docs/examples/remote_sensing.md +++ b/docs/examples/remote_sensing.md @@ -31,14 +31,14 @@ cd PaddleX/examples/remote_sensing/ 运行以下脚本,下载原始数据集,并完成数据集的切分: ``` -python3 prepare_data.py +python prepare_data.py ``` ## 模型训练 分割模型选择Backbone为MobileNetv3_large_ssld的Deeplabv3模型,该模型兼备高性能高精度的优点。运行以下脚本,进行模型训练: ``` -python3 train.py +python train.py ``` 也可以跳过模型训练步骤,直接下载预训练模型进行后续的模型预测和评估: @@ -71,12 +71,12 @@ tar -xvf ccf_remote_model.tar.gz 运行以下脚本使用有重叠的滑动窗口进行预测: ``` -python3 predict.py +python predict.py ``` ## 模型评估 在训练过程中,每隔10个迭代轮数会评估一次模型在验证集的精度。由于已事先将原始大尺寸图片切分成小块,此时相当于使用无重叠的大图切小图预测方式,最优模型精度miou为80.58%。运行以下脚本,将采用有重叠的大图切小图的预测方式,重新评估原始大尺寸图片的模型精度,此时miou为81.52%。 ``` -python3 eval.py +python eval.py ``` diff --git a/examples/meter_reader/README.md b/examples/meter_reader/README.md index a5cae4af0cc3ace2ee80b10ccc44c2fff79ea0cc..84417894f4d0228c2f2660864d9d673a8293fac4 100644 --- a/examples/meter_reader/README.md +++ b/examples/meter_reader/README.md @@ -99,19 +99,19 @@ export CUDA_VISIBLE_DEVICES= * 预测单张图片 ```shell -python3 reader_infer.py --detector_dir /path/to/det_inference_model --segmenter_dir /path/to/seg_inference_model --image /path/to/meter_test/20190822_168.jpg --save_dir ./output --use_erode +python reader_infer.py --detector_dir /path/to/det_inference_model --segmenter_dir /path/to/seg_inference_model --image /path/to/meter_test/20190822_168.jpg --save_dir ./output --use_erode ``` * 预测多张图片 ```shell -python3 reader_infer.py --detector_dir /path/to/det_inference_model --segmenter_dir /path/to/seg_inference_model --image_dir /path/to/meter_test --save_dir ./output --use_erode +python reader_infer.py --detector_dir /path/to/det_inference_model --segmenter_dir /path/to/seg_inference_model --image_dir /path/to/meter_test --save_dir ./output --use_erode ``` * 开启摄像头预测 ```shell -python3 reader_infer.py --detector_dir /path/to/det_inference_model --segmenter_dir /path/to/seg_inference_model --save_dir ./output --use_erode --use_camera +python reader_infer.py --detector_dir /path/to/det_inference_model --segmenter_dir /path/to/seg_inference_model --save_dir ./output --use_erode --use_camera ``` ##

推理部署

@@ -269,12 +269,12 @@ git clone https://github.com/PaddlePaddle/PaddleX * 表盘检测的训练 ``` -python3 /path/to/PaddleX/examples/meter_reader/train_detection.py +python /path/to/PaddleX/examples/meter_reader/train_detection.py ``` * 指针和刻度分割的训练 ``` -python3 /path/to/PaddleX/examples/meter_reader/train_segmentation.py +python /path/to/PaddleX/examples/meter_reader/train_segmentation.py ``` diff --git a/examples/multi-channel_remote_sensing/predict.py b/examples/multi-channel_remote_sensing/predict.py index 33ba8b4e541bb1b1dc09ff4a827bae0ca155d0ac..f543bdfc5e91c29533e830405a38f20e02860ceb 100644 --- a/examples/multi-channel_remote_sensing/predict.py +++ b/examples/multi-channel_remote_sensing/predict.py @@ -3,7 +3,7 @@ from PIL import Image import paddlex as pdx -model_dir = "saved_model/remote_sensing_unet/best_model/" +model_dir = "l8sparcs_remote_model/" img_file = "dataset/remote_sensing_seg/data/LC80150242014146LGN00_23_data.tif" label_file = "dataset/remote_sensing_seg/mask/LC80150242014146LGN00_23_mask.png" color = [255, 255, 255, 0, 0, 0, 255, 255, 0, 255, 0, 0, 150, 150, 150] @@ -11,6 +11,7 @@ color = [255, 255, 255, 0, 0, 0, 255, 255, 0, 255, 0, 0, 150, 150, 150] # 预测并可视化预测结果 model = pdx.load_model(model_dir) pred = model.predict(img_file) +#pred = model.overlap_tile_predict(img_file, tile_size=[512, 512], pad_size=[64, 64], batch_size=32) pdx.seg.visualize( img_file, pred, weight=0., save_dir='./output/pred', color=color) diff --git a/examples/remote_sensing/README.md b/examples/remote_sensing/README.md index 2663754d1995bc810f1fafb838c4045ab4761faa..eefe9077b16a840260fdbb7b07ae53e30c242edb 100644 --- a/examples/remote_sensing/README.md +++ b/examples/remote_sensing/README.md @@ -37,14 +37,14 @@ cd PaddleX/examples/remote_sensing/ 运行以下脚本,下载原始数据集,并完成数据集的切分: ``` -python3 prepare_data.py +python prepare_data.py ``` ##

模型训练

分割模型选择Backbone为MobileNetv3_large_ssld的Deeplabv3模型,该模型兼备高性能高精度的优点。运行以下脚本,进行模型训练: ``` -python3 train.py +python train.py ``` 也可以跳过模型训练步骤,直接下载预训练模型进行后续的模型预测和评估: @@ -77,12 +77,12 @@ tar -xvf ccf_remote_model.tar.gz 运行以下脚本使用有重叠的滑动窗口进行预测: ``` -python3 predict.py +python predict.py ``` ##

模型评估

在训练过程中,每隔10个迭代轮数会评估一次模型在验证集的精度。由于已事先将原始大尺寸图片切分成小块,此时相当于使用无重叠的滑动窗口预测方式,最优模型精度miou为80.58%。运行以下脚本,将采用有重叠的滑动窗口预测方式,重新评估原始大尺寸图片的模型精度,此时miou为81.52%。 ``` -python3 eval.py +python eval.py ```