annot['index'] += [idx] annot['person'] += [person] imgname = np.zeros(16) refname = str(imgnameRef[idx][0][0][0][0]) for i in range(len(refname)): imgname[i] = ord(refname[i]) annot['imgname'] += [imgname] annot['center'] += [c] annot['scale'] += [s] annot['multi'] += [multiRef[idx]] if mpii.istrain(idx) == True: # Part annotations and visibility coords = np.zeros((16,2)) vis = np.zeros(16) for part in xrange(16): coords[part],vis[part] = mpii.partinfo(idx,person,part) annot['part'] += [coords] annot['visible'] += [vis] annot['normalize'] += [mpii.normalization(idx,person)] annot['torsoangle'] += [mpii.torsoangle(idx,person)] annot['istrain'] += [1] else: annot['part'] += [-np.ones((16,2))] annot['visible'] += [np.zeros(16)] annot['normalize'] += [1] annot['torsoangle'] += [0] if trainRef[idx] == 0: # Test image annot['istrain'] += [0] else: # Training image (something missing in annot) annot['istrain'] += [2]