are fed to the TH to produce a set of $N_e$-dimensional embedding vectors. As a first step, the TH applies “mask-pooling” (described in the section below) to the input spatial features, obtaining 256-dimensional vector features. This operation is followed by a fully connected layer with 128 channels and synchronized InPlace-ABN. Similarly to masks and bounding boxes in the RSH, embedding vectors are predicted in a class-specific manner by a final fully connected layer with $N_e\times C$ outputs, where $C$ is the number of classes, followed by L2-normalization to constrain the vectors on the unit hyper-sphere. The output vectors are learned such that instances of the same object in a sequence are mapped close to each other in the embedding space, while instances of other objects are mapped far away. This is achieved by minimizing a batch hard triplet loss, described in Sec. \[sec:training\].

#### Mask-pooling.

ROI Align features include both foreground and background information, but, in general, only the foreground is actually useful for recognizing an object across frames. In our setting, by doing instance segmentation together with tracking, we have a source of information readily available to discriminate between the object and its background. This can be exploited in 