浏览代码

Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleX into develop_test

FlyingQianMM 4 年之前
父节点
当前提交
2d4624f5a0

+ 2 - 0
README.md

@@ -44,6 +44,8 @@ The design of PaddleX Python API taking into account of comprehensive functions,
 > - cython
 > - pycocotools
 
+You shuould use command of python3 and pip3 instead if you have python2 installed.
+
 ```
 pip install paddlex -i https://mirror.baidu.com/pypi/simple
 ```

+ 1 - 1
docs/apis/models/classification.md

@@ -100,7 +100,7 @@ batch_predict(self, img_file_list, transforms=None, topk=1)
 
 ## 其它分类模型
 
-PaddleX提供了共计22种分类模型,所有分类模型均提供同`ResNet50`相同的训练`train`,评估`evaluate`和预测`predict`接口,各模型效果可参考[模型库](https://paddlex.readthedocs.io/zh_CN/latest/appendix/model_zoo.html)。
+PaddleX提供了共计22种分类模型,所有分类模型均提供同`ResNet50`相同的训练`train`,评估`evaluate`和预测`predict`接口,各模型效果可参考[模型库](../../appendix/model_zoo.md)。
 
 | 模型              | 接口                    |
 | :---------------- | :---------------------- |

+ 2 - 1
docs/appendix/metrics.md

@@ -138,8 +138,9 @@ COCO格式的数据集不仅可以用于训练目标检测模型,也可以用
 | -------------- | --------------------------------------------- |
 | miou          | 各类IoU(Intersection Over Union)的平均值         |
 | category_iou          | 各类别的IoU  |
-| macc          | 平均准确率,即预测正确的像素数/总像素数  |
+| oacc          | 整体准确率,即预测正确的像素数/总像素数  |
 | category_acc       | 各类别的准确率,即各类别预测正确的像素数/预测为该类别的总像素数  |
 | kappa      | kappa系数,用于一致性检验  |
+| category_F1-score | 各类别的F1-score, F1-score为2*(准确率*召回率)/(准确率+召回率),其中召回率为各类别预测正确的像素数/该类别的总像素数 |
 
 ![](images/seg_eval.png)

+ 3 - 2
docs/deploy/openvino/export_openvino_model.md

@@ -3,11 +3,12 @@
 
 ## 环境依赖
 
+* Paddle2ONNX 0.4
 * ONNX 1.6.0+
-* PaddleX 1.2+
+* PaddleX 1.3+
 * OpenVINO 2020.4+
 
-**说明**:PaddleX安装请参考[PaddleX](https://paddlex.readthedocs.io/zh_CN/develop/install.html) , OpenVINO安装请参考[OpenVINO](https://docs.openvinotoolkit.org/latest/index.html),ONNX请安装1.6.0以上版本否则会出现转模型错误。  
+**说明**:PaddleX安装请参考[PaddleX](https://paddlex.readthedocs.io/zh_CN/develop/install.html) , OpenVINO安装请参考[OpenVINO](https://docs.openvinotoolkit.org/latest/index.html),ONNX请安装1.6.0以上版本否则会出现转模型错误, Paddle2ONNX请安装0.4版本
 **注意**:安装OpenVINO时请务必安装官网教程初始化OpenVINO运行环境,并安装相关依赖,否则会出现"No module named mo"等问题  
 
 请确保系统已经安装好上述基本软件,**下面所有示例以工作目录 `/root/projects/`演示**。

+ 1 - 1
docs/gui/restful/data_struct.md

@@ -130,7 +130,7 @@ ProjectType = Enum('ProjectType',
 'detection',#检测
 'segmentation',#分割
 'instance_segmentation',#实例分割
-'remote_segmentation'#摇杆分割
+'remote_segmentation'#遥感分割
 ),start=0)
 ```
 

+ 2 - 0
examples/human_segmentation/README.md

@@ -72,6 +72,8 @@ python data/download_data.py
 * Python >= 3.5
 * PaddleX >= 1.0.0
 
+推荐用python3.8.7,如果已经安装了python2,下面的所有python及pip命令请用python3及pip3替代,否则会失败。
+
 安装的相关问题参考[PaddleX安装](../../docs/install.md)
 
 * 下载PaddleX源码:

+ 5 - 1
paddlex/__init__.py

@@ -14,7 +14,7 @@
 
 from __future__ import absolute_import
 
-__version__ = '1.3.4'
+__version__ = '1.3.5'
 
 import os
 if 'FLAGS_eager_delete_tensor_gb' not in os.environ:
@@ -32,6 +32,10 @@ if version[0] == '1':
         raise Exception(
             'For running paddlex(v{}), Version of paddlepaddle should be greater than 1.8.3'.
             format(__version__))
+    import paddlehub as hub
+    if hub.__version__.strip().split('.')[0] > '1':
+        raise Exception("Try to reinstall Paddlehub by 'pip install paddlehub==1.8.2' while paddlepaddle < 2.0")
+
 if hasattr(paddle, 'enable_static'):
     paddle.enable_static()
 

+ 7 - 1
paddlex/converter.py

@@ -267,8 +267,14 @@ def export_onnx_model(model, save_file, opset_version=10):
         import paddle2onnx 
     except:
         logging.error(
-            "You need to install paddle2onnx first, pip install paddle2onnx")
+            "You need to install paddle2onnx first, pip install paddle2onnx==0.4")
+
     import paddle2onnx as p2o
+
+    if p2o.__version__ != '0.4':
+        logging.error(
+            "You need install paddle2onnx==0.4, but the version of paddle2onnx is {}".format(p2o.__version__))
+
     if opset_version == 10 and model.__class__.__name__ == "YOLOv3":
         logging.warning(
             "Export for openVINO by default, the output of multiclass_nms exported to onnx will contains background. If you need onnx completely consistent with paddle, please use paddle2onnx to export"

+ 7 - 4
paddlex/cv/transforms/seg_transforms.py

@@ -73,10 +73,13 @@ class Compose(SegTransform):
             try:
                 import gdal
             except:
-                six.reraise(*sys.exc_info())
-                raise Exception(
-                    "Please refer to https://github.com/PaddlePaddle/PaddleX/tree/develop/examples/multi-channel_remote_sensing/README.md to install gdal"
-                )
+                try:
+                    from osgeo import gdal
+                except:
+                    raise Exception(
+                        "Please refer to https://github.com/PaddlePaddle/PaddleX/tree/develop/examples/multi-channel_remote_sensing/README.md to install gdal"
+                    )
+                    six.reraise(*sys.exc_info())
 
             dataset = gdal.Open(img_path)
             if dataset == None:

+ 4 - 4
paddlex_restful/restful/README.md

@@ -1,9 +1,9 @@
 # RESTful API
 本目录为PaddleX RESTful API的代码,使用教程请参考
-- [简介](../../docs/gui/introduction_restful.md)
-- [快速开始](../../docs/gui/quick_start.md)
-- [api详细介绍](../../docs/gui/restful_api.md)
-- [自定义数据结构](../../docs/gui/data_struct.md)
+- [简介](../../docs/gui/restful/introduction_restful.md)
+- [快速开始](../../docs/gui/restful/quick_start.md)
+- [api详细介绍](../../docs/gui/restful/restful_api.md)
+- [自定义数据结构](../../docs/gui/restful/data_struct.md)
 
 ## 文档目录结构
 

+ 1 - 1
requirements.txt

@@ -6,7 +6,7 @@ pycocotools
 visualdl >= 2.0.0b
 paddleslim == 1.1.1
 shapely
-paddle2onnx
+paddle2onnx==0.4
 paddlepaddle-gpu
 opencv-python
 psutil

+ 2 - 2
setup.py

@@ -19,7 +19,7 @@ long_description = "PaddlePaddle Entire Process Development Toolkit"
 
 setuptools.setup(
     name="paddlex",
-    version='1.3.4',
+    version='1.3.5',
     author="paddlex",
     author_email="paddlex@baidu.com",
     description=long_description,
@@ -39,7 +39,7 @@ setuptools.setup(
     setup_requires=['cython', 'numpy'],
     install_requires=[
         "pycocotools;platform_system!='Windows'", 'pyyaml', 'colorama', 'tqdm',
-        'paddleslim==1.1.1', 'visualdl>=2.0.0', 'paddlehub>=1.8.2',
+        'paddleslim==1.1.1', 'visualdl>=2.0.0', 'paddlehub==1.8.2',
         'shapely>=1.7.0', 'opencv-python', 'flask_cors', 'sklearn', 'psutil',
         'xlwt'
     ],