ego_to_json_3.py 453 B

123456789101112
  1. def json_train_val():
  2. os.makedirs(os.path.join(ROOT_DIR, "tmp"))
  3. tmp_dir = os.path.join(ROOT_DIR, "tmp")
  4. os.makedirs(os.path.join(tmp_dir, "images"))
  5. img_dir = os.path.join(tmp_dir, "images")
  6. for dir_name in os.listdir(ROOT_DIR):
  7. if not (dir_name == "tmp" or dir_name == "test"):
  8. shutil.move(os.path.join(ROOT_DIR, dir_name), os.path.join(ROOT_DIR, tmp_dir, dir_name))
  9. create_annotations(tmp_dir, img_dir)