yolov5详解
MingX.Zhao
SJTU Master
展开
-
train.py部分
plots = not evolve # create plots cuda = device.type != 'cpu' init_seeds(1 + RANK) with torch_distributed_zero_first(LOCAL_RANK): data_dict = data_dict or check_dataset(data) # check if None 这里的check_dataset会把train,val生成为p...原创 2022-01-01 21:42:08 · 435 阅读 · 0 评论 -
utils.general详解1
class WorkingDirectory(contextlib.ContextDecorator): # 改变函数的工作路径 # Usage: @WorkingDirectory(dir) decorator or 'with WorkingDirectory(dir):' context manager def __init__(self, new_dir): self.dir = new_dir # new dir self.cwd = Path.c原创 2022-01-01 20:10:04 · 1945 阅读 · 0 评论 -
ModelEMA——滑动平均
class ModelEMA: """ Model Exponential Moving Average from https://github.com/rwightman/pytorch-image-models Keep a moving average of everything in the model state_dict (parameters and buffers). This is intended to allow functionality like h原创 2022-01-01 17:16:42 · 4505 阅读 · 0 评论 -
callbacks&loggers
if RANK in [-1, 0]: loggers = Loggers(save_dir, weights, opt, hyp, LOGGER) # loggers instance if loggers.wandb: data_dict = loggers.wandb.data_dict if resume: weights, epochs, hyp = opt.weights, opt.原创 2022-01-01 16:20:05 · 1387 阅读 · 1 评论 -
yolov5中的targets和imgs
imgs.shape :torch.Size([4, 3, 640, 640])targets.shape:torch.Size([9, 6])targets:tensor([[0.00000, 0.00000, 0.33555, 0.46680, 0.03516, 0.02734],[1.00000, 0.00000, 0.46797, 0.54727, 0.03594, 0.02891],[2.00000, 0.00000, 0.64336, 0.55273, 0.06641, 0.02734原创 2022-01-01 16:04:25 · 1428 阅读 · 0 评论