gallery_path =['101_ObjectCategories/allimg/'+os.path.basename(i)for i in gallery_lst]
query_lst =['101_ObjectCategories/allimg/'+os.path.basename(i)for i in query_lst]
print(len(query_lst))print(len(gallery_lst))
if os.path.exists(path_file):
os.remove(path_file)
withopen(path_file,'w')as f:for i in gallery_path:
f.write('{0} {1}\n'.format(i,1))for index,i inenumerate(query_lst):if index !=len(query_lst)-1:
f.write('{0} {1}\n'.format(i,0))else:
f.write('{0} {1}'.format(i,0))