understand_videobased_reid
understand_videobased_reid copied to clipboard
关于video_reid代码的注释,原始代码地址
Hi I am trying to understand different methodologies and architecture to train video reid datasets. My question is that can you please tell me what are the best hyperparameters combination,...
``` # Compute pairwise distance, replace by the official when merged dist = torch.pow(inputs, 2).sum(dim=1, keepdim=True).expand(n, n) dist = dist + dist.t() dist.addmm_(1, -2, inputs, inputs.t()) dist = dist.clamp(min=1e-12).sqrt() #...
`` elif self.sample == 'dense': """ Sample all frames in a video into a list of clips, each clip contains seq_len frames, batch_size needs to be set to 1. 将视频中的所有帧采样到一系列的clips,每个clip包含seq_len个帧,批次大小需要设置为1...
`# compute average precision 计算平均精度 # reference: https://en.wikipedia.org/wiki/Evaluation_measures_(information_retrieval)#Average_precision num_rel = orig_cmc.sum() # 所有元素求和 tmp_cmc = orig_cmc.cumsum() # 累加和,不改变数据形状 tmp_cmc = [x / (i+1.) for i, x in enumerate(tmp_cmc)] # enumerate()...