Anti-UAV base on PaddleDetection
UAVs are very popular and we can see them in many public spaces, such as parks and playgrounds. Most people use UAVs for taking photos. However, many areas like airport forbiden UAVs since they are potentially dangerous. In this case, we need to detect the flying UAVs in these areas.
In this repository, we show how to train a detection model using PaddleDetection.
The dataset can be found here. We direcly download the test-dev
split composed of 140 videos
train the detection model.
- Download the
test-dev
dataset. - Run
unzip Anti_UAV_test_dev.zip -d Anti_UAV
. - Run
python get_image_label.py
. In this step, you may change the path to the videos and the value ofinterval
.
After the above steps, you will get a MSCOCO-style datasst for object detection.
Please refer to this link.
We use python=3.7
, Paddle=2.2.1
, CUDA=10.2
.
We use PP-YOLO as the detector.
- Run
git clone https://github.com/PaddlePaddle/PaddleDetection.git
. Note that you should finish this step when you install PaddleDetection. - Move the anti-UAV dataset to
dataset
. - Move
anti_uav.yml
toconfigs/datasets
, moveppyolo_r50vd_dcn_1x_antiuav.yml
toconfigs/ppyolo
and moveppyolo_r50vd_dcn_antiuav.yml
toconfigs/ppyolo/_base
. - Keep the value of
anchors
inconfigs/ppyolo/_base/ppyolo_reader.yml
the same asppyolo_r50vd_dcn_antiuav.yml
. - Run
python -m paddle.distributed.launch --log_dir=./ppyolo_dygraph/ --gpus 0,1,2,3,4,5,6,7 tools/train.py -c configs/ppyolo/ppyolo_r50vd_dcn_1x_antiuav.yml &>ppyolo_dygraph.log 2>&1 &
. Note that you may change the arguments, such asbatch_size
andgups
.
Please refer to the infernce section on this webpage. You can just switch the configeration file and trained model to your own files.