From 19e1e65201bc9d84ab231454e767c820fcad7e97 Mon Sep 17 00:00:00 2001 From: cnn Date: Thu, 15 Apr 2021 22:45:43 +0800 Subject: [PATCH] fix bug of import and update doc (#2642) --- configs/datasets/dota.yml | 6 +++--- configs/dota/README.md | 9 ++------- ppdet/data/transform/batch_operators.py | 1 + ppdet/data/transform/operators.py | 1 + 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/configs/datasets/dota.yml b/configs/datasets/dota.yml index 07602d41c..2953a7994 100644 --- a/configs/datasets/dota.yml +++ b/configs/datasets/dota.yml @@ -5,16 +5,16 @@ TrainDataset: !COCODataSet image_dir: trainval_split/images anno_path: trainval_split/s2anet_trainval_paddle_coco.json - dataset_dir: /paddle/dataset/DOTA_1024_s2anet + dataset_dir: dataset/DOTA_1024_s2anet data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd', 'gt_rbox'] EvalDataset: !COCODataSet image_dir: trainval_split/images anno_path: trainval_split/s2anet_trainval_paddle_coco.json - dataset_dir: /paddle/dataset/DOTA_1024_s2anet/ + dataset_dir: dataset/DOTA_1024_s2anet/ TestDataset: !ImageFolder anno_path: trainval_split/s2anet_trainval_paddle_coco.json - dataset_dir: /paddle/dataset/DOTA_1024_s2anet/ + dataset_dir: dataset/DOTA_1024_s2anet/ diff --git a/configs/dota/README.md b/configs/dota/README.md index 7d33bc727..d4e6ae94c 100644 --- a/configs/dota/README.md +++ b/configs/dota/README.md @@ -54,11 +54,6 @@ DOTA数据集中总共有2806张图像,其中1411张图像作为训练集,45 sudo nvidia-docker run -it --name paddle_s2anet -v $PWD:/paddle --network=host registry.baidubce.com/paddlepaddle/paddle:2.0.1-gpu-cuda10.1-cudnn7 /bin/bash ``` -进入容器后,安装必要的python包: -``` -python3.7 -m pip install Cython wheel tqdm opencv-python==4.2.0.32 scipy PyYAML shapely pycocotools -``` - 镜像中paddle2.0.1已安装好,进入python3.7,执行如下代码检查paddle安装是否正常: ``` import paddle @@ -66,7 +61,7 @@ print(paddle.__version__) paddle.utils.run_check() ``` -进入到`ext_op`文件夹,安装: +进入到`ppdet/ext_op`文件夹,安装: ``` python3.7 setup.py install ``` @@ -96,7 +91,7 @@ Paddle中`multiclass_nms`算子的输入支持四边形输入,因此部署时 ```bash # 预测 -CUDA_VISIBLE_DEVICES=0 python tools/infer.py -c configs/dota/s2anet_1x_dota.yml -o weights=model.pdparams --infer_img=demo/P0072__1.0__0___0.png --use_gpu=True +CUDA_VISIBLE_DEVICES=0 python tools/infer.py -c configs/dota/s2anet_1x_dota.yml -o weights=model.pdparams --infer_img=demo/P0072__1.0__0___0.png ``` diff --git a/ppdet/data/transform/batch_operators.py b/ppdet/data/transform/batch_operators.py index e09c04796..8d74ce0e8 100644 --- a/ppdet/data/transform/batch_operators.py +++ b/ppdet/data/transform/batch_operators.py @@ -27,6 +27,7 @@ from .operators import register_op, BaseOperator, Resize from .op_helper import jaccard_overlap, gaussian2D from scipy import ndimage +from ppdet.modeling import bbox_utils from ppdet.utils.logger import setup_logger logger = setup_logger(__name__) diff --git a/ppdet/data/transform/operators.py b/ppdet/data/transform/operators.py index 65608f367..932c7971f 100644 --- a/ppdet/data/transform/operators.py +++ b/ppdet/data/transform/operators.py @@ -39,6 +39,7 @@ from PIL import Image, ImageEnhance, ImageDraw from ppdet.core.workspace import serializable from ppdet.modeling.layers import AnchorGrid +from ppdet.modeling import bbox_utils from .op_helper import (satisfy_sample_constraint, filter_and_process, generate_sample_bbox, clip_bbox, data_anchor_sampling, -- GitLab