Skip to content

Commit

Permalink
update message on missing dataset and add postfix to extracted zip fo…
Browse files Browse the repository at this point in the history
…lder
  • Loading branch information
Yuhe Jin committed Feb 18, 2022
1 parent f9bd18a commit da05d98
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions submission_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def validate_submission_files(sub_path,benchmark_repo_path, datasets, raw_data_p
# check if dataset folder exists
sub_dataset_path = os.path.join(sub_path,dataset)
if not os.path.isdir(sub_dataset_path):
logger.add_new_log('Submission does not contain {} dataset.'.format(dataset))
logger.add_new_log('Submission does not contain {} dataset (ignore this mesage if you do not intend to evaluate on this dataset).'.format(dataset))
continue
# read seqs from json
seqs = load_json(os.path.join(benchmark_repo_path,'json/data/{}_test.json'.format(dataset)))
Expand Down Expand Up @@ -213,18 +213,19 @@ def main():

# Unzip folder
submission_name = os.path.basename(config.submit_file_path).split('.')[0]
extracted_folder = '{}_extracted'.format(submission_name)
folder_path = os.path.dirname(config.submit_file_path)
os.system('unzip {} -d {}'.format(config.submit_file_path,os.path.join(folder_path,submission_name)))
os.system('unzip {} -d {}'.format(config.submit_file_path,os.path.join(folder_path,extracted_folder)))

# Init Logger
logger = MonitorLogger(folder_path, submission_name)

# Validate Submission files
validate_submission_files(os.path.join(folder_path,submission_name), config.benchmark_repo_path, config.datasets, config.raw_data_path,logger)
validate_submission_files(os.path.join(folder_path,extracted_folder), config.benchmark_repo_path, config.datasets, config.raw_data_path,logger)


# Validate Json
validate_json(os.path.join(folder_path,submission_name,'config.json'), config.datasets, logger)
validate_json(os.path.join(folder_path,extracted_folder,'config.json'), config.datasets, logger)

if logger.is_empty():
logger.add_new_log('Submission is in proper format, please submit to IMW 2021 website.')
Expand Down

0 comments on commit da05d98

Please sign in to comment.