更换文档检测模型

This commit is contained in:
2024-08-27 14:42:45 +08:00
parent aea6f19951
commit 1514e09c40
2072 changed files with 254336 additions and 4967 deletions

View File

@@ -0,0 +1,4 @@
#!/bin/bash
set -e
clang-format $@

View File

@@ -0,0 +1,27 @@
#!/bin/bash
TOTAL_ERRORS=0
if [[ ! $TRAVIS_BRANCH ]]; then
# install cpplint on local machine.
if [[ ! $(which cpplint) ]]; then
pip install cpplint
fi
# diff files on local machine.
files=$(git diff --cached --name-status | awk '$1 != "D" {print $2}')
else
# diff files between PR and latest commit on Travis CI.
branch_ref=$(git rev-parse "$TRAVIS_BRANCH")
head_ref=$(git rev-parse HEAD)
files=$(git diff --name-status $branch_ref $head_ref | awk '$1 != "D" {print $2}')
fi
# The trick to remove deleted files: https://stackoverflow.com/a/2413151
for file in $files; do
if [[ $file =~ ^(patches/.*) ]]; then
continue;
else
cpplint --filter=-readability/fn_size,-build/include_what_you_use,-build/c++11 $file;
TOTAL_ERRORS=$(expr $TOTAL_ERRORS + $?);
fi
done
exit $TOTAL_ERRORS

View File

@@ -0,0 +1,21 @@
#!/bin/bash
function abort(){
echo "Your commit not fit PaddlePaddle code style" 1>&2
echo "Please use pre-commit scripts to auto-format your code" 1>&2
exit 1
}
trap 'abort' 0
set -e
cd `dirname $0`
cd ..
export PATH=/usr/bin:$PATH
pre-commit install
if ! pre-commit run -a ; then
ls -lh
git diff --exit-code
exit 1
fi
trap : 0

View File

@@ -0,0 +1,8 @@
# add python requirements for unittests here, note install pycocotools
# directly is not supported in travis ci, it is installed by compiling
# from source files in unittest.sh
tqdm
cython
shapely
llvmlite==0.33
numba==0.50

View File

@@ -0,0 +1,47 @@
#!/bin/bash
abort(){
echo "Run unittest failed" 1>&2
echo "Please check your code" 1>&2
echo " 1. you can run unit tests by 'bash .travis/unittest.sh' locally" 1>&2
echo " 2. you can add python requirements in .travis/requirements.txt if you use new requirements in unit tests" 1>&2
exit 1
}
unittest(){
if [ $? != 0 ]; then
exit 1
fi
find "./ppdet" -name 'tests' -type d -print0 | \
xargs -0 -I{} -n1 bash -c \
'python -m unittest discover -v -s {}'
}
trap 'abort' 0
set -e
# install travis python dependencies exclude pycocotools
if [ -f ".travis/requirements.txt" ]; then
pip install -r .travis/requirements.txt
fi
# install pycocotools
if [ `pip list | grep pycocotools | wc -l` -eq 0 ]; then
# install git if needed
if [ -n `which git` ]; then
apt-get update
apt-get install -y git
fi;
git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi/PythonAPI
make install
python setup.py install --user
cd ../..
rm -rf cocoapi
fi
export PYTHONPATH=`pwd`:$PYTHONPATH
unittest .
trap : 0