def extract_data(input_dir, output_dir):
 if os.path.isdir(output_dir):
  print ('  Using extracted data at %s.' % output_dir)
  return
 for filename in ('data_object_label_2.zip', 'data_object_image_2.zip', 'devkit_object.zip'):
  filename = os.path.join(input_dir, filename)
  zf = zipfile.ZipFile(filename, 'r')
  print ('Unzipping %s ...' % filename)
  zf.extractall(output_dir)

def extract_data ( input_dir , output_dir ) : if os . path . isdir ( output_dir ) : print ( '  Using extracted data at %s.' % output_dir ) return for filename in ( 'data_object_label_2.zip' , 'data_object_image_2.zip' , 'devkit_object.zip' ) : filename = os . path . join ( input_dir , filename ) zf = zipfile . ZipFile ( filename , 'r' ) print ( 'Unzipping %s ...' % filename ) zf . extractall ( output_dir )
extract the images into a 4d tensor [image index .