process_data.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:behavioral-cloning 作者: BillZito 项目源码 文件源码
def save_images(img_dir, dest_file):
  img_list = os.listdir(img_dir)
  img_combo = []

  print('starting to save ' + str(len(img_list)) + ' images')

  count = 0
  for img_name in img_list:
    # can change this line to img_name.startswith('center') for center imgs
    if not img_name.startswith('.'):

      if count % 500 == 0:
        print('count is', count)

      img = misc.imread(img_dir + '/' + img_name)
      img_combo.append(img)
      count += 1

  #cast to numpy array and save to file
  all_images = np.array(img_combo)
  print('images shape', all_images.shape)
  np.save(dest_file, all_images)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号