Skip to content

Commit

Permalink
Merge pull request #425 from NextCenturyCorporation/development
Browse files Browse the repository at this point in the history
[Python] Release 0.4.6
  • Loading branch information
ThomasSchellenbergNextCentury authored Oct 5, 2021
2 parents 4f3b513 + 5be6452 commit af7d5ca
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CPU_Container.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------------------
Expand Down
2 changes: 1 addition & 1 deletion machine_common_sense/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.4.5'
__version__ = '0.4.6'
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 2 additions & 2 deletions machine_common_sense/scripts/run_action_file.py
Original file line number Diff line number Diff line change
@@ -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 = []

Expand Down
13 changes: 13 additions & 0 deletions machine_common_sense/scripts/run_interactive_scenes_pass.py
Original file line number Diff line number Diff line change
@@ -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()
Original file line number Diff line number Diff line change
@@ -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__":
Expand Down
2 changes: 1 addition & 1 deletion machine_common_sense/scripts/run_just_pass.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .runner_script import SingleFileRunnerScript
from runner_script import SingleFileRunnerScript


def action_callback(scene_data, step_metadata, runner_script):
Expand Down
2 changes: 1 addition & 1 deletion machine_common_sense/scripts/run_just_rotate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .runner_script import SingleFileRunnerScript
from runner_script import SingleFileRunnerScript


def action_callback(scene_data, step_metadata, runner_script):
Expand Down
2 changes: 1 addition & 1 deletion machine_common_sense/scripts/run_last_action.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .runner_script import SingleFileRunnerScript
from runner_script import SingleFileRunnerScript


def action_callback(scene_data, step_metadata, runner_script):
Expand Down
2 changes: 1 addition & 1 deletion machine_common_sense/scripts/run_passive_scenes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .runner_script import MultipleFileRunnerScript
from runner_script import MultipleFileRunnerScript


def action_callback(scene_data, step_metadata, runner_script):
Expand Down

0 comments on commit af7d5ca

Please sign in to comment.