Giter Club home page Giter Club logo

ai-cup_drone's Introduction

AI_CUP 無人機飛行載具之智慧計數競賽

Rank 19 (Total 236 teams)

We train with Yolov7 and YoloR models and augment our data with three additional datasets.

Augment Datasets

  1. Visdrone
  2. CAPRK
  3. AI-TOD

Convert these data into Yolo format and change the labels to only four categories: cars, trucks, pedestrians, and motorcycles.

Datasets Perprocessing

Create three folders (train\Val\Test) under the datasets folder

  1. train folder (Training dataset)
  2. val folder (Validation dataset)
  3. test folder (AI-CUP public and private datasets)

Once you have prepared three folders, then you should put the photos and labels from the three datasets mentioned above into the corresponding folders (e.g. Training photos should go in the train/images folder, and training labels should go in the train/labels folder), and then run create_txt.ipynb to create three txt files.

requirements

pip install -r yolov7/requirements.txt

YOlOV7 ([Current Woring Directory] AI-CUP_Drone/yolov7)

(Remember to create a aicup.yaml file under the yolov7/data folder)

Training

python train_aux.py --workers 8 --device 0 --batch-size 8 --data data/aicup.yaml --img 1280 1280 --cfg cfg/training/yolov7-e6e.yaml --weights 'yolov7-e6e_training.pt' --name yolov7-e6e --hyp data/hyp.scratch.p6.yaml --epochs 500  --cache-images

Testing Weights

python detect.py --weights "runs/train/yolov7-e6e/weights/yolov7_best.pt" --source "../datasets/test/images/" --conf-thres 0.3 --img-size 1920 --augment --save-txt --save-conf 

YOlOR ([Current Woring Directory] AI-CUP_Drone/yolor)

(Remember to create a aicup.yaml file under the yolor/data folder)

Training

python train.py --batch-size 4 --img 1280 1280 --data data/aicup.yaml --cfg models/yolor-d6.yaml --weights 'yolor-d6-paper-573.pt' --device 0 --name yolor_d6 --hyp data/hyp.scratch.1280.yaml --epochs 500 --cache-image

Testing Weights

python detect.py --weights "runs/train/yolor_d62/weights/yolor_best.pt" --source "../datasets/test/images/" --conf-thres 0.45 --img-size 1920 --augment --save-txt --save-conf --device 0

Post-processing (WBF)

requirements

pip install ensemble-boxes

Prepare the yolov7/yolor testing results as below structure:

-wbf
  |- runs         
  |   |- yolov7_exp   (This folder is same as the exp folder under the yolov7/runs/detect)
  |   |- yolor_exp    (This folder is same as the exp folder under the yolor/runs/detect)
   

Run the following cmd

[Current Woring Directory] AI-CUP_Drone/wbf
python wbf.py

Create the final csv result.

[Current Woring Directory] AI-CUP_Drone
python transform.py

ai-cup_drone's People

Contributors

jia-hong-chu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.