-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
1,197 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
version: 2 | ||
|
||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.12" | ||
|
||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
Quick Start | ||
=========== | ||
|
||
.. note:: | ||
We expect all customizations to be done primarily by passing arguments or modifying the YAML config files. | ||
If more detailed modifications are needed, custom content should be modularized as much as possible to avoid extensive code modifications. | ||
|
||
.. _QuickInstallYOLO: | ||
|
||
Install YOLO | ||
------------ | ||
|
||
Clone the repository and install the dependencies: | ||
|
||
.. code-block:: bash | ||
git clone https://github.com/WongKinYiu/YOLO.git | ||
cd YOLO | ||
pip install -r requirements-dev.txt | ||
# Make sure to work inside the cloned folder. | ||
Alternatively, If you are planning to make a simple change: | ||
|
||
**Note**: In the following examples, you should replace ``python yolo/lazy.py`` with ``yolo`` . | ||
|
||
.. code-block:: bash | ||
pip install git+https://github.com/WongKinYiu/YOLO.git | ||
**Note**: Most tasks already include at yolo/lazy.py, so you can run with this prefix and follow arguments: ``python yolo/lazy.py`` | ||
|
||
|
||
Train Model | ||
----------- | ||
|
||
To train the model, use the following command: | ||
|
||
.. code-block:: bash | ||
python yolo/lazy.py task=train | ||
yolo task=train # if installed via pip | ||
- Overriding the ``dataset`` parameter, you can customize your dataset via a dataset config. | ||
- Overriding YOLO model by setting the ``model`` parameter to ``{v9-c, v9-m, ...}``. | ||
- More details can be found at :ref:`Train Tutorials<Train>`. | ||
|
||
For example: | ||
|
||
.. code-block:: bash | ||
python yolo/lazy.py task=train dataset=AYamlFilePath model=v9-m | ||
yolo task=train dataset=AYamlFilePath model=v9-m # if installed via pip | ||
Inference & Deployment | ||
------------------------ | ||
|
||
Inference is the default task of ``yolo/lazy.py``. To run inference and deploy the model, use: | ||
More details can be found at :ref:`Inference Tutorials <Inference>`. | ||
|
||
.. code-block:: bash | ||
python yolo/lazy.py task.data.source=AnySource | ||
yolo task.data.source=AnySource # if installed via pip | ||
You can enable fast inference modes by adding the parameter ``task.fast_inference={onnx, trt, deploy}``. | ||
|
||
- Theoretical acceleration following :ref:`YOLOv9 <Deploy>`. | ||
- Hardware acceleration like :ref:`ONNX <ONNX>` and :ref:`TensorRT <TensorRT>`. for optimized deployment. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
What is YOLO | ||
============ | ||
|
||
``YOLO`` (You Only Look Once) is a state-of-the-art, real-time object detection system. It is designed to predict bounding boxes and class probabilities for objects in an image with high accuracy and speed. YOLO models, including the latest YOLOv9, are known for their efficiency in detecting objects in a single forward pass through the network, making them highly suitable for real-time applications. | ||
|
||
YOLOv9 introduces improvements in both architecture and loss functions to enhance prediction accuracy and inference speed. | ||
|
||
Forward Process | ||
--------------- | ||
|
||
The forward process of YOLOv9 can be visualized as follows: | ||
|
||
.. mermaid:: | ||
|
||
graph LR | ||
subgraph YOLOv9 | ||
Auxiliary | ||
AP["Auxiliary Prediction"] | ||
end | ||
BackBone-->FPN; | ||
FPN-->PAN; | ||
PAN-->MP["Main Prediction"]; | ||
BackBone-->Auxiliary; | ||
Auxiliary-->AP; | ||
|
||
- **BackBone**: Extracts features from the input image. | ||
- **FPN (Feature Pyramid Network)**: Aggregates features at different scales. | ||
- **PAN (Region Proposal Network)**: Proposes regions of interest. | ||
- **Main Prediction**: The primary detection output. | ||
- **Auxiliary Prediction**: Additional predictions to assist the main prediction. | ||
|
||
Loss Function | ||
------------- | ||
|
||
The loss function of YOLOv9 combines several components to optimize the model's performance: | ||
|
||
.. mermaid:: | ||
|
||
flowchart LR | ||
gtb-->cls | ||
gtb["Ground Truth"]-->iou | ||
pdm-.->cls["Max Class"] | ||
pdm["Main Prediction"]-.->iou["Closest IoU"] | ||
pdm-.->anc["box in anchor"] | ||
cls-->gt | ||
iou-->gt["Matched GT Box"] | ||
anc-.->gt | ||
|
||
gt-->Liou["IoU Loss"] | ||
pdm-->Liou | ||
pdm-->Lbce | ||
gt-->Lbce["BCE Loss"] | ||
gt-->Ldfl["DFL Loss"] | ||
pdm-->Ldfl | ||
|
||
Lbce-->ML | ||
Liou-->ML | ||
Ldfl-->ML["Total Loss"] | ||
|
||
- **Ground Truth**: The actual labels and bounding boxes in the dataset. | ||
- **Main Prediction**: The model's predicted bounding boxes and class scores. | ||
- **IoU (Intersection over Union)**: Measures the overlap between the predicted and ground truth boxes. | ||
- **BCE (Binary Cross-Entropy) Loss**: Used for class prediction. | ||
- **DFL (Distribution Focal Loss)**: Used for improving the precision of bounding box regression. | ||
|
||
By optimizing these components, YOLOv9 aims to achieve high accuracy and robustness in object detection tasks. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
Install YOLO | ||
============ | ||
|
||
This guide will help you set up YOLO on your machine. | ||
We recommend starting with `GitHub Settings <#git-github>`_ for more flexible customization. | ||
If you are planning to perform inference only or require a simple customization, you can choose to install via `PyPI <#pypi-pip-install>`_. | ||
|
||
Torch Requirements | ||
------------------- | ||
|
||
The following table summarizes the torch requirements for different operating systems and hardware configurations: | ||
|
||
|
||
.. tabs:: | ||
|
||
.. tab:: Linux | ||
|
||
.. tabs:: | ||
|
||
.. tab:: CUDA | ||
|
||
PyTorch: 1.12+ | ||
|
||
.. tab:: CPU | ||
|
||
PyTorch: 1.12+ | ||
|
||
.. tab:: MacOS | ||
|
||
.. tabs:: | ||
|
||
.. tab:: MPS | ||
|
||
PyTorch: 2.2+ | ||
.. tab:: CPU | ||
PyTorch: 2.2+ | ||
.. tab:: Windows | ||
|
||
.. tabs:: | ||
|
||
.. tab:: CUDA | ||
|
||
[WIP] | ||
|
||
.. tab:: CPU | ||
|
||
[WIP] | ||
|
||
|
||
Git & GitHub | ||
------------ | ||
|
||
First, Clone the repository: | ||
|
||
.. code-block:: bash | ||
git clone https://github.com/WongKinYiu/YOLO.git | ||
Alternatively, you can directly download the repository via this `link <https://github.com/WongKinYiu/YOLO/archive/refs/heads/main.zip>`_. | ||
|
||
Next, install the required packages: | ||
|
||
.. code-block:: bash | ||
# For the minimal requirements, use: | ||
pip install -r requirements.txt | ||
# For a full installation, use: | ||
pip install -r requirements-dev.txt | ||
Moreover, if you plan to utilize ONNX or TensorRT, please follow :ref:`ONNX`, :ref:`TensorRT` for more installation details. | ||
|
||
PyPI (pip install) | ||
------------------ | ||
|
||
.. note:: | ||
Due to the :guilabel:`yolo` this name already being occupied in the PyPI library, we are still determining the package name. | ||
Currently, we provide an alternative way to install via the GitHub repository. Ensure your shell has `git` and `pip3` (or `pip`). | ||
|
||
To install YOLO via GitHub: | ||
|
||
.. code-block:: bash | ||
pip install git+https://github.com/WongKinYiu/YOLO.git | ||
Docker | ||
------ | ||
|
||
To run YOLO using NVIDIA Docker, you can pull the Docker image and run it with GPU support: | ||
|
||
.. code-block:: bash | ||
docker pull henrytsui000/yolo | ||
docker run --gpus all -it henrytsui000/yolo | ||
Make sure you have the NVIDIA Docker toolkit installed. For more details on setting up NVIDIA Docker, refer to the `NVIDIA Docker documentation <https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html>`_. | ||
|
||
|
||
Conda | ||
----- | ||
|
||
We will publish it in the near future! |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.