GithubHelp home page GithubHelp logo

anm-pinellia / dota_yolov2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ringringyi/dota_yolov2

0.0 0.0 0.0 32.42 MB

Makefile 0.31% Python 2.09% C 89.28% Shell 0.25% Cuda 7.75% C++ 0.32%

dota_yolov2's Introduction

DOTA_YOLOv2 provides the data convertion code, parameter files while training DOTA using YOLOv2, and the trained model is also provided. So it's convenient for you to use them.

Our code is tested on official darknet@(commit f6d8617) with cuda-8.0 and cudnn-6.0 on Ubuntu 16.04.1 LTS.

Installation

  • install darknet
    See Installing Darknet for instructions.
  • development kit
    The Development kit provides the following functions. You can easily install it following the instructions.
    • Load and visulize the data.
    • Evaluate the result.
    • Split and merge the picture and label.

Training YOLO on DOTA

  • Get the DOTA Dataset

  • Convert the Label Format
    In DOTA, the annotation format is:

        x1 y1 x2 y2 x3 y3 x4 y4 category difficult
    

    While Darknet wants a .txt file for each image with a line for each ground truth object in the image that looks like:

        category-id x y width height
    

    Where x, y, width, and height are relative to the image's width and height. Here, you can refer to data_transform/YOLO_Transform.py to convert the format.

    Note that this code is for the image of size 1024*1024. If not, you should modify it accroding to your image size. For DOTA, you can refer to DOTA_devkit/ImgSplit.py to split the images and labels.

  • Modify Cfg for Your Data
    You have to change the cfg/dota.data config file to point to your data:

        classes=15
        train  = /home/yh/dota/dota_data/YOLO/train/train.txt
        valid  = /home/yh/dota/dota_data/YOLO/test/test.txt
        names = data/dota.names
        backup = /home/yh/dota/darknet/dota-backup
    

    You should replace the path here with the path where you put your corresponding file. And the text files like train.txt or test.txt list the image files for training or test. Notice that we use the full path of the image instead of the file name.

  • Train the Model

        wget https://pjreddie.com/media/files/darknet19_448.conv.23
        sh train-dota.sh 
    
  • Evaluate the Results
    You can download the pre-trained model on DOTA from Baidu Drive or Google Drive, and use it to test all the test images.

        sh valid-dota.sh 
    

    Then you will obtain 15 files stored in the results/ subdirectory, and each file contains all the results for a specific category.Each file is in the following format:

        imgname score xmin ymin xmax ymax 
    

    If you have split the images before, please first use DOTA_devkit/ResultMerge.py to merge the results.

    For DOTA, You can submit your results on the Evaluation Server for evaluation. See the official website of DOTA for details.

dota_yolov2's People

Contributors

ringringyi 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.