preprocess_6.py 518 B

12345678910111213141516171819
  1. def generate_file_list():
  2. # if os.pa
  3. file_list = glob.glob('%s/*.h5' %(FLAGS.hdf5_dir,))
  4. file_list.sort()
  5. with open(FLAGS.hdf5_list_path, 'w') as _file:
  6. for _file_path in file_list:
  7. _file.write(_file_path)
  8. _file.write('\n')
  9. with open(FLAGS.hdf5_train_list_path, 'w') as _file:
  10. for _file_path in file_list[8:]:
  11. _file.write(_file_path)
  12. _file.write('\n')
  13. with open(FLAGS.hdf5_validation_list_path, 'w') as _file:
  14. for _file_path in file_list[0:8]:
  15. _file.write(_file_path)
  16. _file.write('\n')