Coder Social home page Coder Social logo

wangrongsheng / bestyolo Goto Github PK

View Code? Open in Web Editor NEW
202.0 4.0 33.0 55.04 MB

🌟Change the world, it will become a better place. | 以科研和竞赛为导向的最好的YOLO实践框架!

License: GNU General Public License v3.0

Python 98.00% Jupyter Notebook 1.09% Shell 0.07% CSS 0.01% JavaScript 0.07% HTML 0.01% Dockerfile 0.01% CMake 0.01% C++ 0.31% Cuda 0.43%
yolov5 artificial-intelligence deep-learning object-detection resnet pyqt5 tfjs small-object-detection

bestyolo's Introduction

BestYOLO是一个以科研和竞赛为导向的最好的YOLO实践框架!

目前BestYOLO是一个完全基于YOLOv5 v7.0 进行改进的开源库,该库将始终秉持以落地应用为导向,以轻便化使用为宗旨,简化各种模块的改进。目前已经集成了基于torchvision.models 模型为Backbone的YOLOv5目标检测算法,同时也将逐渐开源更多YOLOv5应用程序。

🌟改进

所有Backbone都支持开启预训练权重,只需添加pretrained=True到每个common.py 的模型中。torchvision.models中的预训练权重都是基于ImageNet-1K数据集训练的!

models layers parameters model size(MB)
yolov5n 214 1766623 3.9
MobileNetV3s 313 2137311 4.7
efficientnet_b0 443 6241531 13.0
RegNety400 450 5000191 10.5
ResNet18 177 12352447 25.1
ResNet34 223 22460607 45.3
ResNet50 258 27560895 55.7
EfficientNetV2_s 820 22419151 45.8
efficientnet_b1 539 6595615 13.8
mobilenet_v2 320 4455295 9.4
wide_resnet50_2 258 70887103 142.3
vgg11_bn 140 10442879 21.9
convnext_tiny 308 29310175 59.0

.yaml配置文件中的depth_multiplewidth_multiple可以同时设置为1试试,说不定会有不错的效果。

SPP是空间金字塔池化,作用是一个实现一个自适应尺寸的输出。(传统的池化层如最大池化、平均池化的输出大小是和输入大小挂钩的,但是我们最后做全连接层实现分类的时候需要指定全连接的输入,所以我们需要一种方法让神经网络在某层得到一个固定维度的输出,而且这种方法最好不是resize(resize会失真),由此SPP应运而生,其最早是何凯明提出,应用于RCNN模型)。当今的SPP在faster-rcnn上已经发展为今天的Multi-Scale-ROI-Align,而在Yolo上发展为SPPF。

models layers parameters
yolov5n(SPPF) 214 1766623
yolov5n-SPP 217 1766623
yolov5n-SimSPPF 216 1766623
yolov5n-ASPP 214 3831775
yolov5n-RFB 251 1932287
yolov5n-SPPCSPC 232 3375071
yolov5n-SPPCSPC_group 232 2047967
yolov5n-SimCSPSPPF 229 3375071
models layers parameters
yolov5n 214 1766623
yolov5n-FPN-AC 188 1858399
yolov5n-PAN-AC 186 1642591
yolov5n-FPN+PAN-AC 160 1734367
yolov5n-FPN-AS 204 2106847
yolov5n-PAN-AS 194 1891039
yolov5n-FPN+PAN-AS 184 2231263

训练不要使用Soft-NMS,耗时太久,请在val阶段开启,适用于小目标重叠数据。

💻应用

🌈技巧


  1. 小目标检测大杀器:yolov5-pipsahi
  2. 小目标检测大杀器:填鸭式数据增强

应注意:训练和推理数据保持相同的数据形式,即不能通过非切图训练,根据切图推理!

  1. 一个不成熟的优化器选择参考:

📋参考

💫工作

🔔引用

