From cd8671e59159f1018ef9a3798778283541783006 Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Wed, 31 Aug 2022 17:46:26 +0800 Subject: [PATCH] fix unittest & whl (#6819) --- ppdet/modeling/tests/test_mstest.py | 12 +++++++----- scripts/build_wheel.sh | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ppdet/modeling/tests/test_mstest.py b/ppdet/modeling/tests/test_mstest.py index 57d1d169f..a5b75110a 100644 --- a/ppdet/modeling/tests/test_mstest.py +++ b/ppdet/modeling/tests/test_mstest.py @@ -21,6 +21,7 @@ import unittest from ppdet.core.workspace import load_config from ppdet.engine import Trainer + class TestMultiScaleInference(unittest.TestCase): def setUp(self): self.set_config() @@ -48,12 +49,13 @@ class TestMultiScaleInference(unittest.TestCase): tests_img_root = os.path.join(os.path.dirname(__file__), 'imgs') # input images to predict - imgs = ['coco2017_val2017_000000000139.jpg', 'coco2017_val2017_000000000724.jpg'] + imgs = [ + 'coco2017_val2017_000000000139.jpg', + 'coco2017_val2017_000000000724.jpg' + ] imgs = [os.path.join(tests_img_root, img) for img in imgs] - trainer.predict(imgs, - draw_threshold=0.5, - output_dir='output', - save_txt=True) + trainer.predict( + imgs, draw_threshold=0.5, output_dir='output', save_results=False) if __name__ == '__main__': diff --git a/scripts/build_wheel.sh b/scripts/build_wheel.sh index c3445cd75..8b6ea0683 100644 --- a/scripts/build_wheel.sh +++ b/scripts/build_wheel.sh @@ -26,6 +26,7 @@ EGG_DIR="paddledet.egg-info" CFG_DIR="configs" TEST_DIR=".tests" +DATA_DIR="dataset" # command line log config RED='\033[0;31m' @@ -86,6 +87,7 @@ function unittest() { # make sure installed paddledet is used mkdir $TEST_DIR cp -r $CFG_DIR $TEST_DIR + cp -r $DATA_DIR $TEST_DIR cd $TEST_DIR if [ $? != 0 ]; then -- GitLab