defforward_feature_extracter(self, x, l): ''' extract features from the vgg layers and extra net :param x: :param l: :return: the features ''' s = list()
x = self.forward_vgg(x, self.vgg, s) x = self.forward_extras(x, self.extras, s) x = self.forward_selector_stacker1(s, l, self.selector)
return x defforward_vgg(self, x, vgg, sources): for k in range(16): x = vgg[k](x) sources.append(x)
for k in range(16, 23): x = vgg[k](x) sources.append(x)
for k in range(23, 35): x = vgg[k](x) sources.append(x) return x
defforward_extras(self, x, extras, sources): for k, v in enumerate(extras): x = v(x) #x = F.relu(v(x), inplace=True) #done: relu is unnecessary. if k % 6 == 3: #done: should select the output of BatchNormalization (-> k%6==2) sources.append(x) return x
defforward_selector_stacker1(self, sources, labels, selector): ''' :param sources: [B, C, H, W] :param labels: [B, N, 1, 1, 2] :return: the connected feature ''' sources = [ F.relu(net(x), inplace=True) for net, x in zip(selector, sources) ]
res = list() for label_index in range(labels.size(1)): label_res = list() for source_index in range(len(sources)): # [N, B, C, 1, 1] label_res.append( # [B, C, 1, 1] F.grid_sample(sources[source_index], # [B, C, H, W] labels[:, label_index, :] # [B, 1, 1, 2 ).squeeze(2).squeeze(2) ) res.append(torch.cat(label_res, 1))
defget_similarity_uv(self, t, frame_index): res_similarity = [] res_uv = [] for i, f in enumerate(t.f): if len(t.f) == TrackerConfig.max_track_node and i == 0: continue
all_iou = self.recorder.all_iou[frame_index][f] all_similarity = self.recorder.all_similarity[frame_index][f] selected_box_index = t.uv[i, i] if selected_box_index == -1: # cannot find box in f frame. res_similarity += [0] res_uv += [-1] continue
# combine the similarity with the iou selected_similarity = np.copy(all_similarity[selected_box_index, :]) delta_f = frame_index - f if delta_f in TrackerConfig.min_iou_frame_gap: iou_index = TrackerConfig.min_iou_frame_gap.index(delta_f) selected_iou = (all_iou[selected_box_index, :] >= TrackerConfig.min_iou[iou_index]).astype(float) selected_iou = np.append(selected_iou, 1.0) selected_similarity = selected_similarity * selected_iou
if max_index == all_similarity.shape[1] - 1: # new node max_index = -1 res_uv += [int(max_index)] res_similarity += [float(max_value)]
# get the representation box of this frame. res = {} for uv, s in zip(res_uv, res_similarity): # if s # continue if uv notin res: res[uv] = [s] else: res[uv] += [s]
论文标题:How To Train Your Deep Multi-Object Tracker论文作者:Yihong Xu, Aljosa Osep, Yutong Ban, Radu Horaud, Laura Leal-Taixé, Xavier Alameda-Pineda备注信息:ICCV 2019 Tracktor++的作者团队,CVPR 2020论文链接:https://arxiv.org/abs/1906.06618代码链接:https://gitlab.inria.fr/yixu/deepmot
# The linear layer that maps from hidden state space to tag space if biDirenction: # *2 directions * 2 ways concat self.hidden2tag_1 = nn.Linear(hidden_dim * 2, 256) self.hidden2tag_2 = nn.Linear(256, 64) self.hidden2tag_3 = nn.Linear(64, target_size) else: # * 2 ways concat self.hidden2tag_1 = nn.Linear(hidden_dim, target_size)
[1] Sun S, Akhtar N, Song H, et al. Deep affinity network for multiple object tracking[J]. IEEE transactions on pattern analysis and machine intelligence, 2019.
[2] Xu Y, Ban Y, Alameda-Pineda X, et al. DeepMOT: A Differentiable Framework for Training Multiple Object Trackers[J]. arXiv preprint arXiv:1906.06618, 2019.
[3] Bergmann P, Meinhardt T, Leal-Taixe L. Tracking without bells and whistles[C]. in: Proceedings of the IEEE International Conference on Computer Vision. 2019. 941-951.
[4] Zhu J, Yang H, Liu N, et al. Online multi-object tracking with dual matching attention networks[C]. in: Proceedings of the European Conference on Computer Vision (ECCV). 2018. 366-382.
[5] Chu P, Ling H. Famnet: Joint learning of feature, affinity and multi-dimensional assignment for online multiple object tracking[C]. in: Proceedings of the IEEE International Conference on Computer Vision. 2019. 6172-6181.
[6]X. Shi, H. Ling, Y. Pang, W. Hu, P. Chu, and J. Xing. Rank-1 tensor approximation for high-order association in multi-target tracking. IJCV, 2019.
[7] Brasó G, Leal-Taixé L. Learning a Neural Solver for Multiple Object Tracking[J]. arXiv preprint arXiv:1912.07515, 2019.