1
0
mirror of https://github.com/gryf/coach.git synced 2025-12-17 19:20:19 +01:00

bug fixes in the CARLA dataset downloader and extractor

This commit is contained in:
itaicaspi-intel
2018-09-16 14:27:22 +03:00
parent 23a9f00e28
commit 6797824892
2 changed files with 7 additions and 3 deletions

1
.gitignore vendored
View File

@@ -20,3 +20,4 @@ rl_coach.egg*
contrib
test_log_*
dist
datasets

View File

@@ -29,11 +29,11 @@ from rl_coach.logger import screen
def maybe_download(dataset_root):
if not dataset_root or not os.path.exists(dataset_root):
if not dataset_root or not os.path.exists(os.path.join(dataset_root, "AgentHuman")):
screen.log_title("Downloading the CARLA dataset. This might take a while.")
google_drive_download_id = "1hloAeyamYn-H6MfV1dRtY1gJPhkR55sY"
filename_to_save = "datasets/CARLA_dataset.tar.gz"
filename_to_save = "datasets/CORL2017ImitationLearningData.tar.gz"
download_command = 'wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=' \
'$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies ' \
'--no-check-certificate \"https://docs.google.com/uc?export=download&id={}\" -O- | ' \
@@ -44,16 +44,19 @@ def maybe_download(dataset_root):
start_shell_command_and_wait(download_command)
screen.log_title("Unzipping the dataset")
unzip_command = 'tar -xzf {}'.format(filename_to_save)
unzip_command = 'tar -xzf {} --checkpoint=.10000'.format(filename_to_save)
if dataset_root is not None:
unzip_command += " -C {}".format(dataset_root)
if not os.path.exists(dataset_root):
os.makedirs(dataset_root)
start_shell_command_and_wait(unzip_command)
def create_dataset(dataset_root, output_path):
maybe_download(dataset_root)
dataset_root = os.path.join(dataset_root, 'AgentHuman')
train_set_root = os.path.join(dataset_root, 'SeqTrain')
validation_set_root = os.path.join(dataset_root, 'SeqVal')