Skip to content

Commit

Permalink
Merge branch 'meituan:main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
triple-Mu authored Jun 29, 2022
2 parents d720793 + e714543 commit 1668503
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 11 deletions.
8 changes: 7 additions & 1 deletion deploy/OpenVINO/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ python deploy/OpenVINO/export_openvino.py --weights yolov6s.pt --img 640 --batch
### Download
* [YOLOv6-nano](https://github.com/meituan/YOLOv6/releases/download/0.1.0/yolov6n_openvino.tar.gz)
* [YOLOv6-tiny](https://github.com/meituan/YOLOv6/releases/download/0.1.0/yolov6n_openvino.tar.gz)
* [YOLOv6-s](https://github.com/meituan/YOLOv6/releases/download/0.1.0/yolov6n_openvino.tar.gz)
* [YOLOv6-s](https://github.com/meituan/YOLOv6/releases/download/0.1.0/yolov6n_openvino.tar.gz)

### Speed test
```shell
benchmark_app -m yolov6s_openvino/yolov6s.xml -i data/images/image1.jpg -d CPU -niter 100 -progress

```
2 changes: 1 addition & 1 deletion docs/Test_speed.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Test speed

This guidence explains how to reproduce speed results of YOLOv6. For fair comparision, the speed results do not contain the time cost of data pre-processing and NMS post-processing.
This guidence explains how to reproduce speed results of YOLOv6. For fair comparison, the speed results do not contain the time cost of data pre-processing and NMS post-processing.

## 0. Prepare model

Expand Down
2 changes: 1 addition & 1 deletion docs/Train_custom_data.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Train Custom Data

This guidence explains how to train your own custom data with YOLOv6 ( take fine-tuning YOLOv6-s model for example).
This guidence explains how to train your own custom data with YOLOv6 (take fine-tuning YOLOv6-s model for example).

## 0. Before you start

Expand Down
2 changes: 1 addition & 1 deletion tools/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def run(data,
):
""" Run the evaluation process
This function is the main process of evalutaion, supporting image file and dir containing images.
This function is the main process of evaluataion, supporting image file and dir containing images.
It has tasks of 'val', 'train' and 'speed'. Task 'train' processes the evaluation during training phase.
Task 'val' processes the evaluation purely and return the mAP of model.pt. Task 'speed' precesses the
evaluation of inference speed of model.pt.
Expand Down
5 changes: 4 additions & 1 deletion tools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ def get_args_parser(add_help=True):
parser.add_argument('--epochs', default=400, type=int, help='number of total epochs to run')
parser.add_argument('--workers', default=8, type=int, help='number of data loading workers (default: 8)')
parser.add_argument('--device', default='0', type=str, help='cuda device, i.e. 0 or 0,1,2,3 or cpu')
parser.add_argument('--noval', action='store_true', help='only evaluate in final epoch')
parser.add_argument('--eval-interval', default=20, help='evaluate at every interval epochs')
parser.add_argument('--eval-final-only', action='store_true', help='only evaluate at the final epoch')
parser.add_argument('--heavy-eval-range', default=50,
help='evaluating every epoch for last such epochs (can be jointly used with --eval-interval)')
parser.add_argument('--check-images', action='store_true', help='check images when initializing datasets')
parser.add_argument('--check-labels', action='store_true', help='check label files when initializing datasets')
parser.add_argument('--output-dir', default='./runs/train', type=str, help='path to save outputs')
Expand Down
6 changes: 3 additions & 3 deletions yolov6/core/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ def train_in_steps(self):
self.update_optimizer()

def eval_and_save(self):
epoch_sub = self.max_epoch - self.epoch
val_period = 20 if epoch_sub > 100 else 1 # to fasten training time, evaluate in every 20 epochs for the early stage.
is_val_epoch = (not self.args.noval or (epoch_sub == 1)) and (self.epoch % val_period == 0)
remaining_epochs = self.max_epoch - self.epoch
eval_interval = self.args.eval_interval if remaining_epochs > self.args.heavy_eval_range else 1
is_val_epoch = (not self.args.eval_final_only or (remaining_epochs == 1)) and (self.epoch % eval_interval == 0)
if self.main_process:
self.ema.update_attr(self.model, include=['nc', 'names', 'stride']) # update attributes for ema model
if is_val_epoch:
Expand Down
2 changes: 1 addition & 1 deletion yolov6/core/evaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def predict_model(self, model, dataloader, task):
def eval_model(self, pred_results, model, dataloader, task):
'''Evaluate models
For task speed, this function only evaluates the speed of model and outputs inference time.
For task val, this function evalutates the speed and mAP by pycocotools, and returns
For task val, this function evaluates the speed and mAP by pycocotools, and returns
inference time and mAP value.
'''
LOGGER.info(f'\nEvaluating speed.')
Expand Down
2 changes: 1 addition & 1 deletion yolov6/layers/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class RepVGGBlock(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=3,
stride=1, padding=1, dilation=1, groups=1, padding_mode='zeros', deploy=False, use_se=False):
super(RepVGGBlock, self).__init__()
""" Intialization of the class.
""" Initialization of the class.
Args:
in_channels (int): Number of channels in the input image
out_channels (int): Number of channels produced by the convolution
Expand Down
2 changes: 1 addition & 1 deletion yolov6/utils/figure_iou.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, box_format='xywh', iou_type='ciou', reduction='none', eps=1e-
box_format: (string), must be one of 'xywh' or 'xyxy'.
iou_type: (string), can be one of 'ciou', 'diou', 'giou' or 'siou'
reduction: (string), specifies the reduction to apply to the output, must be one of 'none', 'mean','sum'.
eps: (float), a value to avoid devide by zero error.
eps: (float), a value to avoid divide by zero error.
"""
self.box_format = box_format
self.iou_type = iou_type.lower()
Expand Down

0 comments on commit 1668503

Please sign in to comment.