Skip to content

jamesljlster/yoro

Repository files navigation

YORO: A YOLO Variant for Rotated Object Detection

YORO, extended from YOLO feature map encoding, is an algorithm performimg simultaneous realtime object detection and rotation detection.

The documentation project is here: https://github.com/jamesljlster/yoro-tutorial
But only Chinese version is available currently.
If you want an English version, please open an issue for it.
At least let me know you are interested in my project :D

The project is not stable yet.
There are no guarantes for API compatibility.

Feature Map Encoding and Decoding

  • YORO use the same bounding box encoding as YOLOv4:
    WongKinYiu/ScaledYOLOv4#90

  • As for degree, please refer to the following methods:

    • Constants

      Given:

      • Where

        is the minimum degree.
        is the maximum degree.
        is the degree partition size.
        is the origin of degree encoding axis.

    • Encoding



      • Where

        is normalized degree scalar.
        is degree partition index.
        is degree shift scalar based on corresponding partition.

    • Loss

      • Where

        is total degree loss.
        is output logits of degree partition.
        is output vector of degree shift.
        The lengths of both output logits and vector are the same as .

    • Decoding



      • Where

        is degree partition index prediction.
        is degree shift prediction.
        is decoded degree prediction.

Requirement

See requirements.txt for Python package dependencies.
The following dependencies need to pay attention:

  • PyTorch 1.11.0 and TorchVision 0.12.0

    Compatibilty with other versions is not guaranteed.

  • CUDA Toolkit & cuDNN

    If your PyTorch was built with CUDA support, please install the corresponding version of CUDA toolkit and cuDNN.

Optional dependencies:

  • [Optional] OpenCV 4.0.0+

    YORO C++ API optionally requires OpenCV C++ development package for providing cv::Mat inference interface support.

Installation Instructions

The following instructions demonstrate package installation with conda based environments such as Miniconda or Anaconda.
You don’t have to follow this if YORO can be setup correctly by yourself.

# Create and activate a fresh conda environment
conda create -n yoro-env python==3.8.15
conda activate yoro-env  # This conda environment should be kept activated for the rest of instructions

# Install PyTorch 1.11.0 and corresponding CUDA Toolkit
conda install pytorch==1.11.0 torchvision==0.12.0 cudatoolkit=11.3 -c pytorch
conda install -c "nvidia/label/cuda-11.3.1" cuda-toolkit

# Install some build dependendies (cmake, gcc)
conda install -c conda-forge "gxx_linux-64<11"
conda install -c anaconda cmake

# Build and install YORO package
git clone https://github.com/jamesljlster/yoro.git
cd yoro
pip install -v .
cd ..

# Test if everything is fine
python -c "import yoro"

Collaboration Tools

  • ICANMark: Annotation tool for rotated bounding box.

Acknowledgement

Thanks ICAL Lab http://www.ical.tw/ for providing a good workstation for project development.

Citation

If this project helps your work, please kindly cite it :)

@unpublished{yoro,
    title={YORO: A YOLO Variant for Rotated Object Detection},
    author={Cheng-Ling Lai},
    note={Project URL: https://github.com/jamesljlster/yoro},
    year={2020}
}

Reference