diff --git a/CPU_Container.dockerfile b/CPU_Container.dockerfile index 48705ac4d..fa71844ce 100644 --- a/CPU_Container.dockerfile +++ b/CPU_Container.dockerfile @@ -9,7 +9,7 @@ ARG DEBIAN_FRONTEND=noninteractive ENV TZ=America/New_York # --build-arg mcsversion=0.0.x to override default in docker build command -ARG mcsversion=0.4.5 +ARG mcsversion=0.4.6 ARG mcs_library_version=master WORKDIR /mcs diff --git a/Dockerfile b/Dockerfile index b71f1c927..46e787326 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES},display # ENV LANG C.UTF-8 # --build-arg mcsversion=0.0.x to override default in docker build command -ARG mcsversion=0.4.5 +ARG mcsversion=0.4.6 ARG mcs_library_version=master WORKDIR /mcs diff --git a/README.md b/README.md index a1b8187b3..8156a5364 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # MCS Python Package -Python interface for interacting with MCS AI2Thor environment and running scenes. The latest release of the MCS Python library is `0.4.5`. You can find the latest documentation [here](https://nextcenturycorporation.github.io/MCS). +Python interface for interacting with MCS AI2Thor environment and running scenes. The latest release of the MCS Python library is `0.4.6`. You can find the latest documentation [here](https://nextcenturycorporation.github.io/MCS). - [Quickstart Installation](#quickstart-installation) - [Usage](#usage) diff --git a/docs/source/install.rst b/docs/source/install.rst index 50ae8f7e3..c9b413fc9 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -2,8 +2,8 @@ Installation and Setup ======================= -.. _Download and unzip the Mac ZIP: https://github.com/NextCenturyCorporation/MCS/releases/download/0.4.5/MCS-AI2-THOR-Unity-App-v0.4.5-mac.zip -.. _Download and unzip the Linux ZIP: https://github.com/NextCenturyCorporation/MCS/releases/download/0.4.5/MCS-AI2-THOR-Unity-App-v0.4.5-linux.zip +.. _Download and unzip the Mac ZIP: https://github.com/NextCenturyCorporation/MCS/releases/download/0.4.6/MCS-AI2-THOR-Unity-App-v0.4.6-mac.zip +.. _Download and unzip the Linux ZIP: https://github.com/NextCenturyCorporation/MCS/releases/download/0.4.6/MCS-AI2-THOR-Unity-App-v0.4.6-linux.zip Virtual Environments ------------------------ diff --git a/machine_common_sense/_version.py b/machine_common_sense/_version.py index 68eb9b688..ab45471df 100644 --- a/machine_common_sense/_version.py +++ b/machine_common_sense/_version.py @@ -1 +1 @@ -__version__ = '0.4.5' +__version__ = '0.4.6' diff --git a/machine_common_sense/scripts/extract_ground_truth_from_debug_files.py b/machine_common_sense/scripts/extract_ground_truth_from_debug_files.py new file mode 100644 index 000000000..94808feee --- /dev/null +++ b/machine_common_sense/scripts/extract_ground_truth_from_debug_files.py @@ -0,0 +1,37 @@ +import argparse +import glob +import json + + +def main(debug_scene_folder: str, output_file_name: str): + json_file_list = glob.glob(debug_scene_folder + '*_debug.json') + json_file_list = sorted(json_file_list) + print(f'Found {len(json_file_list)} debug files in {debug_scene_folder}') + all_ground_truth = {} + for json_file_name in json_file_list: + with open(json_file_name) as json_file: + data = json.load(json_file) + scene_name = data['name'] + ground_truth = data['goal']['answer']['choice'] + all_ground_truth[scene_name] = ground_truth + print(f'Saving {len(all_ground_truth.keys())} rows to {output_file_name}') + with open(output_file_name, 'w') as output_file: + output_file.write('scene_name,ground_truth\n') + for scene_name, ground_truth in all_ground_truth.items(): + output_file.write(f'{scene_name},{ground_truth}\n') + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description=('Extract Ground Truth')) + parser.add_argument( + 'debug_scene_folder', + type=str, + help='Folder containing the MCS scene JSON debug files' + ) + parser.add_argument( + 'output_file_name', + type=str, + help='Name of the output CSV file' + ) + args = parser.parse_args() + main(args.debug_scene_folder, args.output_file_name) diff --git a/machine_common_sense/scripts/run_action_file.py b/machine_common_sense/scripts/run_action_file.py index 46d0ba48a..b1b217b98 100644 --- a/machine_common_sense/scripts/run_action_file.py +++ b/machine_common_sense/scripts/run_action_file.py @@ -1,6 +1,6 @@ -import machine_common_sense as mcs +from runner_script import SingleFileRunnerScript -from .runner_script import SingleFileRunnerScript +import machine_common_sense as mcs action_list_from_file = [] diff --git a/machine_common_sense/scripts/run_interactive_scenes_pass.py b/machine_common_sense/scripts/run_interactive_scenes_pass.py new file mode 100644 index 000000000..1e75428cf --- /dev/null +++ b/machine_common_sense/scripts/run_interactive_scenes_pass.py @@ -0,0 +1,13 @@ +from runner_script import MultipleFileRunnerScript + + +def action_callback(scene_data, step_metadata, runner_script): + return 'Pass', {} + + +def main(): + MultipleFileRunnerScript('Interactive Scenes - Pass', action_callback) + + +if __name__ == "__main__": + main() diff --git a/machine_common_sense/scripts/run_interactive_scenes.py b/machine_common_sense/scripts/run_interactive_scenes_rotate.py similarity index 51% rename from machine_common_sense/scripts/run_interactive_scenes.py rename to machine_common_sense/scripts/run_interactive_scenes_rotate.py index f5b4f9dab..ea5594b74 100644 --- a/machine_common_sense/scripts/run_interactive_scenes.py +++ b/machine_common_sense/scripts/run_interactive_scenes_rotate.py @@ -1,14 +1,14 @@ -from .runner_script import MultipleFileRunnerScript +from runner_script import MultipleFileRunnerScript def action_callback(scene_data, step_metadata, runner_script): - if step_metadata.step_number <= 36: + if step_metadata.step_number < 36: return 'RotateRight', {} return None, None def main(): - MultipleFileRunnerScript('Interactive Scenes', action_callback) + MultipleFileRunnerScript('Interactive Scenes - Rotate', action_callback) if __name__ == "__main__": diff --git a/machine_common_sense/scripts/run_just_pass.py b/machine_common_sense/scripts/run_just_pass.py index 09f4215fa..d67d8b95f 100644 --- a/machine_common_sense/scripts/run_just_pass.py +++ b/machine_common_sense/scripts/run_just_pass.py @@ -1,4 +1,4 @@ -from .runner_script import SingleFileRunnerScript +from runner_script import SingleFileRunnerScript def action_callback(scene_data, step_metadata, runner_script): diff --git a/machine_common_sense/scripts/run_just_rotate.py b/machine_common_sense/scripts/run_just_rotate.py index a92006a1f..35208386e 100644 --- a/machine_common_sense/scripts/run_just_rotate.py +++ b/machine_common_sense/scripts/run_just_rotate.py @@ -1,4 +1,4 @@ -from .runner_script import SingleFileRunnerScript +from runner_script import SingleFileRunnerScript def action_callback(scene_data, step_metadata, runner_script): diff --git a/machine_common_sense/scripts/run_last_action.py b/machine_common_sense/scripts/run_last_action.py index d8a1fc101..3f65bec78 100644 --- a/machine_common_sense/scripts/run_last_action.py +++ b/machine_common_sense/scripts/run_last_action.py @@ -1,4 +1,4 @@ -from .runner_script import SingleFileRunnerScript +from runner_script import SingleFileRunnerScript def action_callback(scene_data, step_metadata, runner_script): diff --git a/machine_common_sense/scripts/run_passive_scenes.py b/machine_common_sense/scripts/run_passive_scenes.py index c3cc92c97..57750215c 100644 --- a/machine_common_sense/scripts/run_passive_scenes.py +++ b/machine_common_sense/scripts/run_passive_scenes.py @@ -1,4 +1,4 @@ -from .runner_script import MultipleFileRunnerScript +from runner_script import MultipleFileRunnerScript def action_callback(scene_data, step_metadata, runner_script):