Deci-AI:master
from
deci-ai:feature/SG-761-yolo-nas
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
These model weights or any components comprising the model and the associated documentation (the "Software") is licensed to you by Deci.AI, Inc. ("Deci") under the following terms: © 2023 – Deci.AI, Inc.
Subject to your full compliance with all of the terms herein, Deci hereby grants you a non-exclusive, revocable, non-sublicensable, non-transferable worldwide and limited right and license to use the Software. If you are using the Deci platform for model optimization, your use of the Software is subject to the Terms of Use available here (the "Terms of Use").
You shall not, without Deci's prior written consent: (i) resell, lease, sublicense or distribute the Software to any person; (ii) use the Software to provide third parties with managed services or provide remote access to the Software to any person or compete with Deci in any way; (iii) represent that you possess any proprietary interest in the Software; (iv) directly or indirectly, take any action to contest Deci's intellectual property rights or infringe them in any way; (V) reverse-engineer, decompile, disassemble, alter, enhance, improve, add to, delete from, or otherwise modify, or derive (or attempt to derive) the technology or source code underlying any part of the Software; (vi) use the Software (or any part thereof) in any illegal, indecent, misleading, harmful, abusive, harassing and/or disparaging manner or for any such purposes. Except as provided under the terms of any separate agreement between you and Deci, including the Terms of Use to the extent applicable, you may not use the Software for any commercial use, including in connection with any models used in a production environment.
DECI PROVIDES THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS OF THE SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
Deci is thrilled to announce the release of a new object detection model, YOLO-NAS - a game-changer in the world of object detection, providing superior real-time object detection capabilities and production-ready performance. Deci's mission is to provide AI teams with tools to remove development barriers and attain efficient inference performance more quickly.
The new YOLO-NAS delivers state-of-the-art (SOTA) performance with the unparalleled accuracy-speed performance, outperforming other models such as YOLOv5, YOLOv6, YOLOv7 and YOLOv8.
Deci's proprietary Neural Architecture Search technology, AutoNAC™, generated the YOLO-NAS model. The AutoNAC™ engine lets you input any task, data characteristics (access to data is not required), inference environment and performance targets, and then guides you to find the optimal architecture that delivers the best balance between accuracy and inference speed for your specific application. In addition to being data and hardware aware, the AutoNAC engine considers other components in the inference stack, including compilers and quantization.
In terms of pure numbers, YOLO-NAS is ~0.5 mAP point more accurate and 10-20% faster than equivalent variants of YOLOv8 and YOLOv7.
Model | mAP | Latency (ms) |
---|---|---|
YOLO-NAS S | 47.5 | 3.21 |
YOLO-NAS M | 51.55 | 5.85 |
YOLO-NAS L | 52.22 | 7.87 |
YOLO-NAS S INT-8 | 47.03 | 2.36 |
YOLO-NAS M INT-8 | 51.0 | 3.78 |
YOLO-NAS L INT-8 | 52.1 | 4.78 |
mAP numbers in table reported for Coco 2017 Val dataset and latency benchmarked for 640x640 images on Nvidia T4 GPU.
YOLO-NAS's architecture employs quantization-aware blocks and selective quantization for optimized performance. When converted to its INT8 quantized version, YOLO-NAS experiences a smaller precision drop (0.51, 0.65, and 0.45 points of mAP for S, M, and L variants) compared to other models that lose 1-2 mAP points during quantization. These techniques culminate in innovative architecture with superior object detection capabilities and top-notch performance.
import super_gradients
yolo_nas = super_gradients.training.models.get("yolo_nas_l", pretrained_weights="coco").cuda()
yolo_nas.predict("https://deci-pretrained-models.s3.amazonaws.com/sample_images/beatles-abbeyroad.jpg").show()
We provide fine-tuning recipies for Roboflow-100 datasets.
We demonstrate great performance of YOLO-NAS on downstream tasks. When fine-tuning on Roboflow-100 our YOLO-NAS model achieves higher mAP than our nearest competitors:
Documentation: YOLO-NAS Quickstart |
Documentation: YOLO-NAS Quantization-Aware training and post-training Quantization |
![]() |
![]() |
The YOLO-NAS model is available under an open-source license with pre-trained weights available for non-commercial use on SuperGradients, Deci's PyTorch-based, open-source, computer vision training library. With SuperGradients, users can train models from scratch or fine-tune existing ones, leveraging advanced built-in training techniques like Distributed Data Parallel, Exponential Moving Average, Automatic mixed precision, and Quantization Aware Training.
License file is available here: YOLO-NAS WEIGHTS LICENSE
The YOLO-SG model incorporates quantization-aware RepVGG blocks to ensure compatibility with post-training quantization, making it very flexible and usable for different hardware configurations.
In this tutorial, we will go over the basic functionality of the YOLO-NAS model.
from super_gradients.training import models
from super_gradients.common.object_names import Models
net = models.get(Models.YoloNAS_S, pretrained_weights="coco")
prediction = net.predict("https://www.aljazeera.com/wp-content/uploads/2022/12/2022-12-03T205130Z_851430040_UP1EIC31LXSAZ_RTRMADP_3_SOCCER-WORLDCUP-ARG-AUS-REPORT.jpg?w=770&resize=770%2C436&quality=80")
prediction.show()
models.convert_to_onnx(model=net, input_shape=(3,640,640), out_path="yolo_nas_s.onnx")
Follow the setup instructions for RF100:
- Follow the official instructions to download Roboflow100: https://github.com/roboflow/roboflow-100-benchmark?ref=roboflow-blog
//!\\ To use this dataset, you must download the "coco" format, NOT the yolov5.
- Your dataset should look like this:
rf100
├── 4-fold-defect
│ ├─ train
│ │ ├─ 000000000001.jpg
│ │ ├─ ...
│ │ └─ _annotations.coco.json
│ ├─ valid
│ │ └─ ...
│ └─ test
│ └─ ...
├── abdomen-mri
│ └─ ...
└── ...
- Install CoCo API: https://github.com/pdollar/coco/tree/master/PythonAPI
We will use the roboflow_yolo_nas_s
configuration to train the small variant of our YOLO-NAS, YOLO-NAS-S.
To launch training on one of the RF100 datasets, we pass it through the dataset_name argument:
python -m super_gradients.train_from_recipe --config-name=roboflow_yolo_nas_s dataset_name=<DATASET_NAME> dataset_params.data_dir=<PATH_TO_RF100_ROOT> ckpt_root_dir=<YOUR_CHECKPOINTS_ROOT_DIRECTORY>
Replace <DATASET_NAME> with any of the RF100 datasets that you wish to train on.
In this tutorial, we will guide you step by step on how to prepare our YOLO-NAS for production! We will leverage YOLO-NAS architecture which includes quantization-friendly blocks, and train a YOLO-NAS model on Roboflow's Soccer Player Detection Dataset in a way that would maximize our throughput without compromising on the model's accuracy.
The steps will be:
Pre-requisites:
Now, let's get to it.
Follow the setup instructions for RF100:
- Follow the official instructions to download Roboflow100: https://github.com/roboflow/roboflow-100-benchmark?ref=roboflow-blog
//!\\ To use this dataset, you must download the "coco" format, NOT the yolov5.
- Your dataset should look like this:
rf100
├── 4-fold-defect
│ ├─ train
│ │ ├─ 000000000001.jpg
│ │ ├─ ...
│ │ └─ _annotations.coco.json
│ ├─ valid
│ │ └─ ...
│ └─ test
│ └─ ...
├── abdomen-mri
│ └─ ...
└── ...
- Install CoCo API: https://github.com/pdollar/coco/tree/master/PythonAPI
Install the latest version of SG:
pip install super-gradients
Install torch + PyTorch-quantization (note that later versions should be compatible as well and that you should essentially follow torch installation according to https://pytorch.org/get-started/locally/)
pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113 &> /dev/null
pip install pytorch-quantization==2.1.2 --extra-index-url https://pypi.ngc.nvidia.com &> /dev/null
Although this might come as a surprise - the name quantization-aware training needs to be more accurate and be performed on a trained checkpoint rather than from scratch.
So in practice, we need to train our model on our dataset fully, then after we perform calibration, we fine-tune our model once again, which will be our final step.
As we discuss in our Training with configuration files, we clone the SG repo, then use the repo's configuration files in our training examples.
We will use the src/super_gradients/recipes/roboflow_yolo_nas_s.yaml
configuration to train the small variant of our DeciModel, DeciModel S.
So we navigate to our train_from_recipe
script:
cd <YOUR-LOCAL-PATH>/super_gradients/src/super_gradients/examples/train_from_recipe_example
Then to avoid collisions between our cloned and installed SG:
export PYTHONPATH=$PYTHONPATH:<YOUR-LOCAL-PATH>/super_gradients/
To launch training on one of the RF100 datasets, we pass it through the dataset_name argument:
python -m train_from_recipe --config-name=roboflow_yolo_nas_s dataset_name=soccer-players-5fuqs dataset_params.data_dir=<PATH_TO_RF100_ROOT> ckpt_root_dir=<YOUR_CHECKPOINTS_ROOT_DIRECTORY> experiment_name=yolo_nas_s_soccer_players
...
Train epoch 99: 100%|██████████| 32/32 [00:23<00:00, 1.35it/s, PPYoloELoss/loss=0.853, PPYoloELoss/loss_cls=0.417, PPYoloELoss/loss_dfl=0.56, PPYoloELoss/loss_iou=0.0621, gpu_mem=11.7]
Validation epoch 99: 100%|██████████| 3/3 [00:00<00:00, 5.49it/s]
===========================================================
SUMMARY OF EPOCH 99
├── Training
│ ├── Ppyoloeloss/loss = 0.8527
│ │ ├── Best until now = 0.8515 (↗ 0.0012)
│ │ └── Epoch N-1 = 0.8515 (↗ 0.0012)
│ ├── Ppyoloeloss/loss_cls = 0.4174
│ │ ├── Best until now = 0.4178 (↘ -0.0004)
│ │ └── Epoch N-1 = 0.4178 (↘ -0.0004)
│ ├── Ppyoloeloss/loss_dfl = 0.5602
│ │ ├── Best until now = 0.5573 (↗ 0.0029)
│ │ └── Epoch N-1 = 0.5573 (↗ 0.0029)
│ └── Ppyoloeloss/loss_iou = 0.0621
│ ├── Best until now = 0.062 (↗ 0.0)
│ └── Epoch N-1 = 0.062 (↗ 0.0)
└── Validation
├── F1@0.50 = 0.779
│ ├── Best until now = 0.8185 (↘ -0.0395)
│ └── Epoch N-1 = 0.796 (↘ -0.017)
├── Map@0.50 = 0.9601
│ ├── Best until now = 0.967 (↘ -0.0069)
│ └── Epoch N-1 = 0.957 (↗ 0.0031)
├── Ppyoloeloss/loss = 1.4472
│ ├── Best until now = 1.3971 (↗ 0.0501)
│ └── Epoch N-1 = 1.4421 (↗ 0.0051)
├── Ppyoloeloss/loss_cls = 0.5981
│ ├── Best until now = 0.527 (↗ 0.0711)
│ └── Epoch N-1 = 0.5986 (↘ -0.0005)
├── Ppyoloeloss/loss_dfl = 0.8216
│ ├── Best until now = 0.7849 (↗ 0.0367)
│ └── Epoch N-1 = 0.8202 (↗ 0.0014)
├── Ppyoloeloss/loss_iou = 0.1753
│ ├── Best until now = 0.1684 (↗ 0.007)
│ └── Epoch N-1 = 0.1734 (↗ 0.002)
├── Precision@0.50 = 0.6758
│ ├── Best until now = 0.7254 (↘ -0.0495)
│ └── Epoch N-1 = 0.6931 (↘ -0.0172)
└── Recall@0.50 = 0.9567
├── Best until now = 0.9872 (↘ -0.0304)
└── Epoch N-1 = 0.9567 (= 0.0)
===========================================================
[2023-03-30 14:09:47] INFO - sg_trainer.py - RUNNING ADDITIONAL TEST ON THE AVERAGED MODEL...
Validation epoch 100: 100%|██████████| 3/3 [00:00<00:00, 5.45it/s]
===========================================================
SUMMARY OF EPOCH 100
├── Training
│ ├── Ppyoloeloss/loss = 0.8527
│ │ ├── Best until now = 0.8515 (↗ 0.0012)
│ │ └── Epoch N-1 = 0.8515 (↗ 0.0012)
│ ├── Ppyoloeloss/loss_cls = 0.4174
│ │ ├── Best until now = 0.4178 (↘ -0.0004)
│ │ └── Epoch N-1 = 0.4178 (↘ -0.0004)
│ ├── Ppyoloeloss/loss_dfl = 0.5602
│ │ ├── Best until now = 0.5573 (↗ 0.0029)
│ │ └── Epoch N-1 = 0.5573 (↗ 0.0029)
│ └── Ppyoloeloss/loss_iou = 0.0621
│ ├── Best until now = 0.062 (↗ 0.0)
│ └── Epoch N-1 = 0.062 (↗ 0.0)
└── Validation
├── F1@0.50 = 0.7824
│ ├── Best until now = 0.8185 (↘ -0.0361)
│ └── Epoch N-1 = 0.779 (↗ 0.0034)
├── Map@0.50 = 0.9635
│ ├── Best until now = 0.967 (↘ -0.0036)
│ └── Epoch N-1 = 0.9601 (↗ 0.0033)
├── Ppyoloeloss/loss = 1.432
│ ├── Best until now = 1.3971 (↗ 0.0349)
│ └── Epoch N-1 = 1.4472 (↘ -0.0152)
├── Ppyoloeloss/loss_cls = 0.588
│ ├── Best until now = 0.527 (↗ 0.061)
│ └── Epoch N-1 = 0.5981 (↘ -0.0101)
├── Ppyoloeloss/loss_dfl = 0.8191
│ ├── Best until now = 0.7849 (↗ 0.0343)
│ └── Epoch N-1 = 0.8216 (↘ -0.0025)
├── Ppyoloeloss/loss_iou = 0.1738
│ ├── Best until now = 0.1684 (↗ 0.0054)
│ └── Epoch N-1 = 0.1753 (↘ -0.0015)
├── Precision@0.50 = 0.6769
│ ├── Best until now = 0.7254 (↘ -0.0485)
│ └── Epoch N-1 = 0.6758 (↗ 0.0011)
└── Recall@0.50 = 0.9567
├── Best until now = 0.9872 (↘ -0.0304)
└── Epoch N-1 = 0.9567 (= 0.0)
And so our best checkpoint resides in <YOUR_CHECKPOINTS_ROOT_DIRECTORY>/yolo_nas_s_soccer_players/ckpt_best.pth reaches 0.967 mAP!
Let's visualize some results:
from super_gradients.common.object_names import Models
from super_gradients.training import models
model = models.get(Models.YOLO_NAS_S,
checkpoint_path=<YOUR_CHECKPOINTS_ROOT_DIRECTORY>/yolo_nas_s_soccer_players/ckpt_best.pth>,
num_classes=4)
predictions = model.predict("messi_penalty.mp4")
predictions.show(show_confidence=False)
Now, we will take our checkpoint from our previous section and perform post-training quantization, then quantization-aware training.
To do so, we will need to launch training with our qat_from_recipe
example script, which simplifies taking any existing training recipe and making it a quantization-aware one with the help of some of our recommended practices.
So this time, we navigate to the qat_from_recipe
example directory:
cd <YOUR-LOCAL-PATH>/super_gradients/src/super_gradients/examples/qat_from_recipe_example
Before we launch, let's see how we can easily create a configuration from our roboflow_yolo_nas_s
config to get the most out of QAT and PTQ.
We added a new config that inherits from our previous one, called roboflow_yolo_nas_s_qat.yaml
. Let's peek at it:
defaults:
- roboflow_yolo_nas_s
- quantization_params: default_quantization_params
- _self_
checkpoint_params:
checkpoint_path: ???
strict_load: no_key_matching
experiment_name: soccer_players_qat_yolo_nas_s
pre_launch_callbacks_list:
- QATRecipeModificationCallback:
batch_size_divisor: 2
max_epochs_divisor: 10
lr_decay_factor: 0.01
warmup_epochs_divisor: 10
cosine_final_lr_ratio: 0.01
disable_phase_callbacks: True
disable_augmentations: False
Let's break it down:
We inherit from our original non-QA recipe
We set quantization_params
to the default ones. Reminder - this is where QAT and PTQ hyper-parameters are defined.
We set our checkpoint_params.checkpoint_path to ??? so that passing a checkpoint is required. We will override this value when launching from the command line.
We add a QATRecipeModificationCallback
to our pre_launch_callbacks_list
: This callback accepts the entire cfg: DictConfig
and manipulates it right before we start the training. This allows us to adapt any non-QA recipe to a QA one quickly.
Here we will:
Now we can launch PTQ and QAT from the command line:
python -m qat_from_recipe --config-name=roboflow_yolo_nas_s_qat experiment_name=soccer_players_qat_yolo_nas_s dataset_name=soccer-players-5fuqs dataset_params.data_dir=<PATH_TO_RF100_ROOT> checkpoint_params.checkpoint_path=<YOUR_CHECKPOINTS_ROOT_DIRECTORY>/yolo_nas_s_soccer_players/ckpt_best.pth ckpt_ckpt_root_dir=<YOUR_CHECKPOINTS_ROOT_DIRECTORY>
...
[2023-04-02 11:37:56,848][super_gradients.training.pre_launch_callbacks.pre_launch_callbacks][INFO] - Modifying recipe to suit QAT rules of thumb. Remove QATRecipeModificationCallback to disable.
[2023-04-02 11:37:56,858][super_gradients.training.pre_launch_callbacks.pre_launch_callbacks][WARNING] - New number of epochs: 10
[2023-04-02 11:37:56,858][super_gradients.training.pre_launch_callbacks.pre_launch_callbacks][WARNING] - New learning rate: 5e-06
[2023-04-02 11:37:56,858][super_gradients.training.pre_launch_callbacks.pre_launch_callbacks][WARNING] - New weight decay: 1.0000000000000002e-06
[2023-04-02 11:37:56,858][super_gradients.training.pre_launch_callbacks.pre_launch_callbacks][WARNING] - EMA will be disabled for QAT run.
[2023-04-02 11:37:56,859][super_gradients.training.pre_launch_callbacks.pre_launch_callbacks][WARNING] - SyncBatchNorm will be disabled for QAT run.
[2023-04-02 11:37:56,859][super_gradients.training.pre_launch_callbacks.pre_launch_callbacks][WARNING] - Recipe requests multi_gpu=False and num_gpus=1. Changing to multi_gpu=OFF and num_gpus=1
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 32/32 [00:32<00:00, 1.01s/it]
[2023-04-02 11:38:34,316][super_gradients.training.qat_trainer.qat_trainer][INFO] - Validating PTQ model...
0%| | 0/3 [00:00<?, ?it/s]
Test: 0%| | 0/3 [00:00<?, ?it/s]
Test: 33%|███▎ | 1/3 [00:00<00:00, 2.87it/s]
Test: 67%|██████▋ | 2/3 [00:00<00:00, 2.90it/s]
Test: 100%|██████████| 3/3 [00:00<00:00, 3.86it/s]
[2023-04-02 11:38:35,106][super_gradients.training.qat_trainer.qat_trainer][INFO] - PTQ Model Validation Results
- Precision@0.50: 0.6727069020271301
- Recall@0.50: 0.95766681432724
- mAP@0.50 : 0.9465919137001038
- F1@0.50 : 0.7861716747283936
Observe that for PTQ, our model's mAP decreased from 0.967 to 0.9466. After PTQ, QAT is performed automatically:
[2023-04-02 11:38:47] INFO - sg_trainer.py - Started training for 10 epochs (0/9)
Train epoch 0: 100%|██████████| 32/32 [00:26<00:00, 1.21it/s, PPYoloELoss/loss=0.909, PPYoloELoss/loss_cls=0.444, PPYoloELoss/loss_dfl=0.57, PPYoloELoss/loss_iou=0.0721, gpu_mem=10.1]
Validation epoch 0: 100%|██████████| 3/3 [00:00<00:00, 3.75it/s]
===========================================================
SUMMARY OF EPOCH 0
├── Training
│ ├── Ppyoloeloss/loss = 0.9088
│ ├── Ppyoloeloss/loss_cls = 0.4436
│ ├── Ppyoloeloss/loss_dfl = 0.5696
│ └── Ppyoloeloss/loss_iou = 0.0721
└── Validation
├── F1@0.50 = 0.7885
├── Map@0.50 = 0.9556
├── Ppyoloeloss/loss = 1.4303
├── Ppyoloeloss/loss_cls = 0.5847
├── Ppyoloeloss/loss_dfl = 0.8186
├── Ppyoloeloss/loss_iou = 0.1745
├── Precision@0.50 = 0.671
└── Recall@0.50 = 0.9734
===========================================================
[2023-04-02 11:39:14] INFO - sg_trainer.py - Best checkpoint overriden: validation mAP@0.50: 0.9556358456611633
Train epoch 1: 100%|██████████| 32/32 [00:26<00:00, 1.22it/s, PPYoloELoss/loss=0.91, PPYoloELoss/loss_cls=0.445, PPYoloELoss/loss_dfl=0.574, PPYoloELoss/loss_iou=0.0712, gpu_mem=10.1]
Validation epoch 1: 100%|██████████| 3/3 [00:00<00:00, 3.88it/s]
===========================================================
SUMMARY OF EPOCH 1
├── Training
│ ├── Ppyoloeloss/loss = 0.9097
│ │ ├── Best until now = 0.9088 (↗ 0.001)
│ │ └── Epoch N-1 = 0.9088 (↗ 0.001)
│ ├── Ppyoloeloss/loss_cls = 0.4448
│ │ ├── Best until now = 0.4436 (↗ 0.0011)
│ │ └── Epoch N-1 = 0.4436 (↗ 0.0011)
│ ├── Ppyoloeloss/loss_dfl = 0.5739
│ │ ├── Best until now = 0.5696 (↗ 0.0044)
│ │ └── Epoch N-1 = 0.5696 (↗ 0.0044)
│ └── Ppyoloeloss/loss_iou = 0.0712
│ ├── Best until now = 0.0721 (↘ -0.0009)
│ └── Epoch N-1 = 0.0721 (↘ -0.0009)
└── Validation
├── F1@0.50 = 0.7537
│ ├── Best until now = 0.7885 (↘ -0.0348)
│ └── Epoch N-1 = 0.7885 (↘ -0.0348)
├── Map@0.50 = 0.9581
│ ├── Best until now = 0.9556 (↗ 0.0025)
│ └── Epoch N-1 = 0.9556 (↗ 0.0025)
├── Ppyoloeloss/loss = 1.4312
│ ├── Best until now = 1.4303 (↗ 0.0009)
│ └── Epoch N-1 = 1.4303 (↗ 0.0009)
├── Ppyoloeloss/loss_cls = 0.5881
│ ├── Best until now = 0.5847 (↗ 0.0034)
│ └── Epoch N-1 = 0.5847 (↗ 0.0034)
├── Ppyoloeloss/loss_dfl = 0.8166
│ ├── Best until now = 0.8186 (↘ -0.002)
│ └── Epoch N-1 = 0.8186 (↘ -0.002)
├── Ppyoloeloss/loss_iou = 0.1739
│ ├── Best until now = 0.1745 (↘ -0.0006)
│ └── Epoch N-1 = 0.1745 (↘ -0.0006)
├── Precision@0.50 = 0.6262
│ ├── Best until now = 0.671 (↘ -0.0448)
│ └── Epoch N-1 = 0.671 (↘ -0.0448)
└── Recall@0.50 = 0.9734
├── Best until now = 0.9734 (= 0.0)
└── Epoch N-1 = 0.9734 (= 0.0)
===========================================================
...
...
Validation epoch 10: 100%|██████████| 3/3 [00:00<00:00, 4.07it/s]
===========================================================
SUMMARY OF EPOCH 10
├── Training
│ ├── Ppyoloeloss/loss = 0.8901
│ │ ├── Best until now = 0.889 (↗ 0.0011)
│ │ └── Epoch N-1 = 0.8957 (↘ -0.0056)
│ ├── Ppyoloeloss/loss_cls = 0.4365
│ │ ├── Best until now = 0.4359 (↗ 0.0005)
│ │ └── Epoch N-1 = 0.4384 (↘ -0.002)
│ ├── Ppyoloeloss/loss_dfl = 0.5677
│ │ ├── Best until now = 0.5665 (↗ 0.0012)
│ │ └── Epoch N-1 = 0.5702 (↘ -0.0025)
│ └── Ppyoloeloss/loss_iou = 0.0679
│ ├── Best until now = 0.0672 (↗ 0.0007)
│ └── Epoch N-1 = 0.0689 (↘ -0.001)
└── Validation
├── F1@0.50 = 0.7373
│ ├── Best until now = 0.7885 (↘ -0.0512)
│ └── Epoch N-1 = 0.721 (↗ 0.0164)
├── Map@0.50 = 0.968
│ ├── Best until now = 0.9672 (↗ 0.0007)
│ └── Epoch N-1 = 0.9517 (↗ 0.0163)
├── Ppyoloeloss/loss = 1.4326
│ ├── Best until now = 1.4303 (↗ 0.0023)
│ └── Epoch N-1 = 1.4322 (↗ 0.0004)
├── Ppyoloeloss/loss_cls = 0.5887
│ ├── Best until now = 0.5847 (↗ 0.004)
│ └── Epoch N-1 = 0.5889 (↘ -0.0002)
├── Ppyoloeloss/loss_dfl = 0.8164
│ ├── Best until now = 0.8154 (↗ 0.001)
│ └── Epoch N-1 = 0.8158 (↗ 0.0006)
├── Ppyoloeloss/loss_iou = 0.1743
│ ├── Best until now = 0.1737 (↗ 0.0006)
│ └── Epoch N-1 = 0.1742 (↗ 1e-04)
├── Precision@0.50 = 0.6052
│ ├── Best until now = 0.671 (↘ -0.0658)
│ └── Epoch N-1 = 0.5953 (↗ 0.01)
└── Recall@0.50 = 0.9853
├── Best until now = 0.9853 (= 0.0)
└── Epoch N-1 = 0.9734 (↗ 0.0119)
We not only observed no decline in the accuracy of our quantized model, but we also gained an improvement of 0.08 mAP! The QAT model is available in our checkpoints directory, already converted to .onnx format under <YOUR_CHECKPOINTS_ROOT_DIRECTORY>/soccer_players_qat_yolo_nas_s/soccer_players_qat_yolo_nas_s_16x3x640x640_qat.onnx, ready to be converted to converted and deployed to int8 using TRT.
1
|
|
1
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
1
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
1
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
1
|
|
1
|
|
1
|
|
1
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
1
|
|
1
|
|
1
|
|
1
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
1
|
|
1
|
|
1
|
|
1
|
|
1
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
1
|
|
1
|
|