本文共 2520 字,大约阅读时间需要 8 分钟。
??????????????PaddlePaddle??????????????????????????????????????????
?????
?????
pip install paddlepaddle-gpu==1.8.4.post97pip install paddlepaddle-gpu==1.8.4.post107pip install paddlepaddle==1.8.4?????
import paddle.fluid as fluidfluid.install_check.run_check()
????????PaddlePaddle????????????1.8.4?
pip install pycocotoolsgit clone https://github.com/PaddlePaddle/PaddleDetection.git
python -c "import paddle.fluid as fluid; fluid.install_check.run_check()"
?????????
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
???????output????
???????????????
VOCdevkit/??? Annotations/??? JPEGImages/??? ImageSets/? ??? Main/? ??? trainval.txt? ??? test.txt
??trainval.txt?test.txt?
import osfile_train = open('trainval.txt', 'w')file_test = open('test.txt', 'w')for xml_name in os.listdir(r'D:\computercode\python\PaddleDetection\dataset\insect\Annotations\train'): file_train.write(xml_name[:-4] + '\n')for xml_name in os.listdir(r'D:\computercode\python\PaddleDetection\dataset\insect\Annotations\val'): file_test.write(xml_name[:-4] + '\n')file_train.close()file_test.close()configs/faster_rcnn_r50_fpn_1x.yml
?????
max_iters: ????????batch_size??milestones: ???????base_lr: ??????????
export CUDA_VISIBLE_DEVICES=0python -u tools/train.py -c configs/faster_rcnn_r50_fpn_1x.yml \ -o pretrain_weights=https://paddlemodels.bj.bcebos.com/object_detection/faster_rcnn_r50_fpn_1x.tar \ --eval
?????
python -u tools/export_model.py -c configs/faster_rcnn_r50_fpn_1x.yml \ --output_dir=./inference_model
python deploy/python/infer.py --model_dir=./inference_model/faster_rcnn_r50_fpn_1x \ --image_file=path/to/dataset/2572.jpeg --use_gpu=True
output????--eval????? ?????????????PaddlePaddle???????????????????
转载地址:http://vqch.baihongyu.com/