diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/README.md b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/README.md similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/README.md rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/README.md diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/accuracy_improvement.md b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/accuracy_improvement.md similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/accuracy_improvement.md rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/accuracy_improvement.md diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/1.train_ppyolov2_imagenet.py b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/1.train_ppyolov2_imagenet.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/1.train_ppyolov2_imagenet.py rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/1.train_ppyolov2_imagenet.py diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/2.train_ppyolov2_imagenet_aug.py b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/2.train_ppyolov2_imagenet_aug.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/2.train_ppyolov2_imagenet_aug.py rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/2.train_ppyolov2_imagenet_aug.py diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/3.train_ppyolov2_coco.py b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/3.train_ppyolov2_coco.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/3.train_ppyolov2_coco.py rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/3.train_ppyolov2_coco.py diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/4.train_ppyolov2_coco_aug.py b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/4.train_ppyolov2_coco_aug.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/4.train_ppyolov2_coco_aug.py rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/4.train_ppyolov2_coco_aug.py diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/5.train_ppyolov2_coco_aug_noSPP.py b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/5.train_ppyolov2_coco_aug_noSPP.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/5.train_ppyolov2_coco_aug_noSPP.py rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/5.train_ppyolov2_coco_aug_noSPP.py diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/6.train_ppyolov2_r50_aug_COCO_addneg.py b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/6.train_ppyolov2_r50_aug_COCO_addneg.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/6.train_ppyolov2_r50_aug_COCO_addneg.py rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/6.train_ppyolov2_r50_aug_COCO_addneg.py diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/7.train_ppyolov2_r101_aug_COCO_addneg.py b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/7.train_ppyolov2_r101_aug_COCO_addneg.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/7.train_ppyolov2_r101_aug_COCO_addneg.py rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/7.train_ppyolov2_r101_aug_COCO_addneg.py diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/8.train_ppyolo.py b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/8.train_ppyolo.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/8.train_ppyolo.py rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/8.train_ppyolo.py diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/9.train_yolov3_coco.py b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/9.train_yolov3_coco.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/9.train_yolov3_coco.py rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/9.train_yolov3_coco.py diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/infer.py b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/infer.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/infer.py rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/infer.py diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/metric.py b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/metric.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/metric.py rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/metric.py diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/predict.py b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/predict.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/predict.py rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/predict.py diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/test_imgs/test.jpg b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/test_imgs/test.jpg similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/code/test_imgs/test.jpg rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/code/test_imgs/test.jpg diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/dataset.png b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/dataset.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/dataset.png rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/dataset.png diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/demo.png b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/demo.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/demo.png rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/demo.png diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/deploy.png b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/deploy.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/deploy.png rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/deploy.png diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/eval_1.png b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/eval_1.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/eval_1.png rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/eval_1.png diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/eval_2.png b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/eval_2.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/eval_2.png rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/eval_2.png diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/hard_1.png b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/hard_1.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/hard_1.png rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/hard_1.png diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/predict.jpg b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/predict.jpg similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/predict.jpg rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/predict.jpg diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/predict_result.png b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/predict_result.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/predict_result.png rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/predict_result.png diff --git a/Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/train.png b/Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/train.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Fire_and_Smoke_Detection/docs/images/train.png rename to Paddle_Industry_Practice_Sample_Library/Fire&Smoke_Detection/docs/images/train.png diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/1.png b/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/1.png deleted file mode 100755 index 23b6c6c38..000000000 Binary files a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/1.png and /dev/null differ diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/README.md b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/README.md similarity index 88% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/README.md rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/README.md index ada08a9e8..4e5a6c646 100755 --- a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/README.md +++ b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/README.md @@ -1,28 +1,19 @@ # 安全帽检测 -> 基于Paddlex2.0API开发 ## 1.项目说明 -在该项目中,主要向大家介绍如何使用目标检测来实现对安全帽的检测,涉及代码以及优化过程亦可用于其它目标检测任务等。 - -在施工现场,对于来往人员,以及工作人员而言,安全问题至关重要。而安全帽更是保障施工现场在场人员安全的第一防线,因此需要对场地中的人员进行安全提醒。当人员未佩戴安全帽进入施工场所时,人为监管耗时耗力,而且不易实时监管,过程繁琐、消耗人力且实时性较差。针对上述问题,希望通过**视频监控->目标检测->智能督导**的方式智能、高效的完成此任务: +在施工现场,现场往来和工作人员的安全问题极为重要,安全帽是保障现场人员安全的第一道防线。及时排查安全帽佩戴的规范性并给予提醒,可以大大降低施工安全隐患。但是人为监管耗时耗力、过程繁琐、消耗人力且实时性较差。
- -
+ + **业务难点:** -- **精度要求高** 由于涉及安全问题,需要精度非常高才能保证对施工场所人员的安全督导。需要专门针对此目标的检测算法进行优化,另外,还需要处理拍摄角度、光线不完全受控,安全帽显示不全、可能存在遮挡等情况。 -- **小目标检测** 由于实际使用过程中,人员里镜头较远,因此需要模型对小目标的检测有较低的漏检率。 - -
-
- - - +- **精度要求高** 由于涉及安全问题,对模型精度有较高要求,除了专门针对此目标的检测算法进行优化外,还需要处理拍摄角度、光线不完全受控,安全帽显示不全、可能存在遮挡等情况。 +- **小目标检测** 实际使用过程中,人员往往离镜头较远,因此需要模型对小目标的检测有较低的漏检率。 ## 2.数据准备 @@ -202,4 +193,5 @@ paddlex --export_inference --model_dir=output/yolov3_darknet53/best_model --save - +* 感谢[蔡敬辉](https://github.com/cjh3020889729)同学对本案例的贡献 +* 本项目数据来源于:[njvisionpower](https://github.com/njvisionpower/Safety-Helmet-Wearing-Dataset)整理收集的安全帽数据集,在此表达感谢。 diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/accuracy_improvement.md b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/accuracy_improvement.md similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/accuracy_improvement.md rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/accuracy_improvement.md diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/code/infer.py b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/code/infer.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/code/infer.py rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/code/infer.py diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/code/train.py b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/code/train.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/code/train.py rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/code/train.py diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/1.png b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/1.png new file mode 100755 index 000000000..c5ea059cb Binary files /dev/null and b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/1.png differ diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/10.png b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/10.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/10.png rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/10.png diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/11.png b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/11.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/11.png rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/11.png diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/12.png b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/12.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/12.png rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/12.png diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/13.png b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/13.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/13.png rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/13.png diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/14.png b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/14.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/14.png rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/14.png diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/2.png b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/2.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/2.png rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/2.png diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/3.jpg b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/3.jpg similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/3.jpg rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/3.jpg diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/4.png b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/4.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/4.png rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/4.png diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/5.png b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/5.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/5.png rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/5.png diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/6.png b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/6.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/6.png rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/6.png diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/7.png b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/7.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/7.png rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/7.png diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/8.png b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/8.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/8.png rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/8.png diff --git a/Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/9.png b/Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/9.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/Hemtle Detection/images/9.png rename to Paddle_Industry_Practice_Sample_Library/Hemtle_Detection/images/9.png diff --git a/Paddle_Industry_Practice_Sample_Library/README.md b/Paddle_Industry_Practice_Sample_Library/README.md index 68ada5b8a..cb41b3aee 100644 --- a/Paddle_Industry_Practice_Sample_Library/README.md +++ b/Paddle_Industry_Practice_Sample_Library/README.md @@ -6,14 +6,14 @@ | 行业 | 案例 | | -------- | ------------------------------------------------------------ | -| 智慧城市 | [火灾烟雾检测](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Fire_and_Smoke_Detection) | +| 智慧城市 | [火灾烟雾检测](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Fire&Smoke_Detection) | | 智慧城市 | [人流量统计](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Pedestrian_Detection_and_Tracking) | | 智慧城市 | [车流量统计](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Vehicle_Detection_and_Tracking) | -| 智慧城市 | [安全帽检测](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Hemtle%20Detection) | +| 智慧城市 | [安全帽检测](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Hemtle_Detection) | | 智慧城市 | [电子快递单信息提取](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Waybill_Information_Extraction) | -| 智能制造 | [工业指针型表计读数](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/meter_reader) | -| 智能制造 | [钢材缺陷检测](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/paddlex_steel_defect_seg-master) | -| 智能制造 | [钢筋计数](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/rebar_count) | -| 智能制造 | [机械手抓取](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/robot_grab) | +| 智能制造 | [工业指针型表计读数](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/meter_Reader) | +| 智能制造 | [钢材缺陷检测](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Steel_Detection) | +| 智能制造 | [钢筋计数](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Rebar_Count) | +| 智能制造 | [机械手抓取](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Robot_Grab) | | 互联网 | [财报识别与关键字段抽取](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Report_Recognition_and_Analysis) | diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/HRNet.md b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/HRNet.md similarity index 96% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/HRNet.md rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/HRNet.md index 6c04b5c76..f18bedfa4 100644 --- a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/HRNet.md +++ b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/HRNet.md @@ -1,3 +1,5 @@ + +# 基于HRNet的模型优化 在项目中,我们采用HRNET作为钢板缺陷分割的模型。具体代码请参考[train.py](./train.py)。 运行如下代码开始训练模型(单机单卡): @@ -116,4 +118,7 @@ train_transforms = T.Compose([ | -- | -- | -- | -- | -- | -- | -- | -- | | HRNET | 150 | 800x128 | 16 | 0.01 | CrossEntropyLoss|RandomHorizontalFlip | 62.75% | HRNET | 150 | 800x128 | 16 | 0.01 | CrossEntropyLoss+DiceLoss|RandomHorizontalFlip | 64.46% -| HRNET | 150 | 800x128 | 16 | 0.01 | CrossEntropyLoss+DiceLoss|RandomHorizontalFlip+RandomDistort | 64.46% +| HRNET | 150 | 800x128 | 16 | 0.01 | CrossEntropyLoss+DiceLoss|RandomCrop+RandomHorizontalFlip+RandomDistort+RandomBlur | 66.35% + +可以看到,通过添加数据增强又上升了1.89%。 + diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/README.md b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/README.md similarity index 77% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/README.md rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/README.md index 872d488a0..ca8005fd2 100755 --- a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/README.md +++ b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/README.md @@ -1,32 +1,21 @@ # 钢材缺陷检测项目案例 -- [钢材缺陷检测项目案例](#钢材缺陷检测项目案例) - - [一、项目简介](#一项目简介) - - [二、 数据集分析](#二-数据集分析) - - [2.1 读取和分析文本数据](#21-读取和分析文本数据) - - [2.2 读取和分析图像数据](#22-读取和分析图像数据) - - [2.3 可视化数据集](#23-可视化数据集) - - [三、制作标准数据集](#三制作标准数据集) - - [3.1 PaddleX数据集格式说明](#31-paddlex数据集格式说明) - - [3.2 数据转换](#32-数据转换) - - [3.3 数据切分](#33-数据切分) - - [四、训练和验证](#四训练和验证) - - [4.1 基于HRNET进行优化](基于HRNet) - - [4.2 基于UNet进行优化](#42-模型预测) - - [五、部署](#五部署) - - [5.1 模型导出](#51-模型导出) - - [5.2 C#桌面部署](#52-c桌面部署) + ## 一、项目简介 -本项目来源于Kaggle上一个[钢材表面缺陷检测竞赛](https://www.kaggle.com/c/severstal-steel-defect-detection/overview),这也是一个非常好的将深度学习应用于传统工业材料检测的案例。本项目将使用百度飞桨[PaddleX](https://github.com/PaddlePaddle/PaddleX)深度学习算法套件进行开发,全流程剖析整个实现过程。 +作为生产制造过程中必不可少的一步,物体表面缺陷检测广泛应用于工业领域,如:3C、半导体、电子、汽车、化工、医药、轻工、军工等行业。而钢材作为基础的工业材料,在出厂之前的检测更加严格。 + +针对上述场景,PaddleX提供可视化、自动化的AI质检方案,帮助企业提升生产效率,实现智能质检。 + -钢材是现代最重要的建筑材料之一。刚材结构建筑能够抵抗自然和人为磨损,这使得这种材料在世界各地随处可见。在所有钢材加工环节中,平板钢的生产工艺特别精细。从加热、轧制,再到干燥和切割,需要几台机器协同操作,其中一个重要环节就是利用高清摄像头捕获的图像对加工环节中的钢材进行缺陷自动检测。Kaggle上举办的这场钢材缺陷竞赛希望各位参赛者利用机器学习来改进钢板表面缺陷检测算法精度,提高钢铁生产自动化程度。
- +
## 二、 数据集分析 -这个竞赛主要目的是定位和分类钢板表面缺陷,属于语义分割问题。对应的数据集可以从[Kaggle竞赛官网](https://www.kaggle.com/c/severstal-steel-defect-detection/data)下载,也可以从[ai studio](https://aistudio.baidu.com/aistudio/datasetdetail/12731?_=1634357183077)进行下载。下载下来后包含两个图像文件夹和两个标注文件: +本项目来源于Kaggle上一个[钢材表面缺陷检测竞赛](https://www.kaggle.com/c/severstal-steel-defect-detection/overview),这也是一个非常好的将深度学习应用于传统工业材料检测的案例。 + +这个竞赛主要目的是定位和分类钢板表面缺陷,属于语义分割问题。对应的数据集可以从[Kaggle竞赛官网](https://www.kaggle.com/c/severstal-steel-defect-detection/data)下载,下载下来后包含两个图像文件夹和两个标注文件:
@@ -37,7 +26,7 @@ * **train.csv**:该文件中存储训练图像的缺陷标注,有4类缺陷,ClassId = [1, 2, 3, 4] * **sample_submission.csv**:该文件是一个上传文件的样例,每个ImageID要有4行,每一行对应一类缺陷 -对于竞赛项目来说,拿到数据后我们首先要做的就是先对数据集进行分析。下面我们按照文本和图像逐步来分析这个数据集。 +拿到数据后我们首先要做的就是先对数据集进行分析。下面我们按照文本和图像逐步来分析这个数据集。 ### 2.1 读取和分析文本数据 假设下载下来的数据集放在名为severstal的文件夹中,首先读取csv文本数据 @@ -399,13 +388,8 @@ for idx in idx_class_triple: ## 三、制作标准数据集 ### 3.1 PaddleX数据集格式说明 -从前面的数据分析中我们看到钢板图像的每个像素只属于1种缺陷类别(或者没缺陷),由于我们需要定位出钢板缺陷的精细区域,因此可以把这个任务看作是一个语义分割任务,即按照像素级别精度判断每个像素所属的缺陷类别。 - -接下来我们就可以使用语义分割算法进行训练和验证。本项目采用百度飞桨PaddleX算法套件来快速训练。PaddleX是飞桨全流程开发工具,集飞桨核心框架、模型库、工具及组件等深度学习开发所需全部能力于一身,打通深度学习开发全流程。简单来说,使用PaddleX有两个明显的好处: -* **快速验证算法模型**:无论是做工业项目还是参加类似Kaggle的竞赛,没有一个算法是通吃的,那么我们必然需要尝试很多不同的算法,这时候快速验证算法模型有效性就显得尤为重要。对于一个未知的深度学习任务来说,我们刚开始并不知道到底使用什么样的模型算法去处理才能得到一个比较好的基准值,这时候就需要有一个接口切换简单、实现快捷方便、算法功能齐全的算法库工具,能够让我们快速的去验证模型有效性,这里PaddleX就是这样一个比较好的工具,它包含了图像分类、分割、检测等常见的、实用的深度学习模型,而且接口进行了高度统一,我们可以使用它来快速的训练各个模型,并选取一个比较好的基准值。在这个基础上,我们再去进行算法优化。 -* **模型快速部署**:对于真实的工业任务来说,不光要训练得到一个高精度的算法模型,还需要考虑部署的便捷性和有效性。很多模型尽管精度很高,但是由于采用了非常嵌套的动态图模型编写方式,如果将其直接静态图导出或者转成onnx往往会遇到问题,那么这时候必然需要算法工程师手动去修改模型,这对于真实项目来说会极大的增加项目开发难度,降低项目开发效率。使用PaddleX的好处在于,在PaddleX中的模型基本都已经被验证过了,能够在多种平台上进行落地部署,比如C++推理、手机移动端推理等,同时还给出了详细的部署教程,因此,选择PaddleX进行真实深度学习产品开发或者打比赛都是一个不错的选择。 +从前面的数据分析中我们看到钢板图像的每个像素只属于1种缺陷类别(或者没缺陷),由于需要定位出钢板缺陷的精细区域,因此可以把这个任务看作是一个语义分割任务,即按照像素级别精度判断每个像素所属的缺陷类别。 -**PaddleX安装方法**参考[官网](https://github.com/PaddlePaddle/PaddleX)。本项目使用PaddleX v2.0.0版本进行实现。 为了能够使用PaddleX进行语义分割训练,我们首先要对数据集格式进行转化。PaddleX语义分割算法[要求](https://github.com/PaddlePaddle/PaddleX/blob/release/2.0.0/docs/data/format/segmentation.md)数据集按照如下方式进行组织: @@ -447,7 +431,6 @@ python prepare_dataset.py ``` 这个文件用来指明当前到底有哪些像素标签值(本项目共4种缺陷,对应标签为1、2、3、4,这里的0标签表示背景) -转换完的数据集也可以直接从ai studio上进行[下载](https://aistudio.baidu.com/aistudio/datasetdetail/112904)。 ### 3.3 数据切分 在模型进行训练时,我们需要划分训练集,验证集和测试集,可直接使用paddlex命令将数据集随机划分。本项目将训练集、验证集和测试集按照8.5:1:0.5的比例划分。 PaddleX中提供了简单易用的API,方便用户直接使用进行数据划分。具体命令如下: @@ -486,3 +469,6 @@ paddlex --export_inference --model_dir=output/hrnet/best_model --save_dir=output
+ +* 感谢[佟兴宇](https://github.com/txyugood)、[钱彬](https://github.com/qianbin1989228)两位同学对于本案例的贡献。 +* 示例图片引用说明:本项目中示例数据源于Kaggle[钢材表面缺陷检测竞赛](https://www.kaggle.com/c/severstal-steel-defect-detection/overview) \ No newline at end of file diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/UNet.md b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/UNet.md similarity index 99% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/UNet.md rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/UNet.md index 554d968b1..a1c492423 100644 --- a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/UNet.md +++ b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/UNet.md @@ -1,4 +1,4 @@ -# 精度优化 +# 基于UNet的精度优化 本小节侧重展示在模型迭代过程中优化精度的思路,在本案例中,有些优化策略获得了精度收益,而有些没有。在其他质检场景中,可根据实际情况尝试这些优化策略。 diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/code/__init__.py b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/code/__init__.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/code/__init__.py rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/code/__init__.py diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/code/calc_fps.py b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/code/calc_fps.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/code/calc_fps.py rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/code/calc_fps.py diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/code/infer.py b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/code/infer.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/code/infer.py rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/code/infer.py diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/code/prepare_dataset.py b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/code/prepare_dataset.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/code/prepare_dataset.py rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/code/prepare_dataset.py diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/code/train_hrnet.py b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/code/train_hrnet.py similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/code/train_hrnet.py rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/code/train_hrnet.py diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/4e8e7a28c.jpg b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/4e8e7a28c.jpg similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/4e8e7a28c.jpg rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/4e8e7a28c.jpg diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/9d34d1ed3.jpg b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/9d34d1ed3.jpg similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/9d34d1ed3.jpg rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/9d34d1ed3.jpg diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/all.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/all.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/all.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/all.png diff --git a/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/csharp.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/csharp.png new file mode 100644 index 000000000..0d790fea7 Binary files /dev/null and b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/csharp.png differ diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/dataset.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/dataset.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/dataset.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/dataset.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/fig1.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/fig1.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/fig1.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/fig1.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/fig2.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/fig2.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/fig2.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/fig2.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/fig3.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/fig3.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/fig3.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/fig3.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/gt1.jpg b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/gt1.jpg similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/gt1.jpg rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/gt1.jpg diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/gt2.jpg b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/gt2.jpg similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/gt2.jpg rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/gt2.jpg diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/gt_4e8e7a28c.jpg b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/gt_4e8e7a28c.jpg similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/gt_4e8e7a28c.jpg rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/gt_4e8e7a28c.jpg diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/gt_9d34d1ed3.jpg b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/gt_9d34d1ed3.jpg similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/gt_9d34d1ed3.jpg rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/gt_9d34d1ed3.jpg diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/no_1.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/no_1.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/no_1.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/no_1.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/no_2.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/no_2.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/no_2.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/no_2.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/no_3.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/no_3.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/no_3.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/no_3.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/no_4.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/no_4.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/no_4.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/no_4.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/no_5.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/no_5.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/no_5.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/no_5.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/pre1.jpg b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/pre1.jpg similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/pre1.jpg rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/pre1.jpg diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/pre2.jpg b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/pre2.jpg similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/pre2.jpg rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/pre2.jpg diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/result.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/result.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/result.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/result.png diff --git a/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/steel_demo.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/steel_demo.png new file mode 100644 index 000000000..d1c40ea0c Binary files /dev/null and b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/steel_demo.png differ diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/visualize_4e8e7a28c.jpg b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/visualize_4e8e7a28c.jpg similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/visualize_4e8e7a28c.jpg rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/visualize_4e8e7a28c.jpg diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/visualize_9d34d1ed3.jpg b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/visualize_9d34d1ed3.jpg similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/visualize_9d34d1ed3.jpg rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/visualize_9d34d1ed3.jpg diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes1_1.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes1_1.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes1_1.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes1_1.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes1_2.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes1_2.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes1_2.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes1_2.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes1_3.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes1_3.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes1_3.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes1_3.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes1_4.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes1_4.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes1_4.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes1_4.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes1_5.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes1_5.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes1_5.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes1_5.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes2_1.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes2_1.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes2_1.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes2_1.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes2_2.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes2_2.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes2_2.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes2_2.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes2_3.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes2_3.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes2_3.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes2_3.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes2_4.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes2_4.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes2_4.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes2_4.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes2_5.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes2_5.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes2_5.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes2_5.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes3_1.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes3_1.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes3_1.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes3_1.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes3_2.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes3_2.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes3_2.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes3_2.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes3_3.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes3_3.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes3_3.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes3_3.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes3_4.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes3_4.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes3_4.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes3_4.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes3_5.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes3_5.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes3_5.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes3_5.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes4_1.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes4_1.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes4_1.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes4_1.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes4_2.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes4_2.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes4_2.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes4_2.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes4_3.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes4_3.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes4_3.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes4_3.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes4_4.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes4_4.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes4_4.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes4_4.png diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes4_5.png b/Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes4_5.png similarity index 100% rename from Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/yes4_5.png rename to Paddle_Industry_Practice_Sample_Library/Steel_Detection/images/yes4_5.png diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/README.md b/Paddle_Industry_Practice_Sample_Library/meter_reader/README.md old mode 100755 new mode 100644 index 55fa4b378..c979af6ba --- a/Paddle_Industry_Practice_Sample_Library/meter_reader/README.md +++ b/Paddle_Industry_Practice_Sample_Library/meter_reader/README.md @@ -374,7 +374,7 @@ mkdir projects cd projects git clone https://github.com/PaddlePaddle/PaddleX.git cd PaddleX -git checkout release/2.0.0 +git checkout develop ``` ### Step2: 下载PaddleX Manufature SDK @@ -484,4 +484,4 @@ Meter 2: 6.21739101 在分割模型可视化的预测结果保存在`PaddleX\examples\meter_reader\deploy\cpp\meter_reader\out\build\x64-Release\output_seg`,可以点击进行查看: | 表1可视化分割结果 | 表2可视化分割结果| | -- | -- | -| ![](./images/20190822_168_06-30-17-09-33-217.jpg) | ![](20190822_168_06-30-17-09-33-213.jpg) | +| ![](./images/20190822_168_06-30-17-09-33-217.jpg) | ![](./images/20190822_168_06-30-17-09-33-213.jpg) | diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/20190822_105.jpg b/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/20190822_105.jpg old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/CMakeLists.txt b/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/CMakeSettings.json b/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/CMakeSettings.json old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/include/meter_config.h b/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/include/meter_config.h old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/include/reader_postprocess.h b/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/include/reader_postprocess.h old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/meter_pipeline.yml b/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/meter_pipeline.yml old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/meter_reader.cpp b/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/meter_reader.cpp old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/src/meter_config.cpp b/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/src/meter_config.cpp old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/src/reader_postprocess.cpp b/Paddle_Industry_Practice_Sample_Library/meter_reader/deploy/cpp/meter_reader/src/reader_postprocess.cpp old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/images/20190822_168.jpg b/Paddle_Industry_Practice_Sample_Library/meter_reader/images/20190822_168.jpg old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/images/20190822_168_06-30-17-09-33-213.jpg b/Paddle_Industry_Practice_Sample_Library/meter_reader/images/20190822_168_06-30-17-09-33-213.jpg old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/images/20190822_168_06-30-17-09-33-217.jpg b/Paddle_Industry_Practice_Sample_Library/meter_reader/images/20190822_168_06-30-17-09-33-217.jpg old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/images/MeterReader_Architecture.jpg b/Paddle_Industry_Practice_Sample_Library/meter_reader/images/MeterReader_Architecture.jpg old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/images/det_data.png b/Paddle_Industry_Practice_Sample_Library/meter_reader/images/det_data.png old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/images/scene_introduce.jpg b/Paddle_Industry_Practice_Sample_Library/meter_reader/images/scene_introduce.jpg old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/images/seg_data.png b/Paddle_Industry_Practice_Sample_Library/meter_reader/images/seg_data.png old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/images/step5_1.png b/Paddle_Industry_Practice_Sample_Library/meter_reader/images/step5_1.png old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/images/step5_2-1.png b/Paddle_Industry_Practice_Sample_Library/meter_reader/images/step5_2-1.png old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/images/step5_2-2.png b/Paddle_Industry_Practice_Sample_Library/meter_reader/images/step5_2-2.png old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/images/step5_3.png b/Paddle_Industry_Practice_Sample_Library/meter_reader/images/step5_3.png old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/images/step5_4.png b/Paddle_Industry_Practice_Sample_Library/meter_reader/images/step5_4.png old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/images/step6_det.png b/Paddle_Industry_Practice_Sample_Library/meter_reader/images/step6_det.png old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/images/step6_seg.png b/Paddle_Industry_Practice_Sample_Library/meter_reader/images/step6_seg.png old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/images/visualize_1624716128584.jpg b/Paddle_Industry_Practice_Sample_Library/meter_reader/images/visualize_1624716128584.jpg old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/reader_infer.py b/Paddle_Industry_Practice_Sample_Library/meter_reader/reader_infer.py old mode 100755 new mode 100644 index 2b6f40468..e4abb5a2e --- a/Paddle_Industry_Practice_Sample_Library/meter_reader/reader_infer.py +++ b/Paddle_Industry_Practice_Sample_Library/meter_reader/reader_infer.py @@ -263,7 +263,7 @@ def erode(self, seg_results, erode_kernel): eroded_results = seg_results for i in range(len(seg_results)): eroded_results[i]['label_map'] = cv2.erode( - seg_results[i]['label_map'], kernel) + seg_results[i]['label_map'].astype(np.uint8), kernel) return eroded_results def circle_to_rectangle(self, seg_results): diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/train_detection.py b/Paddle_Industry_Practice_Sample_Library/meter_reader/train_detection.py old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/meter_reader/train_segmentation.py b/Paddle_Industry_Practice_Sample_Library/meter_reader/train_segmentation.py old mode 100755 new mode 100644 diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/csharp.png b/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/csharp.png deleted file mode 100644 index 8839f2d39..000000000 Binary files a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/csharp.png and /dev/null differ diff --git a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/steel_demo.png b/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/steel_demo.png deleted file mode 100755 index 9e9c60e59..000000000 Binary files a/Paddle_Industry_Practice_Sample_Library/paddlex_steel_defect_seg-master/images/steel_demo.png and /dev/null differ diff --git a/Paddle_Industry_Practice_Sample_Library/rebar_count/LICENSE b/Paddle_Industry_Practice_Sample_Library/rebar_count/LICENSE deleted file mode 100755 index 261eeb9e9..000000000 --- a/Paddle_Industry_Practice_Sample_Library/rebar_count/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/Paddle_Industry_Practice_Sample_Library/rebar_count/README.md b/Paddle_Industry_Practice_Sample_Library/rebar_count/README.md index 9d3020118..1291e5463 100755 --- a/Paddle_Industry_Practice_Sample_Library/rebar_count/README.md +++ b/Paddle_Industry_Practice_Sample_Library/rebar_count/README.md @@ -1,33 +1,25 @@ # 钢筋计数 -> 基于Paddlex1.3.11API 开发 - ## 1.项目说明 -在该项目中,主要向大家介绍如何使用目标检测来实现对钢筋计数。涉及代码亦可用于车辆计数、螺母计数、圆木计数等。 - -在工地现场,对于进场的钢筋车,验收人员需要对车上的钢筋进行现场人工点根,确认数量后钢筋车才能完成进场卸货。上述过程繁琐、消耗人力且速度很慢。针对上述问题,希望通过手机拍照->目标检测计数->人工修改少量误检的方式智能、高效的完成此任务: +在工地现场,验收人员需要对入场车辆上的钢筋进行现场人工点根,确认数量无误后,才能进场卸货。上述过程繁琐、速度慢,耗费大量的人力成本 +针对上述问题,飞桨PaddleX通过与摄像头结合,可以实现自动钢筋计数,再结合人工修改少量误检的方式,可以智能、高效地完成此任务。
- +
- +除钢筋计数外,本案例中介绍的方案同样适用于密集检测的移动端部署场景,如:餐饮计数,药品计数,零件计数等。 **业务难点:** -- **精度要求高** 钢筋本身价格较昂贵,且在实际使用中数量很大,误检和漏检都需要人工在大量的标记点中找出,所以需要精度非常高才能保证验收人员的使用体验。需要专门针对此密集目标的检测算法进行优化,另外,还需要处理拍摄角度、光线不完全受控,钢筋存在长短不齐、可能存在遮挡等情况。 -- **钢筋尺寸不一** 钢筋的直径变化范围较大且截面形状不规则、颜色不一,拍摄的角度、距离也不完全受控,这也导致传统算法在实际使用的过程中效果很难稳定。 -- **边界难以区分** 一辆钢筋车一次会运输很多捆钢筋,如果直接全部处理会存在边缘角度差、遮挡等问题效果不好,目前在用单捆处理+最后合计的流程,这样的处理过程就会需要对捆间进行分割或者对最终结果进行去重,难度较大。 - -
- -
- +- **精度要求高** 实际业务中,钢筋数量庞大,容易导致模型误检和漏检,需要专门针对此密集目标的检测算法进行优化; +- **钢筋尺寸不一** 钢筋的直径变化范围较大且截面形状不规则、颜色不一,拍摄的角度、距离也不完全受控,导致传统算法在实际使用的过程中效果不稳定; +- **边界难以区分** 钢筋车每次会装载很多捆钢筋,如果直接全部处理会存在边缘角度差、遮挡等问题。而使用“单捆处理+合计”的方式,需要对捆间进行分割或者对最终结果进行去重,难度较大。 ## 2.数据准备 -数据集中包含了250张已经标注好的数据,具体数据源于datafountain平台,用户可直接访问[链接](https://www.datafountain.cn/competitions/332/datasets)下载 +数据集中包含了250张已经标注好的数据,具体数据源于datafountain和广联达公司举办的钢筋计数比赛,用户可直接访问[链接](https://www.datafountain.cn/competitions/332/datasets)下载 更多数据格式信息请参考[数据标注说明文档](https://paddlex.readthedocs.io/zh_CN/develop/data/annotation/index.html) @@ -148,7 +140,7 @@ python code/infer.py 预测结果如下:
- +
# 7.模型导出 @@ -207,12 +199,12 @@ paddlex --export_inference --model_dir=output/yolov3_ResNet50_vd_ssld/best_model - **召回率更低**,可能有更少的误检——但由于模型轻量化缘故,漏检情况可能会更多一点。 ## 9.模型部署方式 - - - -模型部署采用了PaddleX提供的C++ inference部署方案,在方案中提供了C#部署[Demo](https://github.com/PaddlePaddle/PaddleX/tree/release/2.0.0/examples/C%23_deploy),用户可根据实际情况自行参考。 +模型部署采用了PaddleX提供的C++ inference部署方案,在方案中提供了基于Paddle Lite部署[Demo](https://github.com/yzl19940819/example_Demo/tree/master/android_demo),用户可根据实际情况自行参考。
- +
+* 感谢[蔡敬辉](https://github.com/cjh3020889729)同学对本案例的贡献 +* 示例图片引用说明:案例中钢筋数据样本源于datafountain和广联达公司举办的钢筋计数比赛,用户可直接访问[链接](https://www.datafountain.cn/competitions/332/datasets) + diff --git a/Paddle_Industry_Practice_Sample_Library/rebar_count/images/1.png b/Paddle_Industry_Practice_Sample_Library/rebar_count/images/1.png index 6e9345e78..76240d3c3 100755 Binary files a/Paddle_Industry_Practice_Sample_Library/rebar_count/images/1.png and b/Paddle_Industry_Practice_Sample_Library/rebar_count/images/1.png differ diff --git a/Paddle_Industry_Practice_Sample_Library/robot_grab/README.md b/Paddle_Industry_Practice_Sample_Library/robot_grab/README.md index 200eabfd3..66f3b225f 100755 --- a/Paddle_Industry_Practice_Sample_Library/robot_grab/README.md +++ b/Paddle_Industry_Practice_Sample_Library/robot_grab/README.md @@ -2,7 +2,7 @@ ### 1 项目说明 随着制造业的产线自动化、智能化需求的不断提升,机器人和AI视觉技术的结合越来越广泛,如:视觉引导的涂装、焊接或机械手抓取等。
-
在项目落地中,目标物体轮廓的精准定位非常关键。在视觉定位过程中,需要通过对相机的标定,来求取相机和实际物体的坐标关系,进而转化成机械手可以识别的坐标空间。但在实际场景中,目标所处的环境非常复杂,遨博机器人结合自身经验,总结出了一套深度学习抓取方案。 @@ -113,7 +113,7 @@ python code/infer.py 预测结果如下:
-
+ ### 9 边缘坐标的获取 @@ -121,6 +121,12 @@ python code/infer.py ``` shell python code/point.py > log ``` -生成的点的坐标如:
-
+ + +### 10 模型部署 + +模型部署采用了PaddleX提供的C++ inference部署方案,在该方案中提供了C#部署[Demo](https://github.com/PaddlePaddle/PaddleX/tree/develop/examples/C%23_deploy),用户可根据实际情况自行参考修改。 + +
+
\ No newline at end of file diff --git a/Paddle_Industry_Practice_Sample_Library/robot_grab/code/infer.py b/Paddle_Industry_Practice_Sample_Library/robot_grab/code/infer.py index e08e3fa56..94d7bb7c4 100755 --- a/Paddle_Industry_Practice_Sample_Library/robot_grab/code/infer.py +++ b/Paddle_Industry_Practice_Sample_Library/robot_grab/code/infer.py @@ -37,4 +37,4 @@ f.write("the total number is :" + str(int(count))) f.close() pdx.det.visualize( - image_name, result, threshold=0.5, save_dir='./output/mask_rcnn_r50_fpn') + image_name, result, threshold=0.5, save_dir='./output/mask_rcnn_r50_fpn') \ No newline at end of file diff --git a/Paddle_Industry_Practice_Sample_Library/robot_grab/code/point.py b/Paddle_Industry_Practice_Sample_Library/robot_grab/code/point.py index ff7b3cc46..633b8a981 100644 --- a/Paddle_Industry_Practice_Sample_Library/robot_grab/code/point.py +++ b/Paddle_Industry_Practice_Sample_Library/robot_grab/code/point.py @@ -1,14 +1,14 @@ -import cv2 +import paddlex +import cv2 import numpy as np -from PIL import Image -img = cv2.imread('xiaoduxiong_ins_det/JPEGImages/Xiaoduxiong114.jpeg') -result = model.predict( - 'xiaoduxiong_ins_det/JPEGImages/Xiaoduxiong114.jpeg', - transforms=model.test_transforms) +from point_tools import parse_mask_edge_points, visualize_mask_edge -mask_edge_points = parse_mask_edge_points(result) -img = cv2.drawContours(img, mask_edge_points[0], 0, (0, 0, 255), 3) +model = paddlex.load_model('output/mask_rcnn_r50_fpn/best_model') +img = cv2.imread('dataset/JPEGImages/Image_20210615204210757.bmp') +result = model.predict('dataset/JPEGImages/Image_20210615204210757.bmp', transforms=model.test_transforms) + +mask_edge_points = parse_mask_edge_points(result, score_threshold=0.95) +img = visualize_mask_edge(img, mask_edge_points=mask_edge_points, point_size=1, color=(0,0,255)) cv2.imwrite('./test.png', img) -# Image.fromarray(img.astype('uint8')) diff --git a/Paddle_Industry_Practice_Sample_Library/robot_grab/code/point_tools.py b/Paddle_Industry_Practice_Sample_Library/robot_grab/code/point_tools.py new file mode 100644 index 000000000..5b2c40dd3 --- /dev/null +++ b/Paddle_Industry_Practice_Sample_Library/robot_grab/code/point_tools.py @@ -0,0 +1,84 @@ +import numpy as np +import cv2 +import pycocotools.mask as mask_util + +def parse_mask_edge_points(result=None, point_interval=15, score_threshold=0.5, area_threshold=50, point_length_threshold=6): + """Parsing MaskRCNN Predict Result + Args: + result: PaddleX-MaskRCNN Predict Result. + point_interval: MaskRCNN-Boundary point sampling interval. + score_threshold: Score threshold. If the score of the mask is + smaller than this threshold, the boundary of the mask will not be saved. + area_threshold: Mask area threshold. If the MAKS area is + smaller than this threshold, the mask boundary is not saved. + point_length_threshold: Boundary points number threshold, less than + the number of boundary points of this threshold, + no saving this Mask boundary. + Retrun: List + eg: + import paddlex + import cv2 + import numpy as np + + model = paddlex.load_model('output/mask_rcnn_r50_fpn/best_model') + img = cv2.imread('dataset/JPEGImages/Image_20210615204254171.bmp') + result = model.predict('dataset/JPEGImages/Image_20210615204254171.bmp', transforms=model.test_transforms) + mask_edge_points = parse_mask_edge_points(result, score_threshold=0.95) + mask_edge_points[0] # Mask boundaries in Result[0] + """ + assert result is not None, \ + "Please make sure the input is not None." + assert len(result) != 0, \ + "Please make sure the input result length !=0." + assert 'mask' in result[0], \ + "Please make sure the key of 'mask' in the input result dict." + mask_edge_points = [] + for i in range(len(result)): + if result[i]['score'] < score_threshold: + continue + mask = mask_util.decode(result[i]['mask']) * 255 + idx = np.nonzero(mask) + contours = cv2.findContours(mask.astype("uint8"), + cv2.RETR_EXTERNAL, + cv2.CHAIN_APPROX_NONE)[-2] + if area_threshold > cv2.contourArea(contours[0]) or point_length_threshold > len(contours[0]): + continue + mask_edge_points.append(np.asarray([[contours[0][i] for i in range(0, len(contours[0]), point_interval)]])) + return mask_edge_points + + +def visualize_mask_edge(img, mask_edge_points=None, point_size=1, color=(0,0,255)): + """Visual boundary point + Args: + img: Input image. + mask_edge_points: Results after parsing--List. + point_size: Boundary point drawing size. + color: Color of drawing. + Retrun: numpy.ndarray + eg: + import paddlex + import cv2 + import numpy as np + model = paddlex.load_model('output/mask_rcnn_r50_fpn/best_model') + img = cv2.imread('dataset/JPEGImages/Image_20210615204254171.bmp') + result = model.predict('dataset/JPEGImages/Image_20210615204254171.bmp', transforms=model.test_transforms) + mask_edge_points = parse_mask_edge_points(result, score_threshold=0.95) + img = visualize_mask_edge(img, mask_edge_points=mask_edge_points, point_size=1, color=(0,0,255)) + cv2.imwrite('./test.png', img) + """ + assert mask_edge_points is not None, \ + "Please input the mask_edge_points, but now it is None." + assert isinstance(point_size, int), \ + "Please make sure the tpye of point_size is int." + assert isinstance(color, tuple), \ + "Please make sure the tpye of color is tuple." + assert len(color) == 3, \ + "Please make sure the length of color is 3, but now it is {0}.".format(len(color)) + radius_ = 2 * point_size + line_type = 4 + + for sample_index in range(len(mask_edge_points)): + sample = mask_edge_points[sample_index][0] + for point in sample: + img = cv2.circle(img, tuple(point[0]), 2, (0,0,255), 4) + return img \ No newline at end of file diff --git a/Paddle_Industry_Practice_Sample_Library/robot_grab/images/deploy.png b/Paddle_Industry_Practice_Sample_Library/robot_grab/images/deploy.png new file mode 100644 index 000000000..0ff97a730 Binary files /dev/null and b/Paddle_Industry_Practice_Sample_Library/robot_grab/images/deploy.png differ diff --git a/Paddle_Industry_Practice_Sample_Library/robot_grab/images/point.png b/Paddle_Industry_Practice_Sample_Library/robot_grab/images/point.png index 903829cb6..46423fe46 100644 Binary files a/Paddle_Industry_Practice_Sample_Library/robot_grab/images/point.png and b/Paddle_Industry_Practice_Sample_Library/robot_grab/images/point.png differ diff --git a/Paddle_Industry_Practice_Sample_Library/robot_grab/images/rebot1.png b/Paddle_Industry_Practice_Sample_Library/robot_grab/images/rebot1.png index 6f907ccb8..7bfc9a443 100644 Binary files a/Paddle_Industry_Practice_Sample_Library/robot_grab/images/rebot1.png and b/Paddle_Industry_Practice_Sample_Library/robot_grab/images/rebot1.png differ diff --git a/README.md b/README.md index 865b2e1b6..25021e0fd 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,12 @@ 国内众多行业都在基于人工智能技术推进行业变革与创新,积极探寻有效、有价值的应用场景进行商业化落地。百度飞桨结合实际经验,选取了几个经典的场景,提供了从数据准备、模型训练优化,到模型部署的全流程可复用方案,降低产业落地门槛,让大家在真实数据环境下深入地了解这些案例,获取产业实现方案。 * 智慧城市 - * [火灾烟雾检测](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Fire_and_Smoke_Detection) | [人流量统计](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Pedestrian_Detection_and_Tracking) - * [车流量统计](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Vehicle_Detection_and_Tracking) | [安全帽检测](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Hemtle%20Detection) + * [火灾烟雾检测](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Fire&Smoke_Detection) | [人流量统计](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Pedestrian_Detection_and_Tracking) + * [车流量统计](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Vehicle_Detection_and_Tracking) | [安全帽检测](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Hemtle_Detection) * [电子快递单信息提取](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Waybill_Information_Extraction) * 智能制造 - * [工业指针型表计读数](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/meter_reader) | [钢材缺陷检测](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/paddlex_steel_defect_seg-master) - * [钢筋计数](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/rebar_count) | [机械手抓取](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/robot_grab) + * [工业指针型表计读数](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Meter_Reader) | [钢材缺陷检测](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Steel_Detection) + * [钢筋计数](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Rebar_Count) | [机械手抓取](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Robot_Grab) * 互联网 * [财报识别与关键字段抽取](https://github.com/PaddlePaddle/awesome-DeepLearning/tree/master/Paddle_Enterprise_CaseBook/Report_Recognition_and_Analysis)