ZhangXu0963 / NPC

The code of the paper "Negative Pre-aware for Noisy Cross-modal Matching" in AAAI 2024.
12 stars 2 forks source link

Memory Bank存储库的构建 #6

Closed chcling closed 2 months ago

chcling commented 2 months ago

你好作者,感谢你们对于图文检索领域出色的贡献。 我在浏览代码后对于您的工作中关于Memory Bank的构建产生了疑问。

请问Memory Bank应该是在main_NPC.py中,设置Dataloder前构建的吗?因为我在data.py文件中的LoadDataset类中看到如果使用NPC运行代码,会加载如下代码

# get memory bank
self.mbank_i = np.load(os.path.join(dataset_root, 'annotations/memory_bank/{}_mbank_img_idx.npy' .format(self.noise_ratio)), allow_pickle=True).item()
self.mbank_t = np.load(os.path.join(dataset_root, 'annotations/memory_bank/{}_mbank_txt_idx.npy' .format(self.noise_ratio)), allow_pickle=True).item()

但是我在main_NPC.py中并没有发现有关get_mbank()的调用,如果需要在其他数据集中构建这样的一个Memory Bank文件,应该在代码中哪里做修改?

期待您的回复。

ZhangXu0963 commented 2 months ago

为了方便读者,我们提供了在实验中用到的memory bank数据,详见${noise_ratio}_mbank_img_idx.npy${noise_ratio}_mbank_txt_idx.npy,可以从提供的 Download link中下载。 如果需要构建新的memory bank,可以直接调用提供的get_memorybank.py。这可以作为一个独立的函数用于您需要的地方。