@article{2023bestyolo,
  title={{BestYOLO}: Making research and competition easier},
  author={Rongsheng Wang},
  repo={github https://github.com/WangRongsheng/BestYOLO},
  year={2023}
}

🚀贡献

Forkers repo roster for @WangRongsheng/BestYOLO

Stargazers repo roster for @WangRongsheng/BestYOLO

Star History Chart

bestyolo's People

Contributors

uppez avatar wangrongsheng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bestyolo's Issues

about aux loss

为什么aux loss中取的输入为9.13.17 而不是,17,20,23呢

AttributeError: 'EfficientNet' object has no attribute 'yaml'

@WangRongsheng 你好, I used to your repo and i want to perform a training using my own dataset. I want to use efficientNet instead of darknet in my backbone network. Within the train.py file, I replaced my weights with efficientnet_b0.pt instead of yolov5n.pt. The error mentioned in the title appears. I would be happy if you

runfile('D:/BestYOLO/BestYOLO-main/train.py', wdir='D:/BestYOLO/BestYOLO-main')
Reloaded modules: models, utils, utils.downloads, utils.metrics, utils.general, utils.augmentations, utils.torch_utils, utils.dataloaders, utils.segment, utils.segment.general, utils.plots, models.common, classify.val, models.experimental, utils.autoanchor, models.yolo, utils.loggers.clearml, utils.loggers.clearml.clearml_utils, utils.loggers.wandb, utils.loggers.wandb.wandb_utils, utils.loggers
train: weights=efficientnet_b0.pt, cfg=, data=data\coco128.yaml, hyp=data\hyps\hyp.scratch-low.yaml, epochs=2, batch_size=2, imgsz=640, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, noplots=False, evolve=None, bucket=, cache=None, image_weights=False, device=, multi_scale=False, single_cls=False, optimizer=SGD, sync_bn=False, workers=8, project=runs\train, name=exp, exist_ok=False, quad=False, cos_lr=False, label_smoothing=0.0, patience=100, freeze=[0], save_period=-1, seed=3407, local_rank=-1, loss_OTA=False, entity=None, upload_dataset=False, bbox_interval=-1, artifact_alias=latest
YOLOv5 2023-10-30 Python-3.10.13 torch-2.1.0+cpu CPU

hyperparameters: lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.5, cls_pw=1.0, obj=1.0, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0
ClearML: run 'pip install clearml' to automatically track, visualize and remotely train YOLOv5 in ClearML
Comet: run 'pip install comet_ml' to automatically track and visualize YOLOv5 runs in Comet
TensorBoard: Start with 'tensorboard --logdir runs\train', view at http://localhost:6006/
github: skipping check (not a git repository), for updates see https://github.com/ultralytics/yolov5
Traceback (most recent call last):

File ~.conda\envs\thesis_two\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)

File d:\bestyolo\bestyolo-main\train.py:640
main(opt)

File d:\bestyolo\bestyolo-main\train.py:534 in main
train(opt.hyp, opt, device, callbacks)

File d:\bestyolo\bestyolo-main\train.py:125 in train
model = Model(cfg or ckpt['model'].yaml, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create

File ~.conda\envs\thesis_two\lib\site-packages\torch\nn\modules\module.py:1695 in getattr
raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")

AttributeError: 'EfficientNet' object has no attribute 'yaml'

[bug]list index out of range

Traceback (most recent call last): File "F:\Deep_learning\BestYOLO\train_AuxOTA.py", line 641, in <module> main(opt) File "F:\Deep_learning\BestYOLO\train_AuxOTA.py", line 530, in main train(opt.hyp, opt, device, callbacks) File "F:\Deep_learning\BestYOLO\train_AuxOTA.py", line 312, in train loss, loss_items = compute_loss_ota(pred, targets.to(device), imgs) # loss scaled by batch_size File "F:\Deep_learning\BestYOLO\utils\loss_AuxOTA.py", line 276, in __call__ pi_aux = p[i+self.nl] IndexError: list index out of range

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.