megvii-research / video_analyst

A series of basic algorithms that are useful for video understanding, including Single Object Tracking (SOT), Video Object Segmentation (VOS) and so on.
MIT License
828 stars 176 forks source link

关于NR_IMAGE_PER EPOCH以及max_diff参数的设置 #235

Open phjzlh opened 1 year ago

phjzlh commented 1 year ago

作者你好,请问NR_IMAGE_PER EPOCH训练图像对的数量应该随数据集怎样取值?以及max_diff这个参数的具体意义是图像对的最大相对距离吗?但是以下实现的代码并不是此意思,是否代码有误? def _sample_pair_idx_pair_within_max_diff(self, L, max_diff): r""" Draw a pair of index in range(L) within a given maximum difference Arguments

    L: int
        difference
    max_diff: int
        difference
    """
    rng = self._state["rng"]
    idx1 = rng.choice(L)
    idx2_choices = list(range(idx1-max_diff, L)) + \
                list(range(L+1, idx1+max_diff+1))
    idx2_choices = list(set(idx2_choices).intersection(set(range(L))))
    idx2 = rng.choice(idx2_choices)
    return int(idx1), int(idx2)
MARMOTatZJU commented 1 year ago

数据集的图片数目越大,NR_IMAGE_PER_EPOCH 也应该适当增加。

max_diff 确实表示 idx1idx2 的最大距离。

phjzlh commented 1 year ago

数据集的图片数目越大,NR_IMAGE_PER_EPOCH 也应该适当增加。

max_diff 确实表示 idx1idx2 的最大距离。

感谢您的回答!