未验证 提交 f46088ca 编写于 作者: K Kaipeng Deng 提交者: GitHub

update 2.0.1 (#2754)

* update 2.0.1
上级 8f79fd39
...@@ -71,8 +71,8 @@ PaddleDetection can be installed in the following two ways: ...@@ -71,8 +71,8 @@ PaddleDetection can be installed in the following two ways:
**Note:** Installing via pip only supports Python3 **Note:** Installing via pip only supports Python3
``` ```
# install paddledet via pip # Install paddledet via pip
pip install paddledet==2.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple pip install paddledet==2.0.1 -i https://mirror.baidu.com/pypi/simple
# Download and use the configuration files and code examples in the source code # Download and use the configuration files and code examples in the source code
git clone https://github.com/PaddlePaddle/PaddleDetection.git git clone https://github.com/PaddlePaddle/PaddleDetection.git
...@@ -86,17 +86,18 @@ cd PaddleDetection ...@@ -86,17 +86,18 @@ cd PaddleDetection
cd <path/to/clone/PaddleDetection> cd <path/to/clone/PaddleDetection>
git clone https://github.com/PaddlePaddle/PaddleDetection.git git clone https://github.com/PaddlePaddle/PaddleDetection.git
# Compile and install paddledet
cd PaddleDetection
python setup.py install
# Install other dependencies # Install other dependencies
pip install -r requirements.txt pip install -r requirements.txt
# Install PaddleDetection
cd PaddleDetection
python setup.py install
``` ```
**Note** **Note**
1. Because the origin version of cocoapi does not support windows, another version is used which only supports Python3: 1. If you are working on Windows OS, `pycocotools` installing may failed because of the origin version of cocoapi does not support windows, another version can be used used which only supports Python3:
```pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI``` ```pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI```
...@@ -109,10 +110,10 @@ python ppdet/modeling/tests/test_architectures.py ...@@ -109,10 +110,10 @@ python ppdet/modeling/tests/test_architectures.py
If the tests are passed, the following information will be prompted: If the tests are passed, the following information will be prompted:
``` ```
.......... .....
---------------------------------------------------------------------- ----------------------------------------------------------------------
Ran 12 tests in 2.480s Ran 5 tests in 4.280s
OK (skipped=2) OK
``` ```
## Inference demo ## Inference demo
...@@ -122,7 +123,7 @@ OK (skipped=2) ...@@ -122,7 +123,7 @@ OK (skipped=2)
``` ```
# Predict an image by GPU # Predict an image by GPU
export CUDA_VISIBLE_DEVICES=0 export CUDA_VISIBLE_DEVICES=0
python tools/infer.py -c configs/ppyolo/ppyolo.yml -o use_gpu=true weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams --infer_img=demo/000000014439.jpg python tools/infer.py -c configs/ppyolo/ppyolo_r50vd_dcn_1x_coco.yml -o use_gpu=true weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams --infer_img=demo/000000014439.jpg
``` ```
An image of the same name with the predicted result will be generated under the `output` folder. An image of the same name with the predicted result will be generated under the `output` folder.
......
...@@ -64,7 +64,7 @@ python -c "import paddle; print(paddle.__version__)" ...@@ -64,7 +64,7 @@ python -c "import paddle; print(paddle.__version__)"
``` ```
# pip安装paddledet # pip安装paddledet
pip install paddledet==2.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple pip install paddledet==2.0.1 -i https://mirror.baidu.com/pypi/simple
# 下载使用源码中的配置文件和代码示例 # 下载使用源码中的配置文件和代码示例
git clone https://github.com/PaddlePaddle/PaddleDetection.git git clone https://github.com/PaddlePaddle/PaddleDetection.git
...@@ -78,17 +78,18 @@ cd PaddleDetection ...@@ -78,17 +78,18 @@ cd PaddleDetection
cd <path/to/clone/PaddleDetection> cd <path/to/clone/PaddleDetection>
git clone https://github.com/PaddlePaddle/PaddleDetection.git git clone https://github.com/PaddlePaddle/PaddleDetection.git
# 编译安装paddledet
cd PaddleDetection
python setup.py install
# 安装其他依赖 # 安装其他依赖
pip install -r requirements.txt pip install -r requirements.txt
# 安装PaddleDetection
cd PaddleDetection
python setup.py install
``` ```
**注意** **注意**
1. 由于原版cocoapi不支持windows,采用第三方实现版本,该版本仅支持Python3 1. 若您使用的是Windows系统,由于原版cocoapi不支持Windows,`pycocotools`依赖可能安装失败,可采用第三方实现版本,该版本仅支持Python3
```pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI``` ```pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI```
...@@ -102,10 +103,10 @@ python ppdet/modeling/tests/test_architectures.py ...@@ -102,10 +103,10 @@ python ppdet/modeling/tests/test_architectures.py
测试通过后会提示如下信息: 测试通过后会提示如下信息:
``` ```
.......... .....
---------------------------------------------------------------------- ----------------------------------------------------------------------
Ran 12 tests in 2.480s Ran 5 tests in 4.280s
OK (skipped=2) OK
``` ```
## 快速体验 ## 快速体验
...@@ -115,7 +116,7 @@ OK (skipped=2) ...@@ -115,7 +116,7 @@ OK (skipped=2)
``` ```
# 在GPU上预测一张图片 # 在GPU上预测一张图片
export CUDA_VISIBLE_DEVICES=0 export CUDA_VISIBLE_DEVICES=0
python tools/infer.py -c configs/ppyolo/ppyolo.yml -o use_gpu=true weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams --infer_img=demo/000000014439.jpg python tools/infer.py -c configs/ppyolo/ppyolo_r50vd_dcn_1x_coco.yml -o use_gpu=true weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams --infer_img=demo/000000014439.jpg
``` ```
会在`output`文件夹下生成一个画有预测结果的同名图像。 会在`output`文件夹下生成一个画有预测结果的同名图像。
......
...@@ -68,11 +68,11 @@ def list_model(filters=[]): ...@@ -68,11 +68,11 @@ def list_model(filters=[]):
# models and configs save on bcebos under dygraph directory # models and configs save on bcebos under dygraph directory
def get_config_file(model_name): def get_config_file(model_name):
return get_config_path("ppdet://dygraph/configs/{}.yml".format(model_name)) return get_config_path("ppdet://configs/{}.yml".format(model_name))
def get_weights_url(model_name): def get_weights_url(model_name):
return "ppdet://dygraph/{}.pdparams".format(model_name) return "ppdet://models/{}.pdparams".format(osp.split(model_name)[-1])
def get_model(model_name, pretrained=True): def get_model(model_name, pretrained=True):
......
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# 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.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
import ppdet
class TestFasterRCNN(unittest.TestCase):
def setUp(self):
self.set_config()
def set_config(self):
self.cfg_file = 'configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.yml'
def test_trainer(self):
# Trainer __init__ will build model and DataLoader
# 'train' and 'eval' mode include dataset loading
# use 'test' mode to simplify tests
cfg = ppdet.core.workspace.load_config(self.cfg_file)
trainer = ppdet.engine.Trainer(cfg, mode='test')
class TestMaskRCNN(TestFasterRCNN):
def set_config(self):
self.cfg_file = 'configs/mask_rcnn/mask_rcnn_r50_fpn_1x_coco.yml'
class TestCascadeRCNN(TestFasterRCNN):
def set_config(self):
self.cfg_file = 'configs/cascade_rcnn/cascade_rcnn_r50_fpn_1x_coco.yml'
class TestYolov3(TestFasterRCNN):
def set_config(self):
self.cfg_file = 'configs/yolov3/yolov3_darknet53_270e_coco.yml'
class TestSSD(TestFasterRCNN):
def set_config(self):
self.cfg_file = 'configs/ssd/ssd_vgg16_300_240e_voc.yml'
if __name__ == '__main__':
unittest.main()
...@@ -260,7 +260,8 @@ def get_path(url, root_dir, md5sum=None, check_exist=True): ...@@ -260,7 +260,8 @@ def get_path(url, root_dir, md5sum=None, check_exist=True):
fullpath = osp.join(osp.split(fullpath)[0], v) fullpath = osp.join(osp.split(fullpath)[0], v)
if osp.exists(fullpath) and check_exist: if osp.exists(fullpath) and check_exist:
if _check_exist_file_md5(fullpath, md5sum, url): if not osp.isfile(fullpath) or \
_check_exist_file_md5(fullpath, md5sum, url):
logger.debug("Found {}".format(fullpath)) logger.debug("Found {}".format(fullpath))
return fullpath, True return fullpath, True
else: else:
......
...@@ -42,7 +42,7 @@ def package_model_zoo(): ...@@ -42,7 +42,7 @@ def package_model_zoo():
# exclude dataset base config # exclude dataset base config
if osp.split(osp.split(cfg)[0])[1] not in ['datasets']: if osp.split(osp.split(cfg)[0])[1] not in ['datasets']:
valid_cfgs.append(cfg) valid_cfgs.append(cfg)
model_names = [osp.splitext(osp.split(cfg)[1])[0] for cfg in valid_cfgs] model_names = [osp.relpath(cfg, cfg_dir).replace(".yml", "") for cfg in valid_cfgs]
model_zoo_file = osp.join(cur_dir, 'ppdet', 'model_zoo', 'MODEL_ZOO') model_zoo_file = osp.join(cur_dir, 'ppdet', 'model_zoo', 'MODEL_ZOO')
with open(model_zoo_file, 'w') as wf: with open(model_zoo_file, 'w') as wf:
...@@ -70,7 +70,7 @@ if __name__ == "__main__": ...@@ -70,7 +70,7 @@ if __name__ == "__main__":
packages=find_packages(exclude=("configs", "tools", "deploy")), packages=find_packages(exclude=("configs", "tools", "deploy")),
package_data={'ppdet.model_zoo': package_model_zoo()}, package_data={'ppdet.model_zoo': package_model_zoo()},
author='PaddlePaddle', author='PaddlePaddle',
version='2.0.0', version='2.0.1',
install_requires=parse_requirements('./requirements.txt'), install_requires=parse_requirements('./requirements.txt'),
description='Object detection and instance segmentation toolkit based on PaddlePaddle', description='Object detection and instance segmentation toolkit based on PaddlePaddle',
long_description=readme(), long_description=readme(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册