def _build_synset_lookup(imagenet_metadata_file):
 lines = tf.gfile.FastGFile(imagenet_metadata_file, 'r').readlines()
 synset_to_human = {}
 for l in lines:
  if l:
   parts = l.strip().split(' DCTB ')
   assert (len(parts) == 2)
   synset = parts[0]
   human = parts[1]
   synset_to_human[synset] = human
 return synset_to_human

def _build_synset_lookup ( imagenet_metadata_file ) : lines = tf . gfile . FastGFile ( imagenet_metadata_file , 'r' ) . readlines ( ) synset_to_human = { } for l in lines : if l : parts = l . strip ( ) . split ( ' DCTB ' ) assert ( len ( parts ) == 2 ) synset = parts [ 0 ] human = parts [ 1 ] synset_to_human [ synset ] = human return synset_to_human
build lookup for synset to human-readable label .