Closed chirstinaFan closed 6 years ago
For datasets used, there is always exactly 5 captions per image. These are made into 5N pairs where every 5 consecutive pair has the same image.
Thank you very much. IN our datasets,there is always exactly 1 captions per image.should I just devide 1?
Sure. Make sure you change all other places where this assumption is used. Search for the number 5 in the code.
OK, thanks for your help.
def t2i(images, captions, npts=None, measure='cosine', return_ranks=False): """ Text->Images (Image Search) Images: (5N, K) matrix of images Captions: (5N, K) matrix of captions """ if npts is None: npts = int(images.shape[0] / 5) ims = numpy.array([images[i] for i in range(0, len(images), 5)])
why divide 5?