当前位置:网站首页>Learning Experience Sharing Seven: YOLOv5 Code Chinese Comments
Learning Experience Sharing Seven: YOLOv5 Code Chinese Comments
2022-08-02 11:31:00 【Artificial Intelligence Algorithm Research Institute】
There are many friends who are learning YOLOv5 recently. In order to make it easier for everyone to better understand the source code, YOLOv5 is annotated in Chinese.Friends who need it can follow my WeChat official account:Artificial Intelligence AIAlgorithm Engineer after private message.
The following is a partial code example.
def main(opt):# 1, logging and wandb initialization# log initializationset_logging(RANK)if RANK in [-1, 0]:# can output all training opt parametersprint(colorstr('train: ') + ', '.join(f'{k}={v}' for k, v in vars(opt).items()))# This code is used to check if the code version is the latestcheck_git_status()# Used to check whether the required packages in requirements.txt are all satisfiedcheck_requirements(exclude=['thop'])# wandb logging initializationwandb_run = check_wandb_resume(opt)# 2. Determine whether to use the breakpoint to resume the training and load the parametersif opt.resume and not wandb_run:# Use breakpoints to continue training to read relevant parameters from last.pt# If resume is str, it will indicate that the path address of the model is passed in# If resume is True, use the get_lastest_run() function to find the latest weight file last.pt in the folder where runs areckpt = opt.resume if isinstance(opt.resume, str) else get_latest_run()assert os.path.isfile(ckpt), 'ERROR: --resume checkpoint does not exist' # check# The relevant opt parameters should also be replaced with the opt parameters in last.ptwith open(Path(ckpt).parent.parent / 'opt.yaml') as f:opt = argparse.Namespace(**yaml.safe_load(f)) # replaceopt.cfg, opt.weights, opt.resume = '', ckpt, True # reinstatelogger.info('Resuming training from %s' % ckpt) # printelse:# You can read relevant parameters from the file without using breakpoints to continue training# opt.hyp = opt.hyp or ('hyp.finetune.yaml' if opt.weights else 'hyp.scratch.yaml')opt.data, opt.cfg, opt.hyp = check_file(opt.data), check_file(opt.cfg), check_file(opt.hyp) # check filesIf you think it is helpful to everyone, please like, collect, and follow. I will continue to provide reference for everyone to do experiments.Any questions are welcome to private message me.
If you need more program information and answer questions, please pay attention - WeChat public account: Artificial intelligence AIAlgorithm Engineer
边栏推荐
- 如何在技术上来保证LED显示屏质量?
- 运行yum报错Error: Cannot retrieve metalink for reposit
- 博云入选Gartner中国DevOps代表厂商
- 阿里云数据存储生态计划发布,助力伙伴数据创新
- 【2022 小目标检测综述】Towards Large-Scale Small Object Detection: Survey and Benchmarks
- 翁恺C语言程序设计网课笔记合集
- 【kali-信息收集】(1.8)ARP侦查工具_Netdiscover
- MP的几种查询方式
- Multithreading (Basic) - 40,000 word summary
- find查找多类型结尾文件
猜你喜欢

字母交换--字符串dp

爆款视频怎么做?这里或许有答案!

2022年8月初济南某外包公司全栈开发面试题整理
[email protected] This version of tar is no longer supported, and will not receive"/>npm WARN deprecated [email protected] This version of tar is no longer supported, and will not receive

10份重磅报告 — 展望中国数字经济未来

SQL 经典50题(题目+解答)(1)

19、商品微服务-srv层实现

Shell编程之条件语句

MapStruct

OLED的HAL库代码介绍及使用(stm32f1/I2C/HAL库版/100%一次点亮)
随机推荐
图形处理单元(GPU)的演进
ssm网页访问数据库数据报错
运行yum报错Error: Cannot retrieve metalink for reposit
SQL 数据更新
使用无界队列的线程池会导致内存飙升吗?
idea常用插件
【Acunetix-忘记密码】
Deep Learning 100 Examples - Convolutional Neural Network (CNN) for mnist handwritten digit recognition
【kali-信息收集】(1.9)Metasploit+搜索引擎工具Shodan
Oracle超全SQL,细节狂魔
Camera Hal OEM模块 ---- cmr_snapshot.c
【2022 小目标检测综述】Towards Large-Scale Small Object Detection: Survey and Benchmarks
突破边界,华为存储的破壁之旅
注意力机制
QT笔记——QT类反射机制简单学习
MySql模糊查询大全
npm run serve启动报错npm ERR Missing script “serve“
深度学习100例 —— 卷积神经网络(CNN)实现mnist手写数字识别
FinClip | 来了, 2022 年 7 月更新大盘点
Several reasons why applet plugins benefit developers