3rd-无人机检测竞赛_CodeBase_CVPR23
  • 模型资讯
  • 模型资料

3rd Anti-UAV Model and Dataset

This project provides a baseline model and evaluation code for track1 and track2 for CVPR23 3rd Anti-UAV workshop.

News

Test Set can be downloaded with following code:

from modelscope.msdatasets import MsDataset
from modelscope.utils.constant import DownloadMode

cache_dir = '/home/ly261666/datasets'
test_set_1 = MsDataset.load('3rd_Anti-UAV', namespace='ly261666', cache_dir=cache_dir, download_mode=DownloadMode.FORCE_REDOWNLOAD)
print(next(iter(test_set_1)))

You can also download dataset from the url
Evaluate code can be seen in the section “Baseline Evaluation Code for test Set” in this page.

Installation

conda create -n anti_uav python=3.7
conda activate anti_uav
# pytorch >= 1.3.0
pip install torch==1.8.1+cu102  torchvision==0.9.1+cu102 torchaudio==0.8.1  --extra-index-url https://download.pytorch.org/whl/cu102
git clone https://github.com/ly19965/CVPR_Anti_UAV
cd CVPR_Anti_UAV
pip install -r requirements/tests.txt 
pip install -r requirements/framework.txt
pip install -r requirements/cv.txt 
pip install -r requirements/yolov5.txt

Download Dataset

Run the download code:

from modelscope.msdatasets import MsDataset
from modelscope.utils.constant import DownloadMode


## set dataset path
cache_dir = '/home/ly261666/datasets' 

# Download train set
train_set = MsDataset.load('3rd_Anti-UAV', namespace='ly261666', split='train', cache_dir=cache_dir, download_mode=DownloadMode.FORCE_REDOWNLOAD)
print(next(iter(train_set)))

# Download validation set
val_set = MsDataset.load('3rd_Anti-UAV', namespace='ly261666', split='validation', cache_dir=cache_dir, download_mode=DownloadMode.FORCE_REDOWNLOAD)
print(next(iter(val_set)))

Baseline Evaluation Code for validation Set (Only Support Evalutation Code)

Evaluation code for track1

cd CVPR_Anti_UAV
CUDA_VISIBLE_DEVICES=0  PYTHONPATH=. python tests/pipelines/test_anti-uav_val_track1.py
eval result: 0.125

Note:

  • The validation dataset for track1 can be downloaded automatically.
  • Set the dataset path (line 28) in tests/pipelines/test_anti-uav_val_track1.py

Evaluation code for track2

cd CVPR_Anti_UAV
CUDA_VISIBLE_DEVICES=1  PYTHONPATH=. python tests/pipelines/test_anti-uav_val_track2.py
eval result: 0.125

Note:

  • The validation dataset for track2 can be downloaded automatically.
  • Set the dataset path (line 28) in tests/pipelines/test_anti-uav_val_track2.py

Baseline Training and Evalution Code on Validation Set

Track 1

Ostracker Training code for track1

## git pull ostracker code
git clone -b ostracker https://github.com/ly19965/CVPR_Anti_UAV

## Training code on Got-10k dataset
cd CVPR_Anti_UAV
PYTHONPATH=. python uav_scripts/train_ostracker_got10k_l.py

## Training code on Anti-UAV 2023 dataset
cd CVPR_Anti_UAV
PYTHONPATH=. python uav_scripts/train_ostracker_uav_l.py

Note:

Training code for track1

## Training code on Got-10k dataset
cd CVPR_Anti_UAV
PYTHONPATH=. python uav_scripts/train_siamfc_got10k.py

## Training code on Anti-UAV 2023 dataset
cd CVPR_Anti_UAV
PYTHONPATH=. python uav_scripts/train_siamfc_uav.py

Note:

Evaluation code for track1

cd CVPR_Anti_UAV
PYTHONPATH=. python uav_scripts/test_anti-uav_val_track1.py

Note:

  • The validation dataset (Anti-UAV-23) can be downloaded automatically.
  • Set the model_id (line25 damo/cv_alex_video-single-object-tracking_siamfc or damo/cv_alex_video-single-object-tracking_siamfc-uav) in uav_scripts/test_anti-uav_val_track1.py

Track 1

Training code for track2

cd CVPR_Anti_UAV
CUDA_VISIBLE_DEVICES=1 PYTHONPATH=. python uav_scripts/train_uav_detection.py

Note:

  • The training dataset (Anti-UAV-23) can be downloaded automatically.
  • Set the dataset path and cache_path in uav_scripts/train_uav_detection.py
  • More training Details can be seen in DamoYolo_Anti-UAV-23_S
  • The Large model will be released in DamoYolo_Anti-UAV-23_L before 20230211

Evaluation code for track2

cd CVPR_Anti_UAV
PYTHONPATH=. python uav_scripts/test_anti-uav_val_track2.py
eval result: 0.169

Note:

  • The validation dataset (Anti-UAV-23) can be downloaded automatically.
  • Set the traker (line24 damo/cv_alex_video-single-object-tracking_siamfc-uav) and detetion model_id (line27 damo/cv_tinynas_uav-detection_damoyolo) in uav_scripts/test_anti-uav_val_track2.py
  • Test your owr model:
line 101 in uav_scripts/test_anti-uav_val_track2.py
tracker_model_path = ""
det_model_path = ""
uav_tracker.model.load_state_dcit(torch.load(tracker_model_path))
uav_detection.model.load_state_dcit(torch.load(det_model_path))

Baseline Evaluation Code for test Set

Note: Code is available now, but the test set will be released in 2023.03.07.

Evaluation code for track1

  • Test SiamFC tracker with initial target ground-truth box
cd CVPR_Anti_UAV
python tests/pipelines/test_anti-uav_track1.py

Note:

  • The track1 dataset can be downloaded automatically.
  • Set the dataset path (line 28) in test_anti-uav_track1.py
  • You can evaluation other model by setting model path (line 38) and model network architecture (line 11) in modelscope/pipelines/cv/anti_uav_cvpr2023_pipeline.py
  • Submit track1.zip to track1: cd results/SiamFC && zip track1.zip *

You will see following results (If IR_label.json is available):

[001/140]  20190925_131530_1_7    IR Fixed Measure: 0.245
[002/140]  20190925_213001_1_5    IR Fixed Measure: -0.164
[003/140]  20190925_222534_1_3    IR Fixed Measure: 0.800
[004/140]  20190926_183941_1_8    IR Fixed Measure: 0.754
...
[Overall]    IR Mixed Measure:

Evaluation code for track2

  • Test SiamFC tracker and Yolov5 without initial target ground-truth box)
  • Detect the initial state of target using yolov5 then track the target using SiamFC. (You can also use detectors and trackers together for localization.)
  • Submit track2.zip to track2: cd results/Yolo_SiamFC && zip track2.zip *
cd CVPR_Anti_UAV
pip install -r yolov5/requirements.txt
python tests/pipelines/test_anti-uav_track2.py

Note:

  • The track2 dataset can be downloaded automatically.
  • Set the dataset path (line 28) in test_anti-uav_track1.py
  • You can evaluation other model by setting model path (line 39) and model network architecture (line 12) in modelscope/pipelines/cv/anti_uav_cvpr2023_pipeline.py