diff --git a/.gitignore b/.gitignore index 11b5d89bf..8f20cc41a 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,7 @@ scripts/**/*.json scripts/**/*.mp4 scripts/**/*.png scripts/**/*.zip + +# Logging output and user config +logs/*.log +scripts/log.config.user.py diff --git a/CPU_Container.dockerfile b/CPU_Container.dockerfile index b81f5fccb..72a2f2949 100644 --- a/CPU_Container.dockerfile +++ b/CPU_Container.dockerfile @@ -9,7 +9,11 @@ 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.1.1 +ARG mcsversion=0.4.2 +ARG mcs_library_version=master + +WORKDIR /mcs + ENV DEBIAN_FRONTEND=noninteractive ENV MCS_EXECUTABLE_PATH="/MCS-AI2-THOR-Unity-App-v${mcsversion}.x86_64" @@ -50,16 +54,19 @@ RUN apt-get update -qq \ cmake pkg-config libgtk-3-dev libavcodec-dev libavformat-dev \ libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev gfortran openexr \ libatlas-base-dev libtbb2 libtbb-dev libdc1394-22-dev libopenexr-dev libgstreamer-plugins-base1.0-dev \ - libgstreamer1.0-dev \ - # mesa-utils libgl1-mesa-glx \ - && rm -rf /var/lib/apt/lists/* && \ + libgstreamer1.0-dev && \ + python3 -m pip install --upgrade pip setuptools wheel && \ + python3 -m pip install git+https://github.com/NextCenturyCorporation/MCS@${mcs_library_version}#egg=machine_common_sense && \ + rm -rf /var/lib/apt/lists/* && \ ln -s /usr/bin/python3 /usr/bin/python +WORKDIR /mcs -RUN wget https://github.com/NextCenturyCorporation/MCS/releases/download/${mcsversion}/MCS-AI2-THOR-Unity-App-v${mcsversion}.x86_64 && \ - wget https://github.com/NextCenturyCorporation/MCS/releases/download/${mcsversion}/MCS-AI2-THOR-Unity-App-v${mcsversion}_Data.tar.gz && \ - python3 -m pip install git+https://github.com/NextCenturyCorporation/MCS@${mcsversion}#egg=machine_common_sense && \ - tar -xzvf MCS-AI2-THOR-Unity-App-v${mcsversion}_Data.tar.gz && \ - chmod a+x MCS-AI2-THOR-Unity-App-v${mcsversion}.x86_64 && \ - rm MCS-AI2-THOR-Unity-App-v${mcsversion}_Data.tar.gz && echo "[MCS]\nmetadata: oracle" > /mcs_config_oracle.yaml && \ - echo "[MCS]\nmetadata: level1" > /mcs_config_level1.yaml && echo "[MCS]\nmetadata: level2" > /mcs_config_level2.yaml +# Add ai2thor/Unity resources +ADD https://github.com/NextCenturyCorporation/MCS/releases/download/${mcsversion}/MCS-AI2-THOR-Unity-App-v${mcsversion}.x86_64 /mcs +ADD https://github.com/NextCenturyCorporation/MCS/releases/download/${mcsversion}/MCS-AI2-THOR-Unity-App-v${mcsversion}_Data.tar.gz /mcs +ADD https://github.com/NextCenturyCorporation/MCS/releases/download/${mcsversion}/UnityPlayer.so /mcs +RUN tar -xzvf /mcs/MCS-AI2-THOR-Unity-App-v${mcsversion}_Data.tar.gz -C /mcs && \ + chmod a+x /mcs/MCS-AI2-THOR-Unity-App-v${mcsversion}.x86_64 && \ + rm /mcs/MCS-AI2-THOR-Unity-App-v${mcsversion}_Data.tar.gz && echo "[MCS]\nmetadata: oracle" > /mcs/mcs_config_oracle.yaml && \ + echo "[MCS]\nmetadata: level1" > /mcs/mcs_config_level1.yaml && echo "[MCS]\nmetadata: level2" > /mcs/mcs_config_level2.yaml diff --git a/Dockerfile b/Dockerfile index 3c58da691..d380881fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,20 +19,22 @@ 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.1.1 +ARG mcsversion=0.4.2 +ARG mcs_library_version=master WORKDIR /mcs RUN apt-get update && \ apt-get install -y git python3 python3-pip mesa-utils && \ python3 -m pip install --upgrade pip setuptools wheel && \ - python3 -m pip install git+https://github.com/NextCenturyCorporation/MCS@${mcsversion}#egg=machine_common_sense && \ + python3 -m pip install git+https://github.com/NextCenturyCorporation/MCS@${mcs_library_version}#egg=machine_common_sense && \ rm -rf /var/lib/apt/lists/* && \ ln -s /usr/bin/python3 /usr/bin/python -# add ai2thor/unity resources +# Add ai2thor/Unity resources ADD https://github.com/NextCenturyCorporation/MCS/releases/download/${mcsversion}/MCS-AI2-THOR-Unity-App-v${mcsversion}.x86_64 /mcs ADD https://github.com/NextCenturyCorporation/MCS/releases/download/${mcsversion}/MCS-AI2-THOR-Unity-App-v${mcsversion}_Data.tar.gz /mcs +ADD https://github.com/NextCenturyCorporation/MCS/releases/download/${mcsversion}/UnityPlayer.so /mcs RUN tar -xzvf /mcs/MCS-AI2-THOR-Unity-App-v${mcsversion}_Data.tar.gz -C /mcs && \ chmod a+x /mcs/MCS-AI2-THOR-Unity-App-v${mcsversion}.x86_64 && \ rm /mcs/MCS-AI2-THOR-Unity-App-v${mcsversion}_Data.tar.gz diff --git a/README.md b/README.md index 702593977..0288068b0 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ - [Download](#download) - [Training Datasets](#training-datasets) - [Usage](#usage) +- [Logging](#logging) - [Run with Human Input](#run-with-human-input) - [Run with Scene Timer](#run-with-scene-timer) - [Config File](#config-file) @@ -16,7 +17,7 @@ ## Installation -The latest release of the MCS Python library is `0.4.1.1`. +The latest release of the MCS Python library is `0.4.2`. ### Virtual Environments @@ -65,35 +66,35 @@ Here are the instructions for downloading and installing our latest Unity releas ### Unity Application -The latest release of the MCS Unity app is `0.4.1.1`. +The latest release of the MCS Unity app is `0.4.2`. Please note that our Unity App is built on Linux or Mac. Linux Version: -1. [Download the latest MCS Unity App](https://github.com/NextCenturyCorporation/MCS/releases/download/0.4.1-1/MCS-AI2-THOR-Unity-App-v0.4.1.1.x86_64) +1. [Download the latest MCS Unity App](https://github.com/NextCenturyCorporation/MCS/releases/download/0.4.2/MCS-AI2-THOR-Unity-App-v0.4.2.x86_64) -2. [Download the latest MCS Unity Data Directory TAR](https://github.com/NextCenturyCorporation/MCS/releases/download/0.4.1-1/MCS-AI2-THOR-Unity-App-v0.4.1.1_Data.tar.gz) +2. [Download the latest MCS Unity Data Directory TAR](https://github.com/NextCenturyCorporation/MCS/releases/download/0.4.2/MCS-AI2-THOR-Unity-App-v0.4.2_Data.tar.gz) -3. [Download the latest UnityPlayer.so file](https://github.com/NextCenturyCorporation/MCS/releases/download/0.4.1-1/UnityPlayer.so) +3. [Download the latest UnityPlayer.so file](https://github.com/NextCenturyCorporation/MCS/releases/download/0.4.2/UnityPlayer.so) 4. Ensure that both the Unity App and the TAR are in the same directory. 5. Untar the Data Directory: ``` -tar -xzvf MCS-AI2-THOR-Unity-App-v0.4.1.1_Data.tar.gz +tar -xzvf MCS-AI2-THOR-Unity-App-v0.4.2_Data.tar.gz ``` 6. Mark the Unity App as executable: ``` -chmod a+x MCS-AI2-THOR-Unity-App-v0.4.1.1.x86_64 +chmod a+x MCS-AI2-THOR-Unity-App-v0.4.2.x86_64 ``` Mac Version: -[Download the Mac ZIP](https://github.com/NextCenturyCorporation/MCS/releases/download/0.4.1-1/MCS-AI2-THOR-Unity-App-v0.4.1.1-mac.zip) +[Download the Mac ZIP](https://github.com/NextCenturyCorporation/MCS/releases/download/0.4.2/MCS-AI2-THOR-Unity-App-v0.4.2-mac.zip) ## Training Datasets @@ -212,6 +213,43 @@ for scene_json_file_path in scene_json_file_list: controller.end_scene() ``` +### Logging +#### Initialize development logging config settings +In startup script make sure you include: +```python +import machine_common_sense as mcs + +#This code initializes logging using config files +mcs.init_logging() +``` +#### Logging configuration files +This logging configuration system uses a file at [scripts/log.config.py](./scripts/log.config.py) as a default configuration file. See that file for links to documentation and some descriptions. + +Users can copy that file to scripts/log.config.user.py to create their own configuration. This file is gitignored so it will not be shared. + +#### Why use logging and configuration files + +We use logging configuration files so users have a reasonable default configuration but also have the ability to override when circumstances demand. This eliminates the need to alter code when changing what logging is necessary. In the future, additional features to the initialization function to support difficult overrides if necessary (i.e. different logging override files for dev, test, eval, etc). + +#### Example with logging config file: + +Sample of how to log in all files: +```python +import logging + +# logging by name is useful to turn certain logs on/off and +# also to help determine where an error log might have originated from +logger = logging.getLogger(__name__) + +def any_function(self): + #basic log functions in order of level. If logger or handler is set to a level, that level and above will be logged. + logger.critical("This message is see as long as the logger is enabled") + logger.error("This message reports an error") + logger.info("This message is general info") + logger.debug("This message is mainly for debugging and shouldn't cause usage problems if missing") + # Unlike many common loggers in other languages, python logging doesn't seem to have TRACE +``` + ## Run with Human Input To start the Unity application and enter your actions and parameters from the terminal, you can run the `run_in_human_input_mode` script that was installed in the package with the MCS Python Library (the `mcs_unity_build_file` is the Unity executable downloaded previously): @@ -239,18 +277,6 @@ To use an MCS configuration file, you can either pass in a file path via the `co ### Config File Properties -#### debug - -(boolean, optional) - -Whether to save MCS output debug files in this folder and print debug output to terminal. Will default to `False`. - -#### debug_output - -(string, optional) - -Alternatively to the `debug` property, `debug_output` can be used to either print debug info to the terminal or to debug files only. This should either be set to `file` or `terminal`, and will default to None. Will be ignored if `debug` is set. - #### history_enabled (boolean, optional) @@ -268,7 +294,8 @@ The `metadata` property describes what metadata will be returned by the MCS Pyth - `level1`: Only returns the images (with depth maps but NOT object masks), camera info, and properties corresponding to the player themself (like head tilt or pose). No information about specific objects will be included. - `none`: Only returns the images (but no depth maps or object masks), camera info, and properties corresponding to the player themself (like head tilt or pose). No information about specific objects will be included. -Otherwise, return the metadata for the visible and held objects. +If no metadata level is set: +- `default`: Fallback if no metadata level is specified. Only meant for use during development (evaluations will never be run this way). Includes metadata for visible and held objects in the scene, as well as camera info and properties corresponding to the player. Does not include depth maps or object masks. #### noise_enabled @@ -276,6 +303,18 @@ Otherwise, return the metadata for the visible and held objects. Whether to add random noise to the numerical amounts in movement and object interaction action parameters. Will default to `False`. +#### save_debug_images + +(boolean, optional) + +Save RGB frames, depth masks, and object instance segmentation masks (if returned in the output by the chosen metadata tier) to image files on each step. Default: False + +#### save_debug_json + +(boolean, optional) + +Save AI2-THOR/Unity input, AI2-THOR/Unity output, and MCS StepMetadata output to JSON file on each step. Default: False + #### seed (int, optional) @@ -292,7 +331,7 @@ Desired screen width. If value given, it must be more than `450`. If none given, (boolean, optional) -Save videos of the RGB frames, depth masks, object instance segmentation masks (if returned in the output by the chosen metadata tier), 2D top-down scene views, and the heatmap images given to us in `make_step_prediction` by the AI performer. +Create and save videos of the RGB frames, depth masks, object instance segmentation masks (if returned in the output by the chosen metadata tier), 2D top-down scene views, and the heatmap images given to us in `make_step_prediction` by the AI performer. Default: False ### Using the Config File to Generate Scene Graphs or Maps diff --git a/integration_tests/config_level1.ini b/integration_tests/config_level1.ini index 3bcd2f897..daa79ebbd 100644 --- a/integration_tests/config_level1.ini +++ b/integration_tests/config_level1.ini @@ -1,4 +1,3 @@ [MCS] -debug: false history_enabled: false metadata: level1 diff --git a/integration_tests/config_level2.ini b/integration_tests/config_level2.ini index 85d49bf1e..fd6eebad1 100644 --- a/integration_tests/config_level2.ini +++ b/integration_tests/config_level2.ini @@ -1,4 +1,3 @@ [MCS] -debug: false history_enabled: false metadata: level2 diff --git a/integration_tests/config_oracle.ini b/integration_tests/config_oracle.ini index f9b4bb448..2268e5e95 100644 --- a/integration_tests/config_oracle.ini +++ b/integration_tests/config_oracle.ini @@ -1,4 +1,3 @@ [MCS] -debug: false history_enabled: false metadata: oracle diff --git a/integration_tests/data/001.empty_room_movement.oracle.outputs.json b/integration_tests/data/001.empty_room_movement.oracle.outputs.json index eb8df0934..5f7e37f92 100644 --- a/integration_tests/data/001.empty_room_movement.oracle.outputs.json +++ b/integration_tests/data/001.empty_room_movement.oracle.outputs.json @@ -1,5 +1,6 @@ [ { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.0, @@ -102,6 +103,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.0, @@ -204,6 +206,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.0, @@ -306,6 +309,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.1, @@ -408,6 +412,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.2, @@ -510,6 +515,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.2, @@ -612,6 +618,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.2, @@ -714,6 +721,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.1, @@ -816,6 +824,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.0, @@ -918,6 +927,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.0, @@ -1020,6 +1030,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.0, @@ -1122,6 +1133,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.0, @@ -1224,6 +1236,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.0, @@ -1326,6 +1339,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.0, @@ -1428,6 +1442,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.0, @@ -1530,6 +1545,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 10, "objects_count": 0, "position_x": 0.0, @@ -1632,6 +1648,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 20, "objects_count": 0, "position_x": 0.0, @@ -1734,6 +1751,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 30, "objects_count": 0, "position_x": 0.0, @@ -1836,6 +1854,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 20, "objects_count": 0, "position_x": 0.0, @@ -1938,6 +1957,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 10, "objects_count": 0, "position_x": 0.0, @@ -2040,6 +2060,7 @@ "structural_objects_count": 6 }, { + "camera_height": 0.762, "head_tilt": 0, "objects_count": 0, "position_x": 0.0, @@ -2141,4 +2162,4 @@ ], "structural_objects_count": 6 } -] \ No newline at end of file +] diff --git a/integration_tests/data/046.pickup_trophy_with_image_coord.oracle.outputs.json b/integration_tests/data/046.pickup_trophy_with_image_coord.oracle.outputs.json index 0eed7194d..17e7a3118 100644 --- a/integration_tests/data/046.pickup_trophy_with_image_coord.oracle.outputs.json +++ b/integration_tests/data/046.pickup_trophy_with_image_coord.oracle.outputs.json @@ -17,7 +17,7 @@ "position_z": 1, "shape": "trophy", "texture_color_list": [ - "silver" + "silver", "grey" ], "visible": true } @@ -48,7 +48,7 @@ "position_z": 0.310000032, "shape": "trophy", "texture_color_list": [ - "silver" + "silver", "grey" ], "visible": true } diff --git a/integration_tests/data/048.open_and_pickup_with_image_coord.oracle.outputs.json b/integration_tests/data/048.open_and_pickup_with_image_coord.oracle.outputs.json index 81d3ac2f0..f1dc7de74 100644 --- a/integration_tests/data/048.open_and_pickup_with_image_coord.oracle.outputs.json +++ b/integration_tests/data/048.open_and_pickup_with_image_coord.oracle.outputs.json @@ -36,7 +36,7 @@ "position_z": 1, "shape": "trophy", "texture_color_list": [ - "silver" + "silver", "grey" ], "visible": false } @@ -126,7 +126,7 @@ "position_z": 0.41, "shape": "trophy", "texture_color_list": [ - "silver" + "silver", "grey" ], "visible": true } @@ -176,7 +176,7 @@ "position_z": 0.41, "shape": "trophy", "texture_color_list": [ - "silver" + "silver", "grey" ], "visible": true } diff --git a/integration_tests/data/065.platform.oracle.outputs.json b/integration_tests/data/065.platform.oracle.outputs.json index 43a51c1ea..5943a53c7 100644 --- a/integration_tests/data/065.platform.oracle.outputs.json +++ b/integration_tests/data/065.platform.oracle.outputs.json @@ -98,6 +98,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.273, + "direction_y": -0.962, + "direction_z": 0.0, + "distance": 1.832, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": -0.404, + "direction_y": -0.915, + "direction_z": 0.0, + "distance": 2.473, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -201,6 +225,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.322, + "direction_y": -0.947, + "direction_z": 0.0, + "distance": 1.861, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": -0.37, + "direction_y": -0.929, + "direction_z": 0.0, + "distance": 2.434, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -304,6 +352,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.369, + "direction_y": -0.929, + "direction_z": 0.0, + "distance": 1.896, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": -0.333, + "direction_y": -0.943, + "direction_z": 0.0, + "distance": 2.399, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -407,6 +479,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.413, + "direction_y": -0.911, + "direction_z": 0.0, + "distance": 1.935, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": -0.296, + "direction_y": -0.955, + "direction_z": 0.0, + "distance": 2.368, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -510,6 +606,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.455, + "direction_y": -0.891, + "direction_z": 0.0, + "distance": 1.979, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": -0.256, + "direction_y": -0.967, + "direction_z": 0.0, + "distance": 2.34, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -613,6 +733,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.494, + "direction_y": -0.87, + "direction_z": 0.0, + "distance": 2.026, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": -0.216, + "direction_y": -0.976, + "direction_z": 0.0, + "distance": 2.317, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -716,6 +860,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.848, + "direction_y": -0.53, + "direction_z": 0.0, + "distance": 1.438, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": -0.217, + "direction_y": -0.976, + "direction_z": 0.0, + "distance": 1.293, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -819,6 +987,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.848, + "direction_y": -0.53, + "direction_z": 0.0, + "distance": 1.438, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": -0.217, + "direction_y": -0.976, + "direction_z": 0.0, + "distance": 1.293, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -922,6 +1114,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.866, + "direction_y": -0.5, + "direction_z": 0.0, + "distance": 1.524, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": -0.141, + "direction_y": -0.99, + "direction_z": 0.0, + "distance": 1.275, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -1025,6 +1241,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.881, + "direction_y": -0.473, + "direction_z": 0.0, + "distance": 1.612, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": -0.063, + "direction_y": -0.998, + "direction_z": 0.0, + "distance": 1.265, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -1128,6 +1368,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.894, + "direction_y": -0.448, + "direction_z": 0.0, + "distance": 1.7, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": 0.016, + "direction_y": -1.0, + "direction_z": 0.0, + "distance": 1.262, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -1231,6 +1495,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.905, + "direction_y": -0.426, + "direction_z": 0.0, + "distance": 1.79, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": 0.095, + "direction_y": -0.996, + "direction_z": 0.0, + "distance": 1.268, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -1334,6 +1622,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.914, + "direction_y": -0.405, + "direction_z": 0.0, + "distance": 1.881, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": 0.172, + "direction_y": -0.985, + "direction_z": 0.0, + "distance": 1.281, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -1437,6 +1749,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.922, + "direction_y": -0.386, + "direction_z": 0.0, + "distance": 1.973, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": 0.246, + "direction_y": -0.969, + "direction_z": 0.0, + "distance": 1.302, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -1540,6 +1876,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.929, + "direction_y": -0.369, + "direction_z": 0.0, + "distance": 2.066, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": 0.316, + "direction_y": -0.949, + "direction_z": 0.0, + "distance": 1.33, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -1643,6 +2003,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.994, + "direction_y": 0.107, + "direction_z": 0.0, + "distance": 2.233, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": 0.94, + "direction_y": -0.342, + "direction_z": 0.0, + "distance": 0.766, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -1746,6 +2130,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.994, + "direction_y": 0.107, + "direction_z": 0.0, + "distance": 2.233, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": 0.94, + "direction_y": -0.342, + "direction_z": 0.0, + "distance": 0.766, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -1849,6 +2257,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.995, + "direction_y": 0.102, + "direction_z": 0.0, + "distance": 2.332, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": 0.953, + "direction_y": -0.304, + "direction_z": 0.0, + "distance": 0.861, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 @@ -1952,6 +2384,30 @@ "yellow" ], "visible": true + }, + { + "direction_x": 0.995, + "direction_y": 0.098, + "direction_z": 0.0, + "distance": 2.432, + "held": false, + "id": "upperPlatform", + "position_x": 2.0, + "position_z": 2.0, + "shape": "structural", + "visible": true + }, + { + "direction_x": 0.962, + "direction_y": -0.274, + "direction_z": 0.0, + "distance": 0.957, + "held": false, + "id": "lowerPlatform", + "position_x": 0.5, + "position_z": 2.0, + "shape": "structural", + "visible": true } ], "structural_objects_count": 8 diff --git a/integration_tests/data/065.platform.scene.json b/integration_tests/data/065.platform.scene.json index 578b7038f..4857c4df7 100644 --- a/integration_tests/data/065.platform.scene.json +++ b/integration_tests/data/065.platform.scene.json @@ -1,7 +1,7 @@ { "name": "platform", "version": 1, - "ceilingMaterial": "AI2-THOR/Materials/Walls/WallDrywallWhite", + "ceilingMaterial": "AI2-THOR/Materials/Walls/Drywall", "floorMaterial": "AI2-THOR/Materials/Fabrics/RUG4", "wallMaterial": "AI2-THOR/Materials/Walls/YellowDrywall", "roomDimensions": { diff --git a/integration_tests/data/069.intuitive_physics_scene_start.oracle.outputs.json b/integration_tests/data/069.intuitive_physics_scene_start.oracle.outputs.json index a65a89c2c..852d81c80 100644 --- a/integration_tests/data/069.intuitive_physics_scene_start.oracle.outputs.json +++ b/integration_tests/data/069.intuitive_physics_scene_start.oracle.outputs.json @@ -1,5 +1,6 @@ [ { + "camera_height": 1.5, "head_tilt": 0, "objects_count": 0, "position_x": 0.0, @@ -25,9 +26,9 @@ }, { "direction_x": 0.0, - "direction_y": -0.219, - "direction_z": 0.976, - "distance": 4.612, + "direction_y": -0.362, + "direction_z": 0.932, + "distance": 4.828, "held": false, "id": "floor", "position_x": 0.0, @@ -40,9 +41,9 @@ }, { "direction_x": 0.0, - "direction_y": 0.701, - "direction_z": -0.713, - "distance": 1.052, + "direction_y": 0.0, + "direction_z": -1.0, + "distance": 0.75, "held": false, "id": "wall_back", "position_x": 0.0, @@ -55,9 +56,9 @@ }, { "direction_x": 0.0, - "direction_y": 0.224, - "direction_z": 0.975, - "distance": 10.004, + "direction_y": 0.152, + "direction_z": 0.988, + "distance": 9.865, "held": false, "id": "wall_front", "position_x": 0.0, @@ -70,7 +71,7 @@ }, { "direction_x": -0.975, - "direction_y": 0.036, + "direction_y": 0.0, "direction_z": 0.22, "distance": 20.5, "held": false, @@ -85,7 +86,7 @@ }, { "direction_x": 0.975, - "direction_y": 0.036, + "direction_y": 0.0, "direction_z": 0.22, "distance": 20.5, "held": false, @@ -102,6 +103,7 @@ "structural_objects_count": 5 }, { + "camera_height": 1.5, "head_tilt": 0, "objects_count": 0, "position_x": 0.0, @@ -127,9 +129,9 @@ }, { "direction_x": 0.0, - "direction_y": -0.219, - "direction_z": 0.976, - "distance": 4.612, + "direction_y": -0.362, + "direction_z": 0.932, + "distance": 4.828, "held": false, "id": "floor", "position_x": 0.0, @@ -142,9 +144,9 @@ }, { "direction_x": 0.0, - "direction_y": 0.701, - "direction_z": -0.713, - "distance": 1.052, + "direction_y": 0.0, + "direction_z": -1.0, + "distance": 0.75, "held": false, "id": "wall_back", "position_x": 0.0, @@ -157,9 +159,9 @@ }, { "direction_x": 0.0, - "direction_y": 0.224, - "direction_z": 0.975, - "distance": 10.004, + "direction_y": 0.152, + "direction_z": 0.988, + "distance": 9.865, "held": false, "id": "wall_front", "position_x": 0.0, @@ -172,7 +174,7 @@ }, { "direction_x": -0.975, - "direction_y": 0.036, + "direction_y": 0.0, "direction_z": 0.22, "distance": 20.5, "held": false, @@ -187,7 +189,7 @@ }, { "direction_x": 0.975, - "direction_y": 0.036, + "direction_y": 0.0, "direction_z": 0.22, "distance": 20.5, "held": false, diff --git a/integration_tests/data/070.open_close_container.actions.txt b/integration_tests/data/070.open_close_container.actions.txt new file mode 100644 index 000000000..61b50aa8e --- /dev/null +++ b/integration_tests/data/070.open_close_container.actions.txt @@ -0,0 +1,7 @@ +LookDown +LookDown +PickupObject,objectId=toy_car +MoveAhead +PutObject,objectId=toy_car,receptacleObjectId=treasure_chest +Pass +PutObject,objectId=toy_car,receptacleObjectId=treasure_chest \ No newline at end of file diff --git a/integration_tests/data/070.open_close_container.level1.outputs.json b/integration_tests/data/070.open_close_container.level1.outputs.json new file mode 100644 index 000000000..05b5f6c8f --- /dev/null +++ b/integration_tests/data/070.open_close_container.level1.outputs.json @@ -0,0 +1,73 @@ +[{ + "step_number": 0, + "head_tilt": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +}, { + "step_number": 1, + "head_tilt": 10, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +},{ + "step_number": 2, + "head_tilt": 20, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +}, { + "step_number": 3, + "head_tilt": 20, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +},{ + "step_number": 4, + "head_tilt": 20, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +}, { + "step_number": 5, + "head_tilt": 20, + "position_x": null, + "position_z": null, + "return_status": "OBSTRUCTED", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +},{ + "step_number": 6, + "head_tilt": 20, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +}, { + "step_number": 7, + "head_tilt": 20, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +}] diff --git a/integration_tests/data/070.open_close_container.level2.outputs.json b/integration_tests/data/070.open_close_container.level2.outputs.json new file mode 100644 index 000000000..05b5f6c8f --- /dev/null +++ b/integration_tests/data/070.open_close_container.level2.outputs.json @@ -0,0 +1,73 @@ +[{ + "step_number": 0, + "head_tilt": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +}, { + "step_number": 1, + "head_tilt": 10, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +},{ + "step_number": 2, + "head_tilt": 20, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +}, { + "step_number": 3, + "head_tilt": 20, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +},{ + "step_number": 4, + "head_tilt": 20, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +}, { + "step_number": 5, + "head_tilt": 20, + "position_x": null, + "position_z": null, + "return_status": "OBSTRUCTED", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +},{ + "step_number": 6, + "head_tilt": 20, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +}, { + "step_number": 7, + "head_tilt": 20, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "objects_count": 0, + "structural_objects_count": 0 +}] diff --git a/integration_tests/data/070.open_close_container.oracle.outputs.json b/integration_tests/data/070.open_close_container.oracle.outputs.json new file mode 100644 index 000000000..c280d6bff --- /dev/null +++ b/integration_tests/data/070.open_close_container.oracle.outputs.json @@ -0,0 +1,266 @@ +[ + { + "camera_height": 0.762, + "head_tilt": 0, + "objects": [ + { + "held": false, + "id": "toy_car", + "openable": false, + "pickupable": true + }, + { + "held": false, + "id": "treasure_chest", + "isOpen": false, + "openable": true, + "pickupable": false + }, + { + "held": false, + "id": "suitcase", + "isOpen": false, + "openable": true, + "pickupable": false + } + ], + "objects_count": 3, + "position_x": 0.0, + "position_z": -0.2, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 0, + "structural_objects_count": 6 + }, + { + "camera_height": 0.762, + "head_tilt": 10, + "objects": [ + { + "held": false, + "id": "toy_car", + "openable": false, + "pickupable": true + }, + { + "held": false, + "id": "treasure_chest", + "isOpen": false, + "openable": true, + "pickupable": false + }, + { + "held": false, + "id": "suitcase", + "isOpen": true, + "openable": true, + "pickupable": false + } + ], + "objects_count": 3, + "position_x": 0.0, + "position_z": -0.2, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 1, + "structural_objects_count": 6 + }, + { + "camera_height": 0.762, + "head_tilt": 20, + "objects": [ + { + "held": false, + "id": "toy_car", + "openable": false, + "pickupable": true + }, + { + "held": false, + "id": "treasure_chest", + "isOpen": true, + "openable": true, + "pickupable": false + }, + { + "held": false, + "id": "suitcase", + "isOpen": false, + "openable": true, + "pickupable": false + } + ], + "objects_count": 3, + "position_x": 0.0, + "position_z": -0.2, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 2, + "structural_objects_count": 6 + }, + { + "camera_height": 0.762, + "head_tilt": 20, + "objects": [ + { + "held": true, + "id": "toy_car", + "openable": false, + "pickupable": true + }, + { + "held": false, + "id": "treasure_chest", + "isOpen": false, + "openable": true, + "pickupable": false + }, + { + "held": false, + "id": "suitcase", + "isOpen": true, + "openable": true, + "pickupable": false + } + ], + "objects_count": 3, + "position_x": 0.0, + "position_z": -0.2, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 3, + "structural_objects_count": 6 + }, + { + "camera_height": 0.762, + "head_tilt": 20, + "objects": [ + { + "held": true, + "id": "toy_car", + "openable": false, + "pickupable": true + }, + { + "held": false, + "id": "treasure_chest", + "isOpen": false, + "openable": true, + "pickupable": false + }, + { + "held": false, + "id": "suitcase", + "isOpen": false, + "openable": true, + "pickupable": false + } + ], + "objects_count": 3, + "position_x": 0.0, + "position_z": -0.1, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 4, + "structural_objects_count": 6 + }, + { + "camera_height": 0.762, + "head_tilt": 20, + "objects": [ + { + "held": true, + "id": "toy_car", + "openable": false, + "pickupable": true + }, + { + "held": false, + "id": "treasure_chest", + "isOpen": false, + "openable": true, + "pickupable": false + }, + { + "held": false, + "id": "suitcase", + "isOpen": true, + "openable": true, + "pickupable": false + } + ], + "objects_count": 3, + "position_x": 0.0, + "position_z": -0.1, + "return_status": "OBSTRUCTED", + "rotation_y": 0.0, + "step_number": 5, + "structural_objects_count": 6 + }, + { + "camera_height": 0.762, + "head_tilt": 20, + "objects": [ + { + "held": true, + "id": "toy_car", + "openable": false, + "pickupable": true + }, + { + "held": false, + "id": "treasure_chest", + "isOpen": true, + "openable": true, + "pickupable": false + }, + { + "held": false, + "id": "suitcase", + "isOpen": false, + "openable": true, + "pickupable": false + } + ], + "objects_count": 3, + "position_x": 0.0, + "position_z": -0.1, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 6, + "structural_objects_count": 6 + }, + { + "camera_height": 0.762, + "head_tilt": 20, + "objects": [ + { + "held": false, + "id": "toy_car", + "openable": false, + "pickupable": true + }, + { + "held": false, + "id": "treasure_chest", + "isOpen": true, + "openable": true, + "pickupable": false + }, + { + "held": false, + "id": "suitcase", + "isOpen": false, + "openable": true, + "pickupable": false + } + ], + "objects_count": 3, + "position_x": 0.0, + "position_z": -0.1, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 7, + "structural_objects_count": 6 + } +] \ No newline at end of file diff --git a/integration_tests/data/070.open_close_container.scene.json b/integration_tests/data/070.open_close_container.scene.json new file mode 100644 index 000000000..178a2e1e3 --- /dev/null +++ b/integration_tests/data/070.open_close_container.scene.json @@ -0,0 +1,106 @@ +{ + "name": "container open and close", + "version": 2, + "ceilingMaterial": "AI2-THOR/Materials/Walls/Drywall", + "floorMaterial": "AI2-THOR/Materials/Fabrics/CarpetWhite 3", + "wallMaterial": "AI2-THOR/Materials/Walls/DrywallBeige", + "performerStart": { + "position": { + "x": 0, + "z": -0.2 + }, + "rotation": { + "x": 0, + "y": 0 + } + }, + "objects": [{ + "id": "toy_car", + "type": "car_1", + "salientMaterials": ["wood"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color wood 2"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": 0, + "y": 0.01, + "z": 0.6 + }, + "rotation": { + "x": 0, + "y": 90, + "z": 0 + }, + "scale": { + "x": 1.5, + "y": 1.5, + "z": 1.5 + } + }] + }, { + "id": "treasure_chest", + "type": "chest_2", + "salientMaterials": ["wood"], + "materials": ["AI2-THOR/Materials/Wood/LightWoodCounters4"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": 0, + "y": 0, + "z": 1.0 + }, + "rotation": { + "x": 0, + "y": 180, + "z": 0 + } + }], + "openClose": [{ + "open": true, + "step": 2 + },{ + "open": false, + "step": 3 + },{ + "open": true, + "step": 6 + }] + }, { + "id": "suitcase", + "type": "suitcase_1", + "salientMaterials": ["plastic"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 1"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": -2, + "y": 0, + "z": 3.5 + }, + "rotation": { + "x": 0, + "y": 180, + "z": 0 + } + }], + "openClose": [{ + "open": true, + "step": 1 + },{ + "open": false, + "step": 2 + },{ + "open": true, + "step": 3 + },{ + "open": false, + "step": 4 + },{ + "open": true, + "step": 5 + },{ + "open": false, + "step": 6 + }] + }] +} diff --git a/integration_tests/data/071.pickup_container.actions.txt b/integration_tests/data/071.pickup_container.actions.txt new file mode 100644 index 000000000..43aafd65f --- /dev/null +++ b/integration_tests/data/071.pickup_container.actions.txt @@ -0,0 +1,6 @@ +LookDown +MoveAhead +PickupObject,objectId=bowl_a +Crawl +DropObject +Pass \ No newline at end of file diff --git a/integration_tests/data/071.pickup_container.level1.outputs.json b/integration_tests/data/071.pickup_container.level1.outputs.json new file mode 100644 index 000000000..95288838d --- /dev/null +++ b/integration_tests/data/071.pickup_container.level1.outputs.json @@ -0,0 +1,102 @@ +[ + { + "head_tilt": 20, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 0, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 1, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 2, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 3, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 4, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 5, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 6, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 7, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 8, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 9, + "structural_objects_count": 0 + } +] \ No newline at end of file diff --git a/integration_tests/data/071.pickup_container.level2.outputs.json b/integration_tests/data/071.pickup_container.level2.outputs.json new file mode 100644 index 000000000..95288838d --- /dev/null +++ b/integration_tests/data/071.pickup_container.level2.outputs.json @@ -0,0 +1,102 @@ +[ + { + "head_tilt": 20, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 0, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 1, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 2, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 3, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 4, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 5, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 6, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 7, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 8, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 9, + "structural_objects_count": 0 + } +] \ No newline at end of file diff --git a/integration_tests/data/071.pickup_container.oracle.outputs.json b/integration_tests/data/071.pickup_container.oracle.outputs.json new file mode 100644 index 000000000..f730ed6f6 --- /dev/null +++ b/integration_tests/data/071.pickup_container.oracle.outputs.json @@ -0,0 +1,211 @@ +[ + { + "camera_height": 0.762, + "head_tilt": 20, + "objects": [ + { + "held": false, + "id": "apple_a", + "mass": 0.25, + "position_x": 0.0, + "position_y": 0.135, + "position_z": 0.6, + "visible": true + }, + { + "held": false, + "id": "bowl_a", + "mass": 0.25, + "position_x": 0.0, + "position_y": 0.085, + "position_z": 0.6, + "visible": true + } + ], + "objects_count": 2, + "position_x": 0.0, + "position_z": -0.2, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 0, + "structural_objects_count": 6 + }, + { + "camera_height": 0.762, + "head_tilt": 30, + "objects": [ + { + "held": false, + "id": "apple_a", + "mass": 0.25, + "position_x": 0.0, + "position_y": 0.097, + "position_z": 0.6, + "visible": true + }, + { + "held": false, + "id": "bowl_a", + "mass": 0.25, + "position_x": 0.0, + "position_y": 0.046, + "position_z": 0.6, + "visible": true + } + ], + "objects_count": 2, + "position_x": 0.0, + "position_z": -0.2, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 1, + "structural_objects_count": 6 + }, + { + "camera_height": 0.762, + "head_tilt": 30, + "objects": [ + { + "held": false, + "id": "apple_a", + "mass": 0.25, + "position_x": 0.0, + "position_y": 0.037, + "position_z": 0.6, + "visible": true + }, + { + "held": false, + "id": "bowl_a", + "mass": 0.25, + "position_x": 0.0, + "position_y": 0.0, + "position_z": 0.6, + "visible": true + } + ], + "objects_count": 2, + "position_x": 0.0, + "position_z": -0.1, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 2, + "structural_objects_count": 6 + }, + { + "camera_height": 0.762, + "head_tilt": 30, + "objects": [ + { + "held": false, + "id": "apple_a", + "mass": 0.25, + "position_x": 0.0, + "position_y": 0.612, + "position_z": 0.24, + "visible": true + }, + { + "held": true, + "id": "bowl_a", + "mass": 0.25, + "position_x": 0.0, + "position_y": 0.575, + "position_z": 0.24, + "visible": true + } + ], + "objects_count": 2, + "position_x": 0.0, + "position_z": -0.1, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 3, + "structural_objects_count": 6 + }, + { + "camera_height": 0.381, + "head_tilt": 30, + "objects": [ + { + "held": false, + "id": "apple_a", + "mass": 0.25, + "position_x": 0.0, + "position_y": 0.231, + "position_z": 0.24, + "visible": true + }, + { + "held": true, + "id": "bowl_a", + "mass": 0.25, + "position_x": -0.001, + "position_y": 0.194, + "position_z": 0.24, + "visible": true + } + ], + "objects_count": 2, + "position_x": 0.0, + "position_z": -0.1, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 4, + "structural_objects_count": 6 + }, + { + "camera_height": 0.381, + "head_tilt": 30, + "objects": [ + { + "held": false, + "id": "apple_a", + "mass": 0.25, + "position_y": 0.216, + "visible": true + }, + { + "held": false, + "id": "bowl_a", + "mass": 0.25, + "position_y": 0.179, + "visible": true + } + ], + "objects_count": 2, + "position_x": 0.0, + "position_z": -0.1, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 5, + "structural_objects_count": 6 + }, + { + "camera_height": 0.381, + "head_tilt": 30, + "objects": [ + { + "held": false, + "id": "apple_a", + "mass": 0.25, + "position_y": 0.178, + "visible": true + }, + { + "held": false, + "id": "bowl_a", + "mass": 0.25, + "position_y": 0.14, + "visible": true + } + ], + "objects_count": 2, + "position_x": 0, + "position_z": -0.1, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 6, + "structural_objects_count": 6 + } +] \ No newline at end of file diff --git a/integration_tests/data/071.pickup_container.scene.json b/integration_tests/data/071.pickup_container.scene.json new file mode 100644 index 000000000..498f24cbf --- /dev/null +++ b/integration_tests/data/071.pickup_container.scene.json @@ -0,0 +1,52 @@ +{ + "name": "container open and close", + "version": 2, + "ceilingMaterial": "AI2-THOR/Materials/Walls/Drywall", + "floorMaterial": "AI2-THOR/Materials/Fabrics/CarpetWhite 3", + "wallMaterial": "AI2-THOR/Materials/Walls/DrywallBeige", + "performerStart": { + "position": { + "x": 0, + "z": -0.2 + }, + "rotation": { + "x": 20, + "y": 0 + } + }, + "objects": [{ + "id": "apple_a", + "type": "apple_1", + "shows": [{ + "stepBegin": 0, + "position": { + "x": 0, + "y": 0.15, + "z": 0.6 + }, + "scale": { + "x": 0.5, + "y": 0.5, + "z": 0.5 + } + }] + }, { + "id": "bowl_a", + "type": "bowl_6", + "salientMaterials": ["plastic"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 2"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": 0, + "y": 0.1, + "z": 0.6 + }, + "scale": { + "x": 1, + "y": 1, + "z": 1 + } + }] + }] +} diff --git a/integration_tests/data/072.frame_rate.actions.txt b/integration_tests/data/072.frame_rate.actions.txt new file mode 100644 index 000000000..b1b60e174 --- /dev/null +++ b/integration_tests/data/072.frame_rate.actions.txt @@ -0,0 +1,2 @@ +MoveAhead +Pass \ No newline at end of file diff --git a/integration_tests/data/072.frame_rate.level1.outputs.json b/integration_tests/data/072.frame_rate.level1.outputs.json new file mode 100644 index 000000000..ea8fac8b6 --- /dev/null +++ b/integration_tests/data/072.frame_rate.level1.outputs.json @@ -0,0 +1,35 @@ +[ + { + "head_tilt": 0, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 0, + "physics_frames_per_second": 20, + "structural_objects_count": 0 + }, + { + "head_tilt": 0, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 1, + "physics_frames_per_second": 20, + "structural_objects_count": 0 + }, + { + "head_tilt": 0, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 2, + "physics_frames_per_second": 20, + "structural_objects_count": 0 + } +] \ No newline at end of file diff --git a/integration_tests/data/072.frame_rate.level2.outputs.json b/integration_tests/data/072.frame_rate.level2.outputs.json new file mode 100644 index 000000000..ea8fac8b6 --- /dev/null +++ b/integration_tests/data/072.frame_rate.level2.outputs.json @@ -0,0 +1,35 @@ +[ + { + "head_tilt": 0, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 0, + "physics_frames_per_second": 20, + "structural_objects_count": 0 + }, + { + "head_tilt": 0, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 1, + "physics_frames_per_second": 20, + "structural_objects_count": 0 + }, + { + "head_tilt": 0, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "rotation_y": null, + "step_number": 2, + "physics_frames_per_second": 20, + "structural_objects_count": 0 + } +] \ No newline at end of file diff --git a/integration_tests/data/072.frame_rate.oracle.outputs.json b/integration_tests/data/072.frame_rate.oracle.outputs.json new file mode 100644 index 000000000..ea7822d95 --- /dev/null +++ b/integration_tests/data/072.frame_rate.oracle.outputs.json @@ -0,0 +1,41 @@ +[ + { + "camera_height": 0.762, + "head_tilt": 0, + "objects": [], + "objects_count": 0, + "position_x": 0.0, + "position_z": 0.0, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 0, + "physics_frames_per_second": 20, + "structural_objects_count": 6 + }, + { + "camera_height": 0.762, + "head_tilt": 0, + "objects": [], + "objects_count": 0, + "position_x": 0.0, + "position_z": 0.1, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 1, + "physics_frames_per_second": 20, + "structural_objects_count": 6 + }, + { + "camera_height": 0.762, + "head_tilt": 0, + "objects": [], + "objects_count": 0, + "position_x": 0.0, + "position_z": 0.1, + "return_status": "SUCCESSFUL", + "rotation_y": 0.0, + "step_number": 2, + "physics_frames_per_second": 20, + "structural_objects_count": 6 + } +] \ No newline at end of file diff --git a/integration_tests/data/072.frame_rate.scene.json b/integration_tests/data/072.frame_rate.scene.json new file mode 100644 index 000000000..6dbceb029 --- /dev/null +++ b/integration_tests/data/072.frame_rate.scene.json @@ -0,0 +1,18 @@ +{ + "name": "test frame rate", + "version": 2, + "ceilingMaterial": "AI2-THOR/Materials/Walls/Drywall", + "floorMaterial": "AI2-THOR/Materials/Fabrics/CarpetWhite 3", + "wallMaterial": "AI2-THOR/Materials/Walls/DrywallBeige", + "performerStart": { + "position": { + "x": 0, + "z": 0 + }, + "rotation": { + "x": 0, + "y": 0 + } + }, + "objects": [] +} diff --git a/integration_tests/data/073.trophy_reward.actions.txt b/integration_tests/data/073.trophy_reward.actions.txt new file mode 100644 index 000000000..7cc81e69a --- /dev/null +++ b/integration_tests/data/073.trophy_reward.actions.txt @@ -0,0 +1,2 @@ +LookDown +PickupObject,objectId=trophy \ No newline at end of file diff --git a/integration_tests/data/073.trophy_reward.level1.outputs.json b/integration_tests/data/073.trophy_reward.level1.outputs.json new file mode 100644 index 000000000..fbee52eea --- /dev/null +++ b/integration_tests/data/073.trophy_reward.level1.outputs.json @@ -0,0 +1,35 @@ +[ + { + "head_tilt": 20, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "reward": 0.0, + "rotation_y": null, + "step_number": 0, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "reward": -0.001, + "rotation_y": null, + "step_number": 1, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "reward": 0.999, + "rotation_y": null, + "step_number": 2, + "structural_objects_count": 0 + } +] \ No newline at end of file diff --git a/integration_tests/data/073.trophy_reward.level2.outputs.json b/integration_tests/data/073.trophy_reward.level2.outputs.json new file mode 100644 index 000000000..fbee52eea --- /dev/null +++ b/integration_tests/data/073.trophy_reward.level2.outputs.json @@ -0,0 +1,35 @@ +[ + { + "head_tilt": 20, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "reward": 0.0, + "rotation_y": null, + "step_number": 0, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "reward": -0.001, + "rotation_y": null, + "step_number": 1, + "structural_objects_count": 0 + }, + { + "head_tilt": 30, + "objects_count": 0, + "position_x": null, + "position_z": null, + "return_status": "SUCCESSFUL", + "reward": 0.999, + "rotation_y": null, + "step_number": 2, + "structural_objects_count": 0 + } +] \ No newline at end of file diff --git a/integration_tests/data/073.trophy_reward.oracle.outputs.json b/integration_tests/data/073.trophy_reward.oracle.outputs.json new file mode 100644 index 000000000..36c71789d --- /dev/null +++ b/integration_tests/data/073.trophy_reward.oracle.outputs.json @@ -0,0 +1,41 @@ +[ + { + "camera_height": 0.762, + "head_tilt": 20, + "objects": [], + "objects_count": 1, + "position_x": 0.0, + "position_z": 0.0, + "return_status": "SUCCESSFUL", + "reward": 0.0, + "rotation_y": 0.0, + "step_number": 0, + "structural_objects_count": 6 + }, + { + "camera_height": 0.762, + "head_tilt": 30, + "objects": [], + "objects_count": 1, + "position_x": 0.0, + "position_z": 0.0, + "return_status": "SUCCESSFUL", + "reward": -0.001, + "rotation_y": 0.0, + "step_number": 1, + "structural_objects_count": 6 + }, + { + "camera_height": 0.762, + "head_tilt": 30, + "objects": [], + "objects_count": 1, + "position_x": 0.0, + "position_z": 0.0, + "return_status": "SUCCESSFUL", + "reward": 0.999, + "rotation_y": 0.0, + "step_number": 2, + "structural_objects_count": 6 + } +] \ No newline at end of file diff --git a/integration_tests/data/073.trophy_reward.scene.json b/integration_tests/data/073.trophy_reward.scene.json new file mode 100644 index 000000000..77105f655 --- /dev/null +++ b/integration_tests/data/073.trophy_reward.scene.json @@ -0,0 +1,40 @@ +{ + "name": "retrieval_goal_example_with_trophy", + "version": 2, + "ceilingMaterial": "AI2-THOR/Materials/Walls/Drywall", + "floorMaterial": "AI2-THOR/Materials/Fabrics/CarpetWhite 3", + "wallMaterial": "AI2-THOR/Materials/Walls/DrywallBeige", + "performerStart": { + "position": { + "x": 0, + "z": 0 + }, + "rotation": { + "x": 20, + "y": 0 + } + }, + "objects": [{ + "id": "trophy", + "type": "trophy", + "shows": [{ + "stepBegin": 0, + "position": { + "x": 0, + "y": 0, + "z": 0.5 + } + }] + }], + "goal": { + "category": "retrieval", + "description": "Find and pick up the trophy.", + "last_step": 3000, + "metadata": { + "target": { + "id": "trophy", + "image": null + } + } + } +} diff --git a/integration_tests/run_handmade_tests.py b/integration_tests/run_handmade_tests.py index 2a583181f..accae2cce 100644 --- a/integration_tests/run_handmade_tests.py +++ b/integration_tests/run_handmade_tests.py @@ -34,6 +34,7 @@ def create_test_case(name, expected, actual): def create_step_test_case_list(expected, actual): test_case_list = [ ('action_list', actual.action_list), + ('camera_height', actual.camera_height), ('head_tilt', round(actual.head_tilt)), ('objects_count', len(actual.object_list)), ('position_x', actual.position.get('x') if actual.position else None), @@ -42,6 +43,7 @@ def create_step_test_case_list(expected, actual): ('reward', actual.reward), ('rotation_y', actual.rotation), ('step_number', actual.step_number), + ('physics_frames_per_second', actual.physics_frames_per_second), ('structural_objects_count', len(actual.structural_object_list)) ] return [ @@ -78,7 +80,9 @@ def create_object_test_case_list(object_type, expected, actual): ('shape', actual.shape), ('state_list', actual.state_list), ('texture_color_list', actual.texture_color_list), - ('visible', actual.visible) + ('visible', actual.visible), + ('is_open', actual.is_open), + ('openable', actual.openable) ] return [create_test_case( [object_type, actual.uuid, case_name], diff --git a/logs/.gitignore b/logs/.gitignore new file mode 100644 index 000000000..161f71e85 --- /dev/null +++ b/logs/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything +* +# except the .gitignore file +!.gitignore \ No newline at end of file diff --git a/machine_common_sense/API.md b/machine_common_sense/API.md index d2bf528a2..be4b9c054 100644 --- a/machine_common_sense/API.md +++ b/machine_common_sense/API.md @@ -69,6 +69,23 @@ numerical action parameters noise_enabled is True. :rtype: float +#### get_metadata_level() +Returns the current metadata level set in the config. If none +specified, returns ‘default’. + + +* **Returns** + + A string containing the current metadata level. + + + +* **Return type** + + string + + + #### make_step_prediction(choice: str = None, confidence: float = None, violations_xy_list: List[Dict[str, float]] = None, heatmap_img: PIL.Image.Image = None, internal_state: object = None) Make a prediction on the previously taken step/action. @@ -115,6 +132,11 @@ Make a prediction on the previously taken step/action. +#### retrieve_action_list_at_step(goal, step_number) +Return the action list from the given goal at the given step as a +a list of actions tuples by default. + + #### retrieve_object_states(object_id) Return the state list at the current step for the object with the given ID from the scene configuration data, if any. @@ -186,13 +208,21 @@ Defines metadata for a goal in the MCS 3D environment. * **Variables** - * **action_list** (*list of lists of strings**, or **None*) – The list of actions that are available for the scene at each step - (outer list index). Each inner list item is a list of action strings. - For example, [‘MoveAhead’,’RotateLook,rotation=180’] restricts the - actions to either ‘MoveAhead’ or ‘RotateLook’ with the ‘rotation’ - parameter set to 180. An action_list of None means that all - actions are always available. An empty inner list means that all - actions are available for that specific step. + * **action_list** (*list of lists of** (**string**, **dict**) **tuples**, or **None*) – The list of all actions that are available for the scene at each step + (outer list). Each inner list is the list of all actions that are + available for the single step corresponding to the inner list’s index + within the outer list. Each action is returned as a tuple containing + the action string and the action’s restricted paramters, if any. + For example: (“Pass”, {}) forces a Pass action; (“PickupObject”, {}) + forces a PickupObject action with any parameters; and + (“PickupObject”, {“objectId”: “a”}) forces a PickupObject action with + the specific parameters objectId=a. + An action_list of None means that all actions are always available. + An empty inner list means that all actions will be available on that + specific step. + See StepMetadata.action_list for the available actions of the current + step. + May be a subset of all possible actions. See [Actions](#Actions). * **category** (*string*) – The category that describes this goal and the properties in its @@ -242,7 +272,7 @@ Defines metadata for a goal in the MCS 3D environment. ## ObjectMetadata -### class machine_common_sense.object_metadata.ObjectMetadata(uuid='', color=None, dimensions=None, direction=None, distance=- 1.0, distance_in_steps=- 1.0, distance_in_world=- 1.0, held=False, mass=0.0, material_list=None, position=None, rotation=None, shape='', state_list=None, texture_color_list=None, visible=False) +### class machine_common_sense.object_metadata.ObjectMetadata(uuid='', color=None, dimensions=None, direction=None, distance=- 1.0, distance_in_steps=- 1.0, distance_in_world=- 1.0, held=False, mass=0.0, material_list=None, position=None, rotation=None, shape='', state_list=None, texture_color_list=None, visible=False, is_open=False, openable=False) Defines metadata for an object in the MCS 3D environment. @@ -310,10 +340,16 @@ Defines metadata for an object in the MCS 3D environment. * **visible** (*boolean*) – Whether you can see this object in your camera viewport. + * **is_open** (*boolean*) – Whether the object is open or not + + + * **openable** (*boolean*) – Whether the object can be opened + + ## StepMetadata -### class machine_common_sense.step_metadata.StepMetadata(action_list=None, camera_aspect_ratio=None, camera_clipping_planes=None, camera_field_of_view=0.0, camera_height=0.0, depth_map_list=None, goal=None, habituation_trial=None, head_tilt=0.0, image_list=None, object_list=None, object_mask_list=None, pose='UNDEFINED', position=None, return_status='UNDEFINED', reward=0, rotation=0.0, step_number=0, structural_object_list=None) +### class machine_common_sense.step_metadata.StepMetadata(action_list=None, camera_aspect_ratio=None, camera_clipping_planes=None, camera_field_of_view=0.0, camera_height=0.0, depth_map_list=None, goal=None, habituation_trial=None, head_tilt=0.0, image_list=None, object_list=None, object_mask_list=None, performer_radius=0.0, performer_reach=0.0, physics_frames_per_second=0, pose='UNDEFINED', position=None, return_status='UNDEFINED', reward=0, rotation=0.0, step_number=0, structural_object_list=None) Defines output metadata from an action step in the MCS 3D environment. @@ -323,6 +359,13 @@ Defines output metadata from an action step in the MCS 3D environment. * **action_list** (*list of** (**string**, **dict**) **tuples*) – The list of all actions that are available for the next step. Each action is returned as a tuple containing the action string and the action’s restricted parameters, if any. + For example: (“Pass”, {}) forces a Pass action; (“PickupObject”, {}) + forces a PickupObject action with any parameters; and + (“PickupObject”, {“objectId”: “a”}) forces a PickupObject action with + the specific parameters objectId=a. + An action_list of None or an empty list means that all actions will + be available for the next step. + Derived from GoalMetadata.action_list. May be a subset of all possible actions. See [Actions](#Actions). @@ -345,10 +388,12 @@ Defines output metadata from an action step in the MCS 3D environment. * **depth_map_list** (*list of 2D numpy arrays*) – The list of 2-dimensional numpy arrays of depth float data from the scene after the last action and physics simulation were run. This is usually a list with 1 array, except for the output from start_scene - for a scene with a scripted Preview Phase. + for a scene with a scripted Preview Phase (Preview Phase case details + TBD). Each depth float in a 2-dimensional numpy array is a value between 0 and the camera’s far clipping plane (default 15) correspondings to the depth in simulation units at that pixel in the image. + Note that this list will be empty if the metadata level is ‘none’. * **goal** (*GoalMetadata** or **None*) – The goal for the whole scene. Will be None in “Exploration” scenes. @@ -366,25 +411,37 @@ Defines output metadata from an action step in the MCS 3D environment. * **image_list** (*list of Pillow.Image objects*) – The list of images from the scene after the last action and physics simulation were run. This is usually a list with 1 image, except for the output from start_scene for a scene with a scripted Preview Phase. + (Preview Phase case details TBD). * **object_list** (*list of ObjectMetadata objects*) – The list of metadata for all the visible interactive objects in the - scene. For metadata on structural objects like walls, please see - structural_object_list + scene. This list will be empty if using a metadata level below + the ‘oracle’ level. For metadata on structural objects like walls, + please see structural_object_list * **object_mask_list** (*list of Pillow.Image objects*) – The list of object mask (instance segmentation) images from the scene after the last action and physics simulation were run. This is usually a list with 1 image, except for the output from start_scene for a - scene with a scripted Previous Phase. + scene with a scripted Preview Phase (Preview Phase case details TBD). The color of each object in the mask corresponds to the “color” property in its ObjectMetadata object. + Note that this list will be empty if the metadata level is ‘none’ + or ‘level1’. + + + * **performer_radius** (*float*) – The radius of the performer. + + + * **performer_reach** (*float*) – The max reach of the performer. * **pose** (*string*) – Your current pose. Either “STANDING”, “CRAWLING”, or “LYING”. * **position** (*dict*) – The “x”, “y”, and “z” coordinates for your global position. + Will be set to ‘None’ if using a metadata level below the + ‘oracle’ level. * **return_status** (*string*) – The return status from your last action. See [Actions](#Actions). @@ -393,20 +450,31 @@ Defines output metadata from an action step in the MCS 3D environment. * **reward** (*integer*) – Reward is 1 on successful completion of a task, 0 otherwise. - * **rotation** (*float*) – Your current rotation angle in degrees. + * **rotation** (*float*) – Your current rotation angle in degrees. Will be set to ‘None’ + if using a metadata level below the ‘oracle’ level. * **step_number** (*integer*) – The step number of your last action, recorded since you started the current scene. + * **physics_frames_per_second** (*float*) – The frames per second of the physics engine + + * **structural_object_list** (*list of ObjectMetadata objects*) – The list of metadata for all the visible structural objects (like - walls, occluders, and ramps) in the scene. Please note that occluders - are composed of two separate objects, the “wall” and the “pole”, with - corresponding object IDs (occluder_wall_ and - occluder_pole_), and ramps are composed of between one and three - objects (depending on the type of ramp), with corresponding object IDs. + walls, occluders, and ramps) in the scene. This list will be empty + if using a metadata level below the ‘oracle’ level. + Please note that occluders are composed of two separate objects, + the “wall” and the “pole”, with corresponding object IDs + (occluder_wall_ and occluder_pole_), and ramps are + composed of between one and three objects (depending on the type + of ramp), with corresponding object IDs. + + +#### copy_without_depth_or_images() +Return a deep copy of this StepMetadata with default depth_map_list, +image_list, and object_mask_list properties. ## Actions @@ -1133,22 +1201,13 @@ of movement (kinematics, gravity, friction, etc.). * **target.id** (*string*) – The objectId of the target object to retrieve. - - - * **target.image** (*list of numpy arrays*) – An image of the target object to retrieve, given as a 3D RGB pixel - array. + Will only be available at oracle metadata level. * **target.info** (*list of strings*) – Human-readable information describing the target object needed for the visualization interface. - * **target.match_image** (*string*) – Whether the image of the target object (target.image) exactly matches - the actual target object in the scene. If false, then the actual object - will be different in one way (for example, the image may depict a blue - ball, but the actual object is a yellow ball, or a blue cube). - - #### TRANSFERRAL( = 'transferral') In a trial that has a transferral goal, you must find and pickup the diff --git a/machine_common_sense/DEV.md b/machine_common_sense/DEV.md index 87fc65e49..85566edf8 100644 --- a/machine_common_sense/DEV.md +++ b/machine_common_sense/DEV.md @@ -115,18 +115,6 @@ The following string properties can be specified in order to upload and organize - s3_bucket - s3_folder -#### debug - -(boolean) - -Whether to save MCS output debug files in this folder and print debug output to terminal. Will default to `False`. In lieu of a config file, this can be set using the `MCS_DEBUG_MODE` environment variable. - -#### debug_output - -(string) - -Alternatively to the `debug` property, `debug_output` can be used to either print debug info to the terminal or to debug files only. This should either be set to `file` or `terminal`, and will default to None. Will be ignored if `debug` or `MCS_DEBUG_MODE` is set. - #### evaluation (boolean) @@ -156,7 +144,8 @@ The `metadata` property describes what metadata will be returned by the MCS Pyth - `level1`: Only returns the images (with depth masks but NOT object masks), camera info, and properties corresponding to the player themself (like head tilt or pose). No information about specific objects will be included. - `none`: Only returns the images (but not the masks), camera info, and properties corresponding to the player themself (like head tilt or pose). No information about specific objects will be included. -Otherwise, return the metadata for the visible and held objects. +If no metadata level is set: +- `default`: Fallback if no metadata level is specified. Only meant for use during development (evaluations will never be run this way). Includes metadata for visible and held objects in the scene, as well as camera info and properties corresponding to the player. Does not include depth maps or object masks. #### noise_enabled diff --git a/machine_common_sense/__init__.py b/machine_common_sense/__init__.py index 56dba772f..d0a2335bd 100644 --- a/machine_common_sense/__init__.py +++ b/machine_common_sense/__init__.py @@ -1,3 +1,7 @@ +import logging +import logging.config +import ast +from os.path import exists import json import signal @@ -20,6 +24,10 @@ from ._version import __version__ +logger = logging.getLogger(__name__) +# Set default logging handler to avoid "No handler found" warnings +logger.addHandler(logging.NullHandler()) + # Timeout at 3 minutes (180 seconds). It was 60 seconds but # this can cause timeouts on EC2 instances TIME_LIMIT_SECONDS = 180 @@ -92,3 +100,29 @@ def load_scene_json_file(scene_json_file_path): except IOError: return {}, "The given file '" + scene_json_file_path + \ "' cannot be found." + + +def init_logging(): + """ + Initializes logging system. Attempts to read user file first, + which should not be checked in and each user can have their own. + If user file doesn't exist, then there is a base config file that + should be read. + """ + log_config_base = "scripts/log.config.py" + log_config_user = "scripts/log.config.user.py" + log_config_file = None + if (exists(log_config_user)): + log_config_file = log_config_user + if (exists(log_config_base)): + log_config_file = log_config_base + if (log_config_file is not None): + with open(log_config_file, "r") as data: + logConfig = ast.literal_eval(data.read()) + logging.config.dictConfig(logConfig) + logger.info( + "Loaded logging config from " + log_config_file) + else: + print( + "Error initializing logging. No file found at " + + log_config_base + " or " + log_config_user) diff --git a/machine_common_sense/_version.py b/machine_common_sense/_version.py index 512ce8919..a98734733 100644 --- a/machine_common_sense/_version.py +++ b/machine_common_sense/_version.py @@ -1 +1 @@ -__version__ = '0.4.1.1' +__version__ = '0.4.2' diff --git a/machine_common_sense/config_manager.py b/machine_common_sense/config_manager.py index 5ac2cf6f9..3c2f7aca8 100644 --- a/machine_common_sense/config_manager.py +++ b/machine_common_sense/config_manager.py @@ -1,8 +1,12 @@ import os +import logging import configparser # noqa: F401 import yaml # noqa: F401 +logger = logging.getLogger(__name__) + + class ConfigManager(object): CONFIG_FILE_ENV_VAR = 'MCS_CONFIG_FILE_PATH' @@ -13,8 +17,6 @@ class ConfigManager(object): CONFIG_AWS_ACCESS_KEY_ID = 'aws_access_key_id' CONFIG_AWS_SECRET_ACCESS_KEY = 'aws_secret_access_key' - CONFIG_DEBUG = 'debug' - CONFIG_DEBUG_OUTPUT = 'debug_output' CONFIG_EVALUATION = 'evaluation' CONFIG_EVALUATION_NAME = 'evaluation_name' CONFIG_HISTORY_ENABLED = 'history_enabled' @@ -22,6 +24,8 @@ class ConfigManager(object): CONFIG_NOISE_ENABLED = 'noise_enabled' CONFIG_S3_BUCKET = 's3_bucket' CONFIG_S3_FOLDER = 's3_folder' + CONFIG_SAVE_DEBUG_IMAGES = 'save_debug_images' + CONFIG_SAVE_DEBUG_JSON = 'save_debug_json' CONFIG_SEED = 'seed' CONFIG_SIZE = 'size' CONFIG_TEAM = 'team' @@ -49,18 +53,9 @@ def _read_config_file(self): self._config = configparser.ConfigParser() if os.path.exists(self._config_file): self._config.read(self._config_file) - - debug_to_terminal = ( - self.is_debug() or self.get_debug_output() == 'terminal' - ) - - print('MCS Config File Path: ' + self._config_file) - if debug_to_terminal is True: - print('Read MCS Config File:') - print({section: dict(self._config[section]) - for section in self._config.sections()}) + logger.info('Config File Path: ' + self._config_file) else: - print('No MCS Config File') + logger.info('No Config File') def _validate_screen_size(self): if(self.get_size() < self.SCREEN_WIDTH_MIN): @@ -84,13 +79,6 @@ def get_aws_secret_access_key(self): fallback=None ) - def get_debug_output(self): - return self._config.get( - self.CONFIG_DEFAULT_SECTION, - self.CONFIG_DEBUG_OUTPUT, - fallback=None - ) - def get_evaluation_name(self): return self._config.get( self.CONFIG_DEFAULT_SECTION, @@ -106,7 +94,7 @@ def get_metadata_tier(self): return self._config.get( self.CONFIG_DEFAULT_SECTION, self.CONFIG_METADATA_TIER, - fallback='' + fallback='default' ) return metadata_env_var @@ -146,24 +134,6 @@ def get_team(self): fallback='' ) - def is_debug(self): - # Environment variable override for debug mode - debug_env_var = os.getenv('MCS_DEBUG_MODE', None) - - if(debug_env_var is None): - return self._config.getboolean( - self.CONFIG_DEFAULT_SECTION, - self.CONFIG_DEBUG, - fallback=False - ) - - if(debug_env_var is None or - debug_env_var.lower() == 'false' or - debug_env_var == '0' or debug_env_var == ''): - return False - else: - return True - def is_evaluation(self): return self._config.getboolean( self.CONFIG_DEFAULT_SECTION, @@ -185,6 +155,20 @@ def is_noise_enabled(self): fallback=False ) + def is_save_debug_images(self): + return self._config.getboolean( + self.CONFIG_DEFAULT_SECTION, + self.CONFIG_SAVE_DEBUG_IMAGES, + fallback=False + ) + + def is_save_debug_json(self): + return self._config.getboolean( + self.CONFIG_DEFAULT_SECTION, + self.CONFIG_SAVE_DEBUG_JSON, + fallback=False + ) + def is_video_enabled(self): return self._config.getboolean( self.CONFIG_DEFAULT_SECTION, diff --git a/machine_common_sense/controller.py b/machine_common_sense/controller.py index 541acc6e6..f9b7c07f5 100644 --- a/machine_common_sense/controller.py +++ b/machine_common_sense/controller.py @@ -2,6 +2,7 @@ import datetime import glob import json +import logging import numpy as np import os import random @@ -14,18 +15,17 @@ import ai2thor.controller import ai2thor.server + +logger = logging.getLogger(__name__) + + # How far the player can reach. I think this value needs to be bigger # than the MAX_MOVE_DISTANCE or else the player may not be able to move # into a position to reach some objects (it may be mathematically impossible). # TODO Reduce this number once the player can crouch down to reach and # pickup small objects on the floor. -MAX_REACH_DISTANCE = 1.0 -# How far the player can move with a single step. -MOVE_DISTANCE = 0.1 - -# Performer camera 'y' position -PERFORMER_CAMERA_Y = 0.4625 +DEFAULT_MOVE = 0.1 from .action import Action from .goal_metadata import GoalMetadata @@ -99,7 +99,6 @@ class Controller(): Path to configuration file to read in and set various properties, such as metadata level and whether or not to save history files (default None) - """ ACTION_LIST = [(item.value, {}) for item in Action] @@ -171,6 +170,10 @@ class Controller(): # feedback CONFIG_METADATA_TIER_NONE = 'none' + # Default metadata level if none specified, meant for use during + # development + CONFIG_METADATA_TIER_DEFAULT = 'default' + AWS_CREDENTIALS_FOLDER = os.path.expanduser('~') + '/.aws/' AWS_CREDENTIALS_FILE = os.path.expanduser('~') + '/.aws/credentials' @@ -237,13 +240,6 @@ def _update_internal_config(self, noise_enabled=None, seed=None, def _on_init(self, config_file_path=None): - self.__debug_to_file = True if ( - self._config.is_debug() is True or - self._config.get_debug_output() == 'file') else False - self.__debug_to_terminal = True if ( - self._config.is_debug() is True or - self._config.get_debug_output() == 'terminal') else False - self.__noise_enabled = self._config.is_noise_enabled() self.__seed = self._config.get_seed() self.__history_enabled = self._config.is_history_enabled() @@ -254,7 +250,8 @@ def _on_init(self, config_file_path=None): self._goal = GoalMetadata() self.__habituation_trial = 1 self.__head_tilt = 0.0 - self.__output_folder = None # Save output image files to debug + # Output folder used to save debug image, video, and JSON files. + self.__output_folder = None self.__scene_configuration = None self.__step_number = 0 self.__history_writer = None @@ -315,24 +312,18 @@ def _create_video_recorders(self, timestamp): self.PLACEHOLDER, self.VISUAL) self.__image_recorder = VideoRecorder( vid_path=output_folder / visual_video_filename, - width=self.__screen_width, - height=self.__screen_height, fps=self.FPS_FRAME_RATE) topdown_video_filename = basename_template.replace( self.PLACEHOLDER, self.TOPDOWN) self.__topdown_recorder = VideoRecorder( vid_path=output_folder / topdown_video_filename, - width=self.__screen_width, - height=self.__screen_height, fps=self.FPS_FRAME_RATE) heatmap_video_filename = basename_template.replace( self.PLACEHOLDER, self.HEATMAP) self.__heatmap_recorder = VideoRecorder( vid_path=output_folder / heatmap_video_filename, - width=self.__screen_width, - height=self.__screen_height, fps=self.FPS_FRAME_RATE) if self.__depth_maps: @@ -340,8 +331,6 @@ def _create_video_recorders(self, timestamp): self.PLACEHOLDER, self.DEPTH) self.__depth_recorder = VideoRecorder( vid_path=output_folder / depth_video_filename, - width=self.__screen_width, - height=self.__screen_height, fps=self.FPS_FRAME_RATE) if self.__object_masks: @@ -349,8 +338,6 @@ def _create_video_recorders(self, timestamp): self.PLACEHOLDER, self.SEGMENTATION) self.__segmentation_recorder = VideoRecorder( vid_path=output_folder / segmentation_video_filename, - width=self.__screen_width, - height=self.__screen_height, fps=self.FPS_FRAME_RATE) def end_scene(self, choice, confidence=1.0): @@ -499,20 +486,16 @@ def start_scene(self, config_data): skip_preview_phase = (True if 'goal' in config_data and 'skip_preview_phase' in config_data['goal'] else False) - if self.__debug_to_terminal: - if config_data['name']: - print("STARTING NEW SCENE: " + config_data['name']) - else: - print("STARTING NEW SCENE") - if self._metadata_tier: - print("METADATA TIER: " + self._metadata_tier) - else: - print("METADATA TIER: DEFAULT (NOT CONFIGURED)") - print("STEP: 0") - print("ACTION: Initialize") + + logger.debug("STARTING NEW SCENE: " + config_data.get('name', "")) + logger.debug("METADATA TIER: " + self._metadata_tier) + logger.debug("STEP: 0") + logger.debug("ACTION: Initialize") if (config_data['name'] is not None and ( - self.__debug_to_file or self._config.is_evaluation() or + self._config.is_evaluation() or + self._config.is_save_debug_images() or + self._config.is_save_debug_json() or self._config.is_video_enabled() )): os.makedirs('./' + config_data['name'], exist_ok=True) @@ -525,16 +508,18 @@ def start_scene(self, config_data): team = self._config.get_team() scene = self.__scene_configuration.get( 'name', '').replace('json', '') - self.__plotter = TopDownPlotter( - team, scene, self.__screen_width, self.__screen_height) + self.__plotter = TopDownPlotter(team, scene) self._create_video_recorders(timestamp) pre_restrict_output = self.wrap_output(self._controller.step( self.wrap_step(action='Initialize', sceneConfig=config_data))) - output = self.restrict_step_output_metadata(pre_restrict_output) + debug_copy = pre_restrict_output.copy_without_depth_or_images() - self.write_debug_output(output) + output = self.restrict_step_output_metadata( + copy.deepcopy(pre_restrict_output)) + + self.write_debug_output(debug_copy) if not skip_preview_phase: if (self._goal is not None and @@ -543,8 +528,7 @@ def start_scene(self, config_data): depth_map_list = output.depth_map_list object_mask_list = output.object_mask_list - if self.__debug_to_terminal: - print('STARTING PREVIEW PHASE...') + logger.debug('STARTING PREVIEW PHASE...') for i in range(0, self._goal.last_preview_phase_step): output = self.step('Pass') @@ -553,8 +537,7 @@ def start_scene(self, config_data): object_mask_list = (object_mask_list + output.object_mask_list) - if self.__debug_to_terminal: - print('ENDING PREVIEW PHASE') + logger.debug('ENDING PREVIEW PHASE') if ( self._config.is_evaluation() or @@ -565,8 +548,8 @@ def start_scene(self, config_data): output.image_list = image_list output.depth_map_list = depth_map_list output.object_mask_list = object_mask_list - elif self.__debug_to_terminal: - print('NO PREVIEW PHASE') + + logger.debug('NO PREVIEW PHASE') if(self._end_scene_not_registered is True and (self.__history_enabled or self._config.is_evaluation())): @@ -585,7 +568,7 @@ def start_scene(self, config_data): """ def validate_and_convert_params(self, action, **kwargs): - moveMagnitude = MOVE_DISTANCE + moveMagnitude = DEFAULT_MOVE rotation = kwargs.get(self.ROTATION_KEY, self.DEFAULT_ROTATION) horizon = kwargs.get(self.HORIZON_KEY, self.DEFAULT_HORIZON) amount = kwargs.get( @@ -662,7 +645,7 @@ def validate_and_convert_params(self, action, **kwargs): moveMagnitude = amount if action in self.MOVE_ACTIONS: - moveMagnitude = MOVE_DISTANCE + moveMagnitude = DEFAULT_MOVE # Add in noise if noise is enable if self.__noise_enabled: @@ -740,16 +723,19 @@ def step(self, action: str, **kwargs) -> StepMetadata: if (self._goal.last_step is not None and self._goal.last_step == self.__step_number): - print( - "MCS Warning: You have passed the last step for this scene. " + - "Ignoring your action. Please call controller.end_scene() " + + logger.warning( + "You have passed the last step for this scene. " + "Ignoring your action. Please call controller.end_scene() " "now.") return None if ',' in action: action, kwargs = Util.input_to_action_and_params(action) - action_list = self.retrieve_action_list(self._goal, self.__step_number) + action_list = self.retrieve_action_list_at_step( + self._goal, + self.__step_number + ) # Only continue with this action step if the given action and # parameters are in the restricted action list. continue_with_step = False @@ -764,37 +750,30 @@ def step(self, action: str, **kwargs) -> StepMetadata: continue_with_step = True break if not continue_with_step: - print( - f"MCS Warning: The given action '{action}' with parameters " + logger.warning( + f"The given action '{action}' with parameters " f"'{kwargs}' isn't in the action_list. Ignoring your action. " f"Please call controller.step() with an action in the " - f"action_list." - ) - action_string_list = self.retrieve_action_list( - self._goal, - self.__step_number, - string_list=True - ) - print( - f"Actions (Step {self.__step_number}): " - f"{'; '.join(action_string_list)}" + f"action_list. Possible actions at step {self.__step_number}:" ) + for action_data in action_list: + logger.warning(f' {action_data}') return None self.__step_number += 1 - if self.__debug_to_terminal: - print("================================================" + - "===============================") - print("STEP: " + str(self.__step_number)) - print("ACTION: " + action) - if self._goal.habituation_total >= self.__habituation_trial: - print("HABITUATION TRIAL: " + str(self.__habituation_trial) + - " / " + str(self._goal.habituation_total)) - elif self._goal.habituation_total > 0: - print("HABITUATION TRIAL: DONE") - else: - print("HABITUATION TRIAL: NONE") + logger.debug("================================================" + "===============================") + logger.debug("STEP: " + str(self.__step_number)) + logger.debug("ACTION: " + action) + if self._goal.habituation_total >= self.__habituation_trial: + logger.debug(f"HABITUATION TRIAL: " + f"{str(self.__habituation_trial)}" + f" / {str(self._goal.habituation_total)}") + elif self._goal.habituation_total > 0: + logger.debug("HABITUATION TRIAL: DONE") + else: + logger.debug("HABITUATION TRIAL: NONE") params = self.validate_and_convert_params(action, **kwargs) @@ -807,29 +786,27 @@ def step(self, action: str, **kwargs) -> StepMetadata: if (self._goal.last_step is not None and self._goal.last_step == self.__step_number): - print( - "MCS Warning: This is your last step for this scene. All " + - "your future actions will be skipped. Please call " + + logger.warning( + "This is your last step for this scene. All " + "your future actions will be skipped. Please call " "controller.end_scene() now.") pre_restrict_output = self.wrap_output(self._controller.step( self.wrap_step(action=action, **params))) - history_copy = copy.deepcopy(pre_restrict_output) - del history_copy.depth_map_list - del history_copy.image_list - del history_copy.object_mask_list + history_debug_copy = pre_restrict_output.copy_without_depth_or_images() self.__history_item = SceneHistory( step=self.__step_number, action=action, args=kwargs, params=params, - output=history_copy, + output=history_debug_copy, delta_time_millis=0) - output = self.restrict_step_output_metadata(pre_restrict_output) + output = self.restrict_step_output_metadata( + copy.deepcopy(pre_restrict_output)) - self.write_debug_output(output) + self.write_debug_output(history_debug_copy) return output @@ -960,7 +937,9 @@ def restrict_step_output_metadata(self, step_output): return step_output - def retrieve_action_list(self, goal, step_number, string_list=False): + def retrieve_action_list_at_step(self, goal, step_number): + """Return the action list from the given goal at the given step as a + a list of actions tuples by default.""" if goal is not None and goal.action_list is not None: if step_number < goal.last_preview_phase_step: return ['Pass'] @@ -969,14 +948,9 @@ def retrieve_action_list(self, goal, step_number, string_list=False): adjusted_step = step_number - goal.last_preview_phase_step if len(goal.action_list) > adjusted_step: if len(goal.action_list[adjusted_step]) > 0: - return [ - Util.input_to_action_and_params(action) - for action in goal.action_list[adjusted_step] - ] if not string_list else goal.action_list[adjusted_step] + return goal.action_list[adjusted_step] - return self.ACTION_LIST if not string_list else [ - action[0] for action in self.ACTION_LIST - ] + return self.ACTION_LIST def retrieve_goal(self, scene_configuration): goal_config = ( @@ -985,12 +959,21 @@ def retrieve_goal(self, scene_configuration): else {} ) + # Transform action list data from strings to tuples. + action_list = goal_config.get('action_list', []) + for index, action_list_at_step in enumerate(action_list): + action_list[index] = [ + Util.input_to_action_and_params(action) + if isinstance(action, str) else action + for action in action_list_at_step + ] + if 'category' in goal_config: # Backwards compatibility goal_config['metadata']['category'] = goal_config['category'] return self.update_goal_target_image(GoalMetadata( - action_list=goal_config.get('action_list', None), + action_list=(action_list if action_list else None), category=goal_config.get('category', ''), description=goal_config.get('description', ''), habituation_total=goal_config.get('habituation_total', 0), @@ -1016,7 +999,7 @@ def retrieve_object_colors(self, scene_event): def retrieve_object_list(self, scene_event): # Return object list for all tier levels, the restrict output function # will then strip out the necessary metadata - if (self._metadata_tier != ''): + if (self._metadata_tier != self.CONFIG_METADATA_TIER_DEFAULT): return sorted( [ self.retrieve_object_output( @@ -1080,10 +1063,10 @@ def retrieve_object_output(self, object_metadata, object_id_to_color): ), direction=object_metadata['direction'], distance=( - object_metadata['distanceXZ'] / MOVE_DISTANCE + object_metadata['distanceXZ'] / DEFAULT_MOVE ), # DEPRECATED distance_in_steps=( - object_metadata['distanceXZ'] / MOVE_DISTANCE + object_metadata['distanceXZ'] / DEFAULT_MOVE ), distance_in_world=(object_metadata['distance']), held=object_metadata['isPickedUp'], @@ -1099,7 +1082,9 @@ def retrieve_object_output(self, object_metadata, object_id_to_color): visible=( object_metadata['visibleInCamera'] or object_metadata['isPickedUp'] - ) + ), + is_open=object_metadata['isOpen'], + openable=object_metadata['openable'] ) def retrieve_object_states(self, object_id): @@ -1127,9 +1112,8 @@ def retrieve_pose(self, scene_event) -> str: try: pose = Pose[scene_event.metadata['pose']].name except KeyError: - print( - "Pose " + - scene_event.metadata['pose'] + + logger.error( + "Pose {scene_event.metadata['pose']}" " is not currently supported.") finally: return pose @@ -1148,9 +1132,8 @@ def retrieve_return_status(self, scene_event): scene_event.metadata['lastActionStatus'] ].name except KeyError: - print( - "Return status " + - scene_event.metadata['lastActionStatus'] + + logger.error( + "Return status {scene_event.metadata['lastActionStatus']}" " is not currently supported.") finally: return return_status @@ -1158,7 +1141,7 @@ def retrieve_return_status(self, scene_event): def retrieve_structural_object_list(self, scene_event): # Return structural object list for all tier levels, the restrict # output function will then strip out the necessary metadata - if (self._metadata_tier != ''): + if (self._metadata_tier != self.CONFIG_METADATA_TIER_DEFAULT): return sorted( [ self.retrieve_object_output( @@ -1241,7 +1224,7 @@ def save_images(self, scene_event, max_depth): ): self.__segmentation_recorder.add(object_mask) - if self.__debug_to_file and self.__output_folder is not None: + if self.__output_folder and self._config.is_save_debug_images: step_plus_substep_index = 0 if self.__step_number == 0 else ( ((self.__step_number - 1) * len(scene_event.events)) + (index + 1) @@ -1264,7 +1247,7 @@ def stop_simulation(self): self._controller.stop() def wrap_output(self, scene_event): - if self.__debug_to_file and self.__output_folder is not None: + if self.__output_folder and self._config.is_save_debug_json: with open(self.__output_folder + 'ai2thor_output_' + str(self.__step_number) + '.json', 'w') as json_file: json.dump({ @@ -1282,8 +1265,10 @@ def wrap_output(self, scene_event): objects = scene_event.metadata.get('objects', None) agent = scene_event.metadata.get('agent', None) step_output = StepMetadata( - action_list=self.retrieve_action_list( - self._goal, self.__step_number), + action_list=self.retrieve_action_list_at_step( + self._goal, + self.__step_number + ), camera_aspect_ratio=(self.__screen_width, self.__screen_height), camera_clipping_planes=( scene_event.metadata.get('clippingPlaneNear', 0.0), @@ -1305,11 +1290,16 @@ def wrap_output(self, scene_event): object_mask_list=object_mask_list, pose=self.retrieve_pose(scene_event), position=self.retrieve_position(scene_event), + performer_radius=scene_event.metadata.get('performerRadius'), + performer_reach=scene_event.metadata.get('performerReach'), return_status=self.retrieve_return_status(scene_event), reward=Reward.calculate_reward( - self._goal, objects, agent, self.__step_number), + self._goal, objects, agent, self.__step_number, + scene_event.metadata.get('performerReach')), rotation=self.retrieve_rotation(scene_event), step_number=self.__step_number, + physics_frames_per_second=scene_event.metadata.get( + 'physicsFramesPerSecond'), structural_object_list=self.retrieve_structural_object_list( scene_event) ) @@ -1318,25 +1308,32 @@ def wrap_output(self, scene_event): return step_output - def write_debug_output(self, step_output): - if self.__debug_to_terminal: - print("RETURN STATUS: " + step_output.return_status) - print("REWARD: " + str(step_output.reward)) - print("SELF METADATA:") - print(" CAMERA HEIGHT: " + str(step_output.camera_height)) - print(" HEAD TILT: " + str(step_output.head_tilt)) - print(" POSITION: " + str(step_output.position)) - print(" ROTATION: " + str(step_output.rotation)) - print("OBJECTS: " + str(len(step_output.object_list)) + " TOTAL") - if len(step_output.object_list) > 0: - for line in Util.generate_pretty_object_output( - step_output.object_list): - print(" " + line) - - if self.__debug_to_file and self.__output_folder is not None: - with open(self.__output_folder + 'mcs_output_' + - str(self.__step_number) + '.json', 'w') as json_file: - json_file.write(str(step_output)) + def write_debug_output(self, step_output_copy): + restricted_output = self.restrict_step_output_metadata( + step_output_copy + ) + logger.debug("RETURN STATUS: " + restricted_output.return_status) + logger.debug("REWARD: " + str(restricted_output.reward)) + logger.debug("SELF METADATA:") + logger.debug( + " CAMERA HEIGHT: " + str(restricted_output.camera_height) + ) + logger.debug(" HEAD TILT: " + str(restricted_output.head_tilt)) + logger.debug(" POSITION: " + str(restricted_output.position)) + logger.debug(" ROTATION: " + str(restricted_output.rotation)) + logger.debug( + "OBJECTS: " + str(len(restricted_output.object_list)) + " TOTAL" + ) + if len(restricted_output.object_list) > 0: + for line in Util.generate_pretty_object_output( + restricted_output.object_list + ): + logger.debug(" " + line) + + if self.__output_folder and self._config.is_save_debug_json: + json_filename = 'mcs_output_' + str(self.__step_number) + '.json' + with open(self.__output_folder + json_filename, 'w') as json_file: + json_file.write(str(restricted_output)) def wrap_step(self, **kwargs): # whether or not to randomize segmentation mask colors @@ -1353,14 +1350,11 @@ def wrap_step(self, **kwargs): renderDepthImage=self.__depth_maps, renderObjectImage=self.__object_masks, snapToGrid=False, - # Yes, in AI2-THOR, the player's reach appears to be - # governed by the "visibilityDistance", confusingly... - visibilityDistance=MAX_REACH_DISTANCE, consistentColors=consistentColors, **kwargs ) - if self.__debug_to_file and self.__output_folder is not None: + if self.__output_folder and self._config.is_save_debug_json: with open(self.__output_folder + 'ai2thor_input_' + str(self.__step_number) + '.json', 'w') as json_file: json.dump(step_data, json_file, sort_keys=True, indent=4) @@ -1378,3 +1372,15 @@ def generate_noise(self): """ return random.uniform(-0.5, 0.5) + + def get_metadata_level(self): + """ + Returns the current metadata level set in the config. If none + specified, returns 'default'. + + Returns + ------- + string + A string containing the current metadata level. + """ + return self._metadata_tier diff --git a/machine_common_sense/goal_metadata.py b/machine_common_sense/goal_metadata.py index ff60c2070..c650a0ecf 100644 --- a/machine_common_sense/goal_metadata.py +++ b/machine_common_sense/goal_metadata.py @@ -8,14 +8,22 @@ class GoalMetadata: Attributes ---------- - action_list : list of lists of strings, or None - The list of actions that are available for the scene at each step - (outer list index). Each inner list item is a list of action strings. - For example, ['MoveAhead','RotateLook,rotation=180'] restricts the - actions to either 'MoveAhead' or 'RotateLook' with the 'rotation' - parameter set to 180. An action_list of None means that all - actions are always available. An empty inner list means that all - actions are available for that specific step. + action_list : list of lists of (string, dict) tuples, or None + The list of all actions that are available for the scene at each step + (outer list). Each inner list is the list of all actions that are + available for the single step corresponding to the inner list's index + within the outer list. Each action is returned as a tuple containing + the action string and the action's restricted paramters, if any. + For example: ("Pass", {}) forces a Pass action; ("PickupObject", {}) + forces a PickupObject action with any parameters; and + ("PickupObject", {"objectId": "a"}) forces a PickupObject action with + the specific parameters objectId=a. + An action_list of None means that all actions are always available. + An empty inner list means that all actions will be available on that + specific step. + See StepMetadata.action_list for the available actions of the current + step. + May be a subset of all possible actions. See [Actions](#Actions). category : string The category that describes this goal and the properties in its metadata. See [Goals](#Goals). @@ -153,20 +161,12 @@ class GoalCategory(Enum): ---------- target.id : string The objectId of the target object to retrieve. - - target.image : list of numpy arrays - An image of the target object to retrieve, given as a 3D RGB pixel - array. + Will only be available at `oracle` metadata level. target.info : list of strings Human-readable information describing the target object needed for the visualization interface. - target.match_image : string - Whether the image of the target object (target.image) exactly matches - the actual target object in the scene. If false, then the actual object - will be different in one way (for example, the image may depict a blue - ball, but the actual object is a yellow ball, or a blue cube). """ TRANSFERRAL = "transferral" diff --git a/machine_common_sense/history_writer.py b/machine_common_sense/history_writer.py index d11f53710..c3d48e1b8 100644 --- a/machine_common_sense/history_writer.py +++ b/machine_common_sense/history_writer.py @@ -1,11 +1,15 @@ from .util import Util from .scene_history import SceneHistory from typing import Dict +import logging import json import os from time import perf_counter +logger = logging.getLogger(__name__) + + class HistoryWriter(object): HISTORY_DIRECTORY = "SCENE_HISTORY" @@ -19,15 +23,16 @@ def __init__(self, scene_config_data=None, hist_info={}, timestamp=''): self.last_step_time_millis = perf_counter() * 1000 if not os.path.exists(self.HISTORY_DIRECTORY): + logger.debug(f"Making history directory {self.HISTORY_DIRECTORY}") os.makedirs(self.HISTORY_DIRECTORY) scene_name = scene_config_data['name'] prefix_directory = None if '/' in scene_name: prefix, scene_basename = scene_name.rsplit('/', 1) - print(f"{prefix} {scene_basename}") prefix_directory = os.path.join(self.HISTORY_DIRECTORY, prefix) if not os.path.exists(prefix_directory): + logger.debug(f"Making prefix directory {prefix_directory}") os.makedirs(prefix_directory) if ('screenshot' not in scene_config_data or @@ -42,6 +47,7 @@ def __init__(self, scene_config_data=None, hist_info={}, timestamp=''): def write_file(self): if self.scene_history_file: + logger.info(f"Saving history file {self.scene_history_file}") with open(self.scene_history_file, "a+") as history_file: history_file.write(json.dumps(self.history_obj)) @@ -74,6 +80,7 @@ def add_step(self, step_obj: Dict): step_obj.delta_time_millis = current_time - \ self.last_step_time_millis self.last_step_time_millis = current_time + logger.debug("Adding history step") self.current_steps.append( dict(self.filter_history_output(step_obj))) diff --git a/machine_common_sense/object_metadata.py b/machine_common_sense/object_metadata.py index 68623ff07..aae20c6c0 100644 --- a/machine_common_sense/object_metadata.py +++ b/machine_common_sense/object_metadata.py @@ -52,6 +52,10 @@ class ObjectMetadata(object): This object's colors, derived from its textures, in plain English. visible : boolean Whether you can see this object in your camera viewport. + is_open : boolean + Whether the object is open or not + openable : boolean + Whether the object can be opened """ def __init__( @@ -71,7 +75,9 @@ def __init__( shape="", state_list=None, texture_color_list=None, - visible=False + visible=False, + is_open=False, + openable=False ): self.uuid = uuid self.color = {} if color is None else color @@ -91,6 +97,8 @@ def __init__( [] if texture_color_list is None else texture_color_list ) self.visible = visible + self.is_open = is_open + self.openable = openable def __str__(self): return Util.class_to_str(self) @@ -114,3 +122,5 @@ def __iter__(self): yield 'state_list', self.state_list yield 'texture_color_list', self.texture_color_list yield 'visible', self.visible + yield 'is_open', self.is_open + yield 'openable', self.openable diff --git a/machine_common_sense/plotter.py b/machine_common_sense/plotter.py index ceeb43940..a2be3e8f7 100644 --- a/machine_common_sense/plotter.py +++ b/machine_common_sense/plotter.py @@ -41,14 +41,11 @@ class TopDownPlotter(): MAXIMUM_ROOM_DIMENSION = 5 BORDER = 0.05 - def __init__(self, team: str, scene_name: str, - plot_width: int, plot_height: int): + def __init__(self, team: str, scene_name: str): self._team = team if '/' in scene_name: scene_name = scene_name.rsplit('/', 1)[1] self._scene_name = scene_name - self._plot_width = plot_width - self._plot_height = plot_height def plot(self, scene_event: ai2thor.server.Event, step_number: int, @@ -96,9 +93,7 @@ def _export_plot(self, plt: matplotlib.pyplot) -> PIL.Image.Image: fig.savefig(buf) buf.seek(0) img = PIL.Image.open(buf) - # resize image to match screen dimensions - # current video recorders require it for now - return img.resize((self._plot_width, self._plot_height)) + return img def _draw_robot(self, robot_metadata: Dict) -> None: '''Plot the robot position and heading''' diff --git a/machine_common_sense/recorder.py b/machine_common_sense/recorder.py index 52b887bab..c89bd1aa5 100644 --- a/machine_common_sense/recorder.py +++ b/machine_common_sense/recorder.py @@ -1,4 +1,5 @@ import time +import logging import pathlib import threading import queue @@ -7,14 +8,14 @@ import PIL import numpy as np +logger = logging.getLogger(__name__) + class VideoRecorder(): '''Threaded video recorder''' def __init__(self, vid_path: pathlib.Path, - width: int, - height: int, fps: int, fourcc: str = 'mp4v', timeout: float = 1.0): @@ -22,8 +23,6 @@ def __init__(self, Args: vid_path (pathlib.path): the output video file path - width (int): video width dimension - height (int): video height dimension fps (int): video frame rate per second fourcc (str): opencv fourcc / codec string timeout (float): thread sleep timeout @@ -38,15 +37,15 @@ def __init__(self, self.timeout = timeout self._path = vid_path self._frames_written = 0 - self.writer = cv2.VideoWriter(str(vid_path), - cv2.VideoWriter_fourcc(*fourcc), - fps, - (width, height), - True) + self.fourcc = fourcc + self.fps = fps + self.writer = None + self.start() def start(self) -> None: '''Create the video recorder thread and start the frame queue.''' + logger.debug(f"Starting video writer for {self.path}") self.active = True self.frame_queue = queue.Queue() self.thread = threading.Thread(target=self._write, args=()) @@ -65,28 +64,47 @@ def add(self, frame: PIL.Image.Image) -> None: Returns: None ''' + + if self.writer is None: + self.width, self.height = frame.size + self.writer = cv2.VideoWriter(str(self._path), + cv2.VideoWriter_fourcc(*self.fourcc), + self.fps, + (self.width, self.height), + True) + if self.active: + width, height = frame.size + if (width, height) != (self.width, self.height): + raise ValueError(f"Wrong size frame ({width}, {height}) for " + f"video writer ({self.width}, {self.height})") # convert BGR PIL image to RGB for opencv cv_frame = np.array(frame.convert('RGB'))[:, :, ::-1] + logger.debug(f"Adding frame to {self.path} queue") self.frame_queue.put(cv_frame) + logger.debug(f"Queue size is {self.frame_queue.qsize()}") def _write(self) -> None: '''Loop forever waiting for frames to enter the queue.''' while True: if not self.active: + logger.warning("Recorder not active") return if not self.frame_queue.empty(): frame = self.frame_queue.get() self.writer.write(frame) self._frames_written = self._frames_written + 1 + logger.debug(f"Recorder wrote {self._frames_written} frames") else: time.sleep(self.timeout) def flush(self) -> None: '''Write the remaining video frames in the the queue.''' + logger.debug("Writing remaining frames") while not self.frame_queue.empty(): frame = self.frame_queue.get() self.writer.write(frame) + self._frames_written = self._frames_written + 1 def finish(self) -> None: '''Deactivate the recorder so that it does not accept more frames. @@ -94,10 +112,12 @@ def finish(self) -> None: Frames that remain in the buffer will be written and the recorder closed. ''' + logger.debug("Closing video recorder") self.active = False - self.thread.join() self.flush() - self.writer.release() + self.thread.join() + if self.writer: + self.writer.release() @property def path(self) -> pathlib.Path: diff --git a/machine_common_sense/reward.py b/machine_common_sense/reward.py index 06ec1ef18..02f40a05b 100644 --- a/machine_common_sense/reward.py +++ b/machine_common_sense/reward.py @@ -3,7 +3,7 @@ from shapely import geometry from .goal_metadata import GoalMetadata, GoalCategory -from .controller import MAX_REACH_DISTANCE, MOVE_DISTANCE +from .controller import DEFAULT_MOVE GOAL_ACHIEVED = 1 GOAL_NOT_ACHIEVED = 0 @@ -51,7 +51,8 @@ def _convert_object_to_planar_polygon( def _calc_retrieval_reward( goal: GoalMetadata, objects: Dict, - agent: Dict) -> int: + agent: Dict, + performer_reach: float) -> int: ''' Calculate the reward for the retrieval goal. @@ -61,6 +62,7 @@ def _calc_retrieval_reward( goal: GoalMetadata objects: Dict agent: Dict + performer_reach: float Returns: int: 1 for goal achieved, 0 otherwise @@ -78,7 +80,8 @@ def _calc_retrieval_reward( def _calc_traversal_reward( goal: GoalMetadata, objects: Dict, - agent: Dict) -> int: + agent: Dict, + performer_reach: float) -> int: ''' Calculate the reward for the traversal goal. @@ -89,6 +92,7 @@ def _calc_traversal_reward( goal: GoalMetadata objects: Dict agent: Dict + performer_reach: float Returns: int: 1 for goal achieved, 0 otherwise @@ -105,7 +109,7 @@ def _calc_traversal_reward( goal_polygon = Reward._convert_object_to_planar_polygon( goal_object) polygonal_distance = agent_xz.distance(goal_polygon) - reward = int(polygonal_distance <= MAX_REACH_DISTANCE) + reward = int(polygonal_distance <= performer_reach) return reward @@ -113,7 +117,8 @@ def _calc_traversal_reward( def _calc_transferral_reward( goal: GoalMetadata, objects: Dict, - agent: Dict) -> int: + agent: Dict, + performer_reach: float) -> int: ''' Calculate the reward for the transferral goal. @@ -124,6 +129,7 @@ def _calc_transferral_reward( goal: GoalMetadata objects: Dict agent: Dict + performer_reach: float Returns: int: 1 for goal achieved, 0 otherwise @@ -161,7 +167,7 @@ def _calc_transferral_reward( # actions are next_to or on_top_of (ie; action obj next to goal obj) if action == 'next to': polygonal_distance = action_polygon.distance(goal_polygon) - reward = int(polygonal_distance <= MOVE_DISTANCE) + reward = int(polygonal_distance <= DEFAULT_MOVE) elif action == 'on top of': # check that the action object center intersects the goal object # bounds and the y dimension of the target is above the goal @@ -200,7 +206,8 @@ def _adjust_score_penalty( def _calculate_default_reward( goal: GoalMetadata, objects: Dict, - agent: Dict) -> int: + agent: Dict, + reach: float) -> int: '''Returns the default reward of 0; not achieved.''' return GOAL_NOT_ACHIEVED @@ -209,7 +216,8 @@ def calculate_reward( goal: GoalMetadata, objects: Dict, agent: Dict, - number_steps: int) -> float: + number_steps: int, + reach: float) -> float: ''' Determine if the agent achieved the objective/task/goal. @@ -217,6 +225,7 @@ def calculate_reward( goal: GoalMetadata objects: Dict agent: Dict + reach: float Returns: int: reward is 1 if goal achieved, 0 otherwise @@ -236,5 +245,6 @@ def calculate_reward( current_score = switch.get(category, Reward._calculate_default_reward)(goal, objects, - agent) + agent, + reach) return Reward._adjust_score_penalty(current_score, number_steps) diff --git a/machine_common_sense/scenes/README.md b/machine_common_sense/scenes/README.md index edafb66c1..ef1cdcd5d 100644 --- a/machine_common_sense/scenes/README.md +++ b/machine_common_sense/scenes/README.md @@ -10,7 +10,7 @@ An open room containing over 40 objects for undirected exploration. - [playroom.json](./playroom.json) -![playroom_3_2](./videos/playroom_3_2.gif) +![playroom_eval_4](./videos/playroom_eval_4.gif) ### Retrieval Goal diff --git a/machine_common_sense/scenes/container_open_close.json b/machine_common_sense/scenes/container_open_close.json new file mode 100644 index 000000000..75106abf9 --- /dev/null +++ b/machine_common_sense/scenes/container_open_close.json @@ -0,0 +1,137 @@ +{ + "version": 2, + "ceilingMaterial": "AI2-THOR/Materials/Walls/Drywall", + "floorMaterial": "AI2-THOR/Materials/Fabrics/CarpetWhite 3", + "wallMaterial": "AI2-THOR/Materials/Walls/DrywallBeige", + "performerStart": { + "position": { + "x": 0, + "z": 0 + }, + "rotation": { + "x": 0, + "y": 0 + } + }, + "objects": [{ + "id": "toy_car", + "type": "car_1", + "salientMaterials": ["wood"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color wood 2"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": -0.3, + "y": 0.01, + "z": 2 + }, + "rotation": { + "x": 0, + "y": 0, + "z": 0 + }, + "scale": { + "x": 1.5, + "y": 1.5, + "z": 1.5 + } + }] + }, { + "id": "sturdy_box", + "type": "chest_1", + "salientMaterials": ["wood"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color wood 1"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": 0, + "y": 0, + "z": 4.5 + }, + "rotation": { + "x": 0, + "y": 90, + "z": 0 + }, + "scale": { + "x": 0.5, + "y": 0.5, + "z": 0.5 + } + }] + }, { + "id": "treasure_chest", + "type": "chest_2", + "salientMaterials": ["wood"], + "materials": ["AI2-THOR/Materials/Wood/LightWoodCounters4"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": 0, + "y": 0, + "z": 3.5 + }, + "rotation": { + "x": 0, + "y": 180, + "z": 0 + } + }], + "openClose": [{ + "open": true, + "step": 2 + },{ + "open": false, + "step": 5 + },{ + "open": true, + "step": 10 + },{ + "open": true, + "step": 15 + },{ + "open": false, + "step": 20 + },{ + "open": true, + "step": 25 + }] + }, { + "id": "suitcase", + "type": "suitcase_1", + "salientMaterials": ["plastic"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 1"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": -2, + "y": 0, + "z": 3.5 + }, + "rotation": { + "x": 0, + "y": 180, + "z": 0 + } + }], + "openClose": [{ + "open": true, + "step": 2 + },{ + "open": false, + "step": 4 + },{ + "open": true, + "step": 6 + },{ + "open": true, + "step": 8 + },{ + "open": false, + "step": 10 + },{ + "open": true, + "step": 12 + }] + }] +} diff --git a/machine_common_sense/scenes/move_deep_fast_01.json b/machine_common_sense/scenes/move_deep_fast_01.json index 78c408389..13ade7168 100644 --- a/machine_common_sense/scenes/move_deep_fast_01.json +++ b/machine_common_sense/scenes/move_deep_fast_01.json @@ -35,7 +35,7 @@ "y": 15, "z": 0 }, - "stepBegin": 15, + "stepBegin": 80, "scale": { "x": 0.5, "y": 0.25, @@ -47,8 +47,8 @@ "forces": [ { "relative": true, - "stepBegin": 15, - "stepEnd": 15, + "stepBegin": 80, + "stepEnd": 80, "vector": { "x": 400.0, "y": 0, @@ -90,8 +90,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -99,8 +99,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -110,29 +110,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 89, - "stepEnd": 90, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } } @@ -171,8 +171,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -180,8 +180,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -223,8 +223,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -232,8 +232,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -243,29 +243,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 89, - "stepEnd": 90, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } } @@ -304,8 +304,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -313,8 +313,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -326,7 +326,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 90, + "last_step": 200, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/move_deep_fast_02.json b/machine_common_sense/scenes/move_deep_fast_02.json index b3add8285..4f958b342 100644 --- a/machine_common_sense/scenes/move_deep_fast_02.json +++ b/machine_common_sense/scenes/move_deep_fast_02.json @@ -35,7 +35,7 @@ "y": -15, "z": 0 }, - "stepBegin": 30, + "stepBegin": 110, "scale": { "x": 0.6, "y": 0.3, @@ -47,8 +47,8 @@ "forces": [ { "relative": true, - "stepBegin": 30, - "stepEnd": 30, + "stepBegin": 110, + "stepEnd": 110, "vector": { "x": 300.0, "y": 0, @@ -90,8 +90,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -99,8 +99,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -110,29 +110,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 89, - "stepEnd": 90, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } } @@ -171,8 +171,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -180,8 +180,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -223,8 +223,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -232,8 +232,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -243,29 +243,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 89, - "stepEnd": 90, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } } @@ -304,8 +304,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -313,8 +313,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -326,7 +326,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 90, + "last_step": 200, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/move_deep_fast_03.json b/machine_common_sense/scenes/move_deep_fast_03.json index 9f417cb46..e76244a68 100644 --- a/machine_common_sense/scenes/move_deep_fast_03.json +++ b/machine_common_sense/scenes/move_deep_fast_03.json @@ -35,7 +35,7 @@ "y": 165, "z": 0 }, - "stepBegin": 20, + "stepBegin": 90, "scale": { "x": 2.0, "y": 2.0, @@ -47,8 +47,8 @@ "forces": [ { "relative": true, - "stepBegin": 20, - "stepEnd": 20, + "stepBegin": 90, + "stepEnd": 90, "vector": { "x": 300.0, "y": 0, @@ -90,8 +90,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -99,8 +99,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -110,29 +110,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 89, - "stepEnd": 90, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } } @@ -171,8 +171,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -180,8 +180,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -223,8 +223,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -232,8 +232,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -243,29 +243,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 89, - "stepEnd": 90, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } } @@ -304,8 +304,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -313,8 +313,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -326,7 +326,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 90, + "last_step": 200, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/move_deep_fast_04.json b/machine_common_sense/scenes/move_deep_fast_04.json index 124bc2c3d..bbabfeffe 100644 --- a/machine_common_sense/scenes/move_deep_fast_04.json +++ b/machine_common_sense/scenes/move_deep_fast_04.json @@ -35,7 +35,7 @@ "y": -75, "z": 0 }, - "stepBegin": 25, + "stepBegin": 100, "scale": { "x": 3.5, "y": 3.5, @@ -47,8 +47,8 @@ "forces": [ { "relative": true, - "stepBegin": 25, - "stepEnd": 25, + "stepBegin": 100, + "stepEnd": 100, "vector": { "x": 0, "y": 0, @@ -90,8 +90,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -99,8 +99,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -110,29 +110,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 89, - "stepEnd": 90, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } } @@ -171,8 +171,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -180,8 +180,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -223,8 +223,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -232,8 +232,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -243,29 +243,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 89, - "stepEnd": 90, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } } @@ -304,8 +304,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -313,8 +313,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -326,7 +326,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 90, + "last_step": 200, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/move_deep_slow_01.json b/machine_common_sense/scenes/move_deep_slow_01.json index 98b2570f5..99443a70e 100644 --- a/machine_common_sense/scenes/move_deep_slow_01.json +++ b/machine_common_sense/scenes/move_deep_slow_01.json @@ -35,7 +35,7 @@ "y": 165, "z": 0 }, - "stepBegin": 20, + "stepBegin": 85, "scale": { "x": 0.6, "y": 0.3, @@ -47,8 +47,8 @@ "forces": [ { "relative": true, - "stepBegin": 20, - "stepEnd": 20, + "stepBegin": 85, + "stepEnd": 85, "vector": { "x": 125.0, "y": 0, @@ -90,8 +90,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -99,8 +99,8 @@ } }, { - "stepBegin": 145, - "stepEnd": 150, + "stepBegin": 226, + "stepEnd": 231, "vector": { "x": 0, "y": 0.25, @@ -110,29 +110,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 149, - "stepEnd": 150, + "stepBegin": 232, + "stepEnd": 236, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } } @@ -171,8 +171,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -180,8 +180,8 @@ } }, { - "stepBegin": 145, - "stepEnd": 150, + "stepBegin": 226, + "stepEnd": 231, "vector": { "x": 0, "y": 0.25, @@ -193,7 +193,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 150, + "last_step": 240, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/move_deep_slow_02.json b/machine_common_sense/scenes/move_deep_slow_02.json index 0f41d5671..eaf5869fc 100644 --- a/machine_common_sense/scenes/move_deep_slow_02.json +++ b/machine_common_sense/scenes/move_deep_slow_02.json @@ -35,7 +35,7 @@ "y": -15, "z": 0 }, - "stepBegin": 15, + "stepBegin": 80, "scale": { "x": 1.5, "y": 1.5, @@ -47,8 +47,8 @@ "forces": [ { "relative": true, - "stepBegin": 15, - "stepEnd": 15, + "stepBegin": 80, + "stepEnd": 80, "vector": { "x": 225.0, "y": 0, @@ -90,8 +90,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 71, + "stepEnd": 76, "vector": { "x": 0, "y": -0.25, @@ -99,8 +99,8 @@ } }, { - "stepBegin": 145, - "stepEnd": 150, + "stepBegin": 201, + "stepEnd": 206, "vector": { "x": 0, "y": 0.25, @@ -110,29 +110,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 36, "vector": { "x": 0, - "y": -45, + "y": 3, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 41, + "stepEnd": 70, "vector": { "x": 0, - "y": 45, + "y": -3, "z": 0 } }, { - "stepBegin": 149, - "stepEnd": 150, + "stepBegin": 207, + "stepEnd": 236, "vector": { "x": 0, - "y": -45, + "y": 3, "z": 0 } } @@ -171,8 +171,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 71, + "stepEnd": 76, "vector": { "x": 0, "y": -0.25, @@ -180,8 +180,8 @@ } }, { - "stepBegin": 145, - "stepEnd": 150, + "stepBegin": 201, + "stepEnd": 206, "vector": { "x": 0, "y": 0.25, @@ -193,7 +193,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 150, + "last_step": 240, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/move_slow_01.json b/machine_common_sense/scenes/move_slow_01.json index 4d1efffe9..e560e184d 100644 --- a/machine_common_sense/scenes/move_slow_01.json +++ b/machine_common_sense/scenes/move_slow_01.json @@ -35,7 +35,7 @@ "y": 0, "z": 0 }, - "stepBegin": 25, + "stepBegin": 95, "scale": { "x": 0.4, "y": 0.2, @@ -47,8 +47,8 @@ "forces": [ { "relative": true, - "stepBegin": 25, - "stepEnd": 25, + "stepBegin": 95, + "stepEnd": 95, "vector": { "x": -125.0, "y": 0, @@ -90,8 +90,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -99,8 +99,8 @@ } }, { - "stepBegin": 145, - "stepEnd": 150, + "stepBegin": 226, + "stepEnd": 231, "vector": { "x": 0, "y": 0.25, @@ -110,29 +110,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 149, - "stepEnd": 150, + "stepBegin": 232, + "stepEnd": 236, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } } @@ -171,8 +171,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -180,8 +180,8 @@ } }, { - "stepBegin": 145, - "stepEnd": 150, + "stepBegin": 226, + "stepEnd": 231, "vector": { "x": 0, "y": 0.25, @@ -193,7 +193,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 150, + "last_step": 240, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/move_slow_02.json b/machine_common_sense/scenes/move_slow_02.json index b6158622c..943592a02 100644 --- a/machine_common_sense/scenes/move_slow_02.json +++ b/machine_common_sense/scenes/move_slow_02.json @@ -35,7 +35,7 @@ "y": 90, "z": 0 }, - "stepBegin": 30, + "stepBegin": 90, "scale": { "x": 2.5, "y": 2.5, @@ -47,8 +47,8 @@ "forces": [ { "relative": true, - "stepBegin": 30, - "stepEnd": 30, + "stepBegin": 90, + "stepEnd": 90, "vector": { "x": 0, "y": 0, @@ -90,8 +90,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 71, + "stepEnd": 76, "vector": { "x": 0, "y": -0.25, @@ -99,8 +99,8 @@ } }, { - "stepBegin": 145, - "stepEnd": 150, + "stepBegin": 201, + "stepEnd": 206, "vector": { "x": 0, "y": 0.25, @@ -110,29 +110,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 36, "vector": { "x": 0, - "y": -45, + "y": 3, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 41, + "stepEnd": 70, "vector": { "x": 0, - "y": 45, + "y": -3, "z": 0 } }, { - "stepBegin": 149, - "stepEnd": 150, + "stepBegin": 207, + "stepEnd": 236, "vector": { "x": 0, - "y": -45, + "y": 3, "z": 0 } } @@ -171,8 +171,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 71, + "stepEnd": 76, "vector": { "x": 0, "y": -0.25, @@ -180,8 +180,8 @@ } }, { - "stepBegin": 145, - "stepEnd": 150, + "stepBegin": 201, + "stepEnd": 206, "vector": { "x": 0, "y": 0.25, @@ -193,7 +193,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 150, + "last_step": 240, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/move_toss_fast_01.json b/machine_common_sense/scenes/move_toss_fast_01.json index 6a7e5bc29..0e7917097 100644 --- a/machine_common_sense/scenes/move_toss_fast_01.json +++ b/machine_common_sense/scenes/move_toss_fast_01.json @@ -35,7 +35,7 @@ "y": 0, "z": 0 }, - "stepBegin": 25, + "stepBegin": 90, "scale": { "x": 0.5, "y": 0.25, @@ -46,8 +46,8 @@ "materials": ["UnityAssetStore/Baby_Room/Models/Materials/cabinet metal"], "forces": [ { - "stepBegin": 25, - "stepEnd": 25, + "stepBegin": 90, + "stepEnd": 90, "vector": { "x": -300.0, "y": 150, @@ -89,8 +89,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -98,8 +98,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -109,29 +109,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 89, - "stepEnd": 90, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } } @@ -170,8 +170,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -179,8 +179,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -222,8 +222,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -231,8 +231,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -242,29 +242,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 89, - "stepEnd": 90, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } } @@ -303,8 +303,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -312,8 +312,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -325,7 +325,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 90, + "last_step": 200, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/move_toss_fast_02.json b/machine_common_sense/scenes/move_toss_fast_02.json index d136fed55..3a833cbf7 100644 --- a/machine_common_sense/scenes/move_toss_fast_02.json +++ b/machine_common_sense/scenes/move_toss_fast_02.json @@ -35,7 +35,7 @@ "y": 90, "z": 0 }, - "stepBegin": 20, + "stepBegin": 80, "scale": { "x": 3.5, "y": 3.5, @@ -46,8 +46,8 @@ "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 1"], "forces": [ { - "stepBegin": 20, - "stepEnd": 20, + "stepBegin": 80, + "stepEnd": 80, "vector": { "x": 275.0, "y": 225, @@ -89,8 +89,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -98,8 +98,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -109,29 +109,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 89, - "stepEnd": 90, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } } @@ -170,8 +170,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -179,8 +179,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -222,8 +222,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -231,8 +231,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -242,29 +242,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 89, - "stepEnd": 90, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } } @@ -303,8 +303,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -312,8 +312,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -325,7 +325,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 90, + "last_step": 200, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/move_toss_slow_01.json b/machine_common_sense/scenes/move_toss_slow_01.json index f94818b9d..19f538a1f 100644 --- a/machine_common_sense/scenes/move_toss_slow_01.json +++ b/machine_common_sense/scenes/move_toss_slow_01.json @@ -35,7 +35,7 @@ "y": 270, "z": 0 }, - "stepBegin": 25, + "stepBegin": 105, "scale": { "x": 3.5, "y": 3.5, @@ -46,8 +46,8 @@ "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 1"], "forces": [ { - "stepBegin": 25, - "stepEnd": 25, + "stepBegin": 105, + "stepEnd": 105, "vector": { "x": -125.0, "y": 225.0, @@ -89,8 +89,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -98,8 +98,8 @@ } }, { - "stepBegin": 145, - "stepEnd": 150, + "stepBegin": 226, + "stepEnd": 231, "vector": { "x": 0, "y": 0.25, @@ -109,29 +109,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 149, - "stepEnd": 150, + "stepBegin": 232, + "stepEnd": 236, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } } @@ -170,8 +170,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -179,8 +179,8 @@ } }, { - "stepBegin": 145, - "stepEnd": 150, + "stepBegin": 226, + "stepEnd": 231, "vector": { "x": 0, "y": 0.25, @@ -192,7 +192,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 150, + "last_step": 240, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/move_toss_slow_02.json b/machine_common_sense/scenes/move_toss_slow_02.json index 1feaefc26..92a60db4d 100644 --- a/machine_common_sense/scenes/move_toss_slow_02.json +++ b/machine_common_sense/scenes/move_toss_slow_02.json @@ -35,7 +35,7 @@ "y": 0, "z": 0 }, - "stepBegin": 20, + "stepBegin": 100, "scale": { "x": 0.5, "y": 0.25, @@ -46,10 +46,10 @@ "materials": ["UnityAssetStore/Baby_Room/Models/Materials/cabinet metal"], "forces": [ { - "stepBegin": 20, - "stepEnd": 20, + "stepBegin": 100, + "stepEnd": 100, "vector": { - "x": 150.0, + "x": 140.0, "y": 150.0, "z": 0 } @@ -89,8 +89,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 71, + "stepEnd": 76, "vector": { "x": 0, "y": -0.25, @@ -98,8 +98,8 @@ } }, { - "stepBegin": 145, - "stepEnd": 150, + "stepBegin": 201, + "stepEnd": 206, "vector": { "x": 0, "y": 0.25, @@ -109,29 +109,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 36, "vector": { "x": 0, - "y": -45, + "y": 3, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 41, + "stepEnd": 70, "vector": { "x": 0, - "y": 45, + "y": -3, "z": 0 } }, { - "stepBegin": 149, - "stepEnd": 150, + "stepBegin": 207, + "stepEnd": 236, "vector": { "x": 0, - "y": -45, + "y": 3, "z": 0 } } @@ -170,8 +170,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 71, + "stepEnd": 76, "vector": { "x": 0, "y": -0.25, @@ -179,8 +179,8 @@ } }, { - "stepBegin": 145, - "stepEnd": 150, + "stepBegin": 201, + "stepEnd": 206, "vector": { "x": 0, "y": 0.25, @@ -192,7 +192,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 150, + "last_step": 240, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/object_permanence_implausible.json b/machine_common_sense/scenes/object_permanence_implausible.json index ec22ed190..7d58b61bd 100644 --- a/machine_common_sense/scenes/object_permanence_implausible.json +++ b/machine_common_sense/scenes/object_permanence_implausible.json @@ -35,7 +35,7 @@ "y": 45, "z": 0 }, - "stepBegin": 15, + "stepBegin": 80, "scale": { "x": 0.5, "y": 0.5, @@ -45,7 +45,7 @@ ], "hides": [ { - "stepBegin": 50 + "stepBegin": 120 } ], "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 2"] @@ -69,7 +69,7 @@ "y": 0, "z": 0 }, - "stepBegin": 20, + "stepBegin": 85, "scale": { "x": 2.5, "y": 2.5, @@ -91,12 +91,12 @@ "stepBegin": 0, "position": { "x": -1.631, - "y": 0.75, + "y": 0.9, "z": 1 }, "scale": { "x": 0.842, - "y": 1.5, + "y": 1.8, "z": 0.1 } } @@ -104,7 +104,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0, "y": 0.25, @@ -112,8 +112,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -121,8 +121,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0, "y": 0.25, @@ -132,28 +132,28 @@ ], "rotates": [ { - "stepBegin": 5, - "stepEnd": 6, + "stepBegin": 7, + "stepEnd": 11, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } }, { - "stepBegin": 7, - "stepEnd": 8, + "stepBegin": 16, + "stepEnd": 20, "vector": { - "x": -45, + "x": -18, "y": 0, "z": 0 } }, { - "stepBegin": 59, - "stepEnd": 60, + "stepBegin": 152, + "stepEnd": 156, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } @@ -172,7 +172,7 @@ "stepBegin": 0, "position": { "x": -5.052, - "y": 0.75, + "y": 0.9, "z": 1 }, "rotation": { @@ -190,7 +190,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0.25, "y": 0, @@ -198,8 +198,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": -0.25, "y": 0, @@ -207,8 +207,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0.25, "y": 0, @@ -229,12 +229,12 @@ "stepBegin": 0, "position": { "x": 1.0312500000000002, - "y": 0.75, + "y": 0.9, "z": 1 }, "scale": { "x": 1.0, - "y": 1.5, + "y": 1.8, "z": 0.1 } } @@ -242,7 +242,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0, "y": 0.25, @@ -250,8 +250,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -259,8 +259,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0, "y": 0.25, @@ -270,28 +270,28 @@ ], "rotates": [ { - "stepBegin": 5, - "stepEnd": 6, + "stepBegin": 7, + "stepEnd": 11, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } }, { - "stepBegin": 7, - "stepEnd": 8, + "stepBegin": 16, + "stepEnd": 20, "vector": { - "x": -45, + "x": -18, "y": 0, "z": 0 } }, { - "stepBegin": 59, - "stepEnd": 60, + "stepBegin": 152, + "stepEnd": 156, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } @@ -310,7 +310,7 @@ "stepBegin": 0, "position": { "x": 4.53125, - "y": 0.75, + "y": 0.9, "z": 1 }, "rotation": { @@ -328,7 +328,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0.25, "y": 0, @@ -336,8 +336,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": -0.25, "y": 0, @@ -345,8 +345,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0.25, "y": 0, @@ -358,7 +358,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 60, + "last_step": 160, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/object_permanence_plausible.json b/machine_common_sense/scenes/object_permanence_plausible.json index 85835ce4f..cfe7b0514 100644 --- a/machine_common_sense/scenes/object_permanence_plausible.json +++ b/machine_common_sense/scenes/object_permanence_plausible.json @@ -35,7 +35,7 @@ "y": 45, "z": 0 }, - "stepBegin": 15, + "stepBegin": 80, "scale": { "x": 0.5, "y": 0.5, @@ -64,7 +64,7 @@ "y": 0, "z": 0 }, - "stepBegin": 20, + "stepBegin": 85, "scale": { "x": 2.5, "y": 2.5, @@ -86,12 +86,12 @@ "stepBegin": 0, "position": { "x": -1.631, - "y": 0.75, + "y": 0.9, "z": 1 }, "scale": { "x": 0.842, - "y": 1.5, + "y": 1.8, "z": 0.1 } } @@ -99,7 +99,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0, "y": 0.25, @@ -107,8 +107,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -116,8 +116,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0, "y": 0.25, @@ -127,28 +127,28 @@ ], "rotates": [ { - "stepBegin": 5, - "stepEnd": 6, + "stepBegin": 7, + "stepEnd": 11, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } }, { - "stepBegin": 7, - "stepEnd": 8, + "stepBegin": 16, + "stepEnd": 20, "vector": { - "x": -45, + "x": -18, "y": 0, "z": 0 } }, { - "stepBegin": 59, - "stepEnd": 60, + "stepBegin": 152, + "stepEnd": 156, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } @@ -167,7 +167,7 @@ "stepBegin": 0, "position": { "x": -5.052, - "y": 0.75, + "y": 0.9, "z": 1 }, "rotation": { @@ -185,7 +185,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0.25, "y": 0, @@ -193,8 +193,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": -0.25, "y": 0, @@ -202,8 +202,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0.25, "y": 0, @@ -224,12 +224,12 @@ "stepBegin": 0, "position": { "x": 1.0312500000000002, - "y": 0.75, + "y": 0.9, "z": 1 }, "scale": { "x": 1.0, - "y": 1.5, + "y": 1.8, "z": 0.1 } } @@ -237,7 +237,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0, "y": 0.25, @@ -245,8 +245,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -254,8 +254,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0, "y": 0.25, @@ -265,28 +265,28 @@ ], "rotates": [ { - "stepBegin": 5, - "stepEnd": 6, + "stepBegin": 7, + "stepEnd": 11, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } }, { - "stepBegin": 7, - "stepEnd": 8, + "stepBegin": 16, + "stepEnd": 20, "vector": { - "x": -45, + "x": -18, "y": 0, "z": 0 } }, { - "stepBegin": 59, - "stepEnd": 60, + "stepBegin": 152, + "stepEnd": 156, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } @@ -305,7 +305,7 @@ "stepBegin": 0, "position": { "x": 4.53125, - "y": 0.75, + "y": 0.9, "z": 1 }, "rotation": { @@ -323,7 +323,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0.25, "y": 0, @@ -331,8 +331,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": -0.25, "y": 0, @@ -340,8 +340,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0.25, "y": 0, @@ -353,7 +353,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 60, + "last_step": 160, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/pickup_and_move_container_with_object.json b/machine_common_sense/scenes/pickup_and_move_container_with_object.json new file mode 100644 index 000000000..9e0246a41 --- /dev/null +++ b/machine_common_sense/scenes/pickup_and_move_container_with_object.json @@ -0,0 +1,282 @@ +{ + "name": "pickup_and_move_container_with_object", + "version": 2, + "ceilingMaterial": "AI2-THOR/Materials/Walls/Drywall", + "floorMaterial": "AI2-THOR/Materials/Fabrics/CarpetWhite 3", + "wallMaterial": "AI2-THOR/Materials/Walls/DrywallBeige", + "performerStart": { + "position": { + "x": 0, + "z": 0 + }, + "rotation": { + "x": 0, + "y": 0 + } + }, + "objects": [{ + "id": "toy_car", + "type": "car_1", + "salientMaterials": ["wood"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color wood 2"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": -1, + "y": 0.1, + "z": 1.0 + }, + "rotation": { + "x": 0, + "y": 0, + "z": 0 + }, + "scale": { + "x": 1.5, + "y": 1.5, + "z": 1.5 + } + }] + },{ + "id": "treasure_chest", + "type": "chest_2", + "salientMaterials": ["wood"], + "materials": ["AI2-THOR/Materials/Wood/LightWoodCounters4"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": -1, + "y": 0, + "z": 1.0 + }, + "rotation": { + "x": 0, + "y": 180, + "z": 0 + } + }], + "openClose": [{ + "open": true, + "step": 1 + }] + },{ + "id": "sturdy_box", + "type": "chest_1", + "salientMaterials": ["wood"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color wood 1"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": 0, + "y": 0, + "z": 4.5 + }, + "rotation": { + "x": 0, + "y": -90, + "z": 0 + }, + "scale": { + "x": 0.5, + "y": 0.5, + "z": 0.5 + } + }] + },{ + "id": "suitcase", + "type": "suitcase_1", + "salientMaterials": ["plastic"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 1"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": -4.5, + "y": 0, + "z": 1 + }, + "rotation": { + "x": 0, + "y": 180, + "z": 0 + } + }] + },{ + "id": "apple_a", + "type": "apple_1", + "shows": [{ + "stepBegin": 0, + "position": { + "x": 1, + "y": 0.15, + "z": 1 + }, + "scale": { + "x": 0.5, + "y": 0.5, + "z": 0.5 + } + }] + }, { + "id": "bowl_a", + "type": "bowl_6", + "salientMaterials": ["plastic"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 2"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": 1, + "y": 0.1, + "z": 1 + }, + "scale": { + "x": 1, + "y": 1, + "z": 1 + } + }] + },{ + "id": "bowl_1", + "type": "bowl_6", + "salientMaterials": ["plastic"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 2"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": 2, + "y": 0.05, + "z": 1 + }, + "scale": { + "x": 1, + "y": 1, + "z": 1 + } + }] + },{ + "id": "bowl_2", + "type": "bowl_6", + "salientMaterials": ["plastic"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 2"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": 2, + "y": 0.1, + "z": 1 + }, + "scale": { + "x": 1, + "y": 1, + "z": 1 + } + }] + },{ + "id": "bowl_3", + "type": "bowl_6", + "salientMaterials": ["plastic"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 2"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": 2, + "y": 0.15, + "z": 1 + }, + "scale": { + "x": 1, + "y": 1, + "z": 1 + } + }] + },{ + "id": "bowl_4", + "type": "bowl_6", + "salientMaterials": ["plastic"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 2"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": 2, + "y": 0.2, + "z": 1 + }, + "scale": { + "x": 1, + "y": 1, + "z": 1 + } + }] + },{ + "id": "bowl_5", + "type": "bowl_6", + "salientMaterials": ["plastic"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 2"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": 2, + "y": 0.25, + "z": 1 + }, + "scale": { + "x": 1, + "y": 1, + "z": 1 + } + }] + },{ + "id": "bowl_6", + "type": "bowl_6", + "salientMaterials": ["plastic"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 2"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": 2, + "y": 0.3, + "z": 1 + }, + "scale": { + "x": 1, + "y": 1, + "z": 1 + } + }] + },{ + "id": "bowl_7", + "type": "bowl_6", + "salientMaterials": ["plastic"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 2"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": 3, + "y": 0.35, + "z": 1 + }, + "scale": { + "x": 1, + "y": 1, + "z": 1 + } + }] + },{ + "id": "bowl_8", + "type": "bowl_6", + "salientMaterials": ["plastic"], + "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 2"], + "shows": [{ + "stepBegin": 0, + "position": { + "x": 3, + "y": 0.4, + "z": 1 + }, + "scale": { + "x": 1, + "y": 1, + "z": 1 + } + }] + }] +} diff --git a/machine_common_sense/scenes/shape_constancy_implausible.json b/machine_common_sense/scenes/shape_constancy_implausible.json index bf4f54fbc..ae01c8e25 100644 --- a/machine_common_sense/scenes/shape_constancy_implausible.json +++ b/machine_common_sense/scenes/shape_constancy_implausible.json @@ -35,7 +35,7 @@ "y": 0, "z": 0 }, - "stepBegin": 13, + "stepBegin": 80, "scale": { "x": 1.75, "y": 1.75, @@ -64,7 +64,7 @@ "y": 0, "z": 0 }, - "stepBegin": 13, + "stepBegin": 80, "scale": { "x": 0.4, "y": 0.2, @@ -74,7 +74,7 @@ ], "hides": [ { - "stepBegin": 50 + "stepBegin": 120 } ], "materials": ["UnityAssetStore/Kindergarten_Interior/Models/Materials/color 1"] @@ -98,7 +98,7 @@ "y": 90, "z": 0 }, - "stepBegin": 50, + "stepBegin": 120, "scale": { "x": 2.75, "y": 2.75, @@ -120,12 +120,12 @@ "stepBegin": 0, "position": { "x": 0.579, - "y": 0.75, + "y": 0.9, "z": 1 }, "scale": { "x": 0.694, - "y": 1.5, + "y": 1.8, "z": 0.1 } } @@ -133,7 +133,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0, "y": 0.25, @@ -141,8 +141,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -150,8 +150,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0, "y": 0.25, @@ -161,28 +161,28 @@ ], "rotates": [ { - "stepBegin": 5, - "stepEnd": 6, + "stepBegin": 7, + "stepEnd": 11, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } }, { - "stepBegin": 7, - "stepEnd": 8, + "stepBegin": 16, + "stepEnd": 20, "vector": { - "x": -45, + "x": -18, "y": 0, "z": 0 } }, { - "stepBegin": 59, - "stepEnd": 60, + "stepBegin": 152, + "stepEnd": 156, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } @@ -190,7 +190,7 @@ ] }, { - "id": "occluder_pole_a619a36e-a460-4f77-ab3d-833e1a915ded", + "id": "occluder_pole_1", "type": "cylinder", "kinematic": true, "structure": true, @@ -201,7 +201,7 @@ "stepBegin": 0, "position": { "x": 3.926, - "y": 0.75, + "y": 0.9, "z": 1 }, "rotation": { @@ -219,7 +219,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0.25, "y": 0, @@ -227,8 +227,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": -0.25, "y": 0, @@ -236,8 +236,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0.25, "y": 0, @@ -247,7 +247,7 @@ ] }, { - "id": "occluder_wall_32b483c2-f26b-4ba2-8f49-0c227de84103", + "id": "occluder_wall_2", "type": "cube", "kinematic": true, "structure": true, @@ -258,12 +258,12 @@ "stepBegin": 0, "position": { "x": -1.603, - "y": 0.75, + "y": 0.9, "z": 1 }, "scale": { "x": 0.733, - "y": 1.5, + "y": 1.8, "z": 0.1 } } @@ -271,7 +271,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0, "y": 0.25, @@ -279,8 +279,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -288,8 +288,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0, "y": 0.25, @@ -299,28 +299,28 @@ ], "rotates": [ { - "stepBegin": 5, - "stepEnd": 6, + "stepBegin": 7, + "stepEnd": 11, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } }, { - "stepBegin": 7, - "stepEnd": 8, + "stepBegin": 16, + "stepEnd": 20, "vector": { - "x": -45, + "x": -18, "y": 0, "z": 0 } }, { - "stepBegin": 59, - "stepEnd": 60, + "stepBegin": 152, + "stepEnd": 156, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } @@ -328,7 +328,7 @@ ] }, { - "id": "occluder_pole_32b483c2-f26b-4ba2-8f49-0c227de84103", + "id": "occluder_pole_2", "type": "cylinder", "kinematic": true, "structure": true, @@ -339,7 +339,7 @@ "stepBegin": 0, "position": { "x": -4.969, - "y": 0.75, + "y": 0.9, "z": 1 }, "rotation": { @@ -357,7 +357,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0.25, "y": 0, @@ -365,8 +365,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": -0.25, "y": 0, @@ -374,8 +374,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0.25, "y": 0, @@ -387,7 +387,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 60, + "last_step": 160, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/shape_constancy_plausible.json b/machine_common_sense/scenes/shape_constancy_plausible.json index 172bd567c..d90f2f884 100644 --- a/machine_common_sense/scenes/shape_constancy_plausible.json +++ b/machine_common_sense/scenes/shape_constancy_plausible.json @@ -35,7 +35,7 @@ "y": 0, "z": 0 }, - "stepBegin": 13, + "stepBegin": 80, "scale": { "x": 1.75, "y": 1.75, @@ -64,7 +64,7 @@ "y": 0, "z": 0 }, - "stepBegin": 13, + "stepBegin": 80, "scale": { "x": 0.4, "y": 0.2, @@ -86,12 +86,12 @@ "stepBegin": 0, "position": { "x": 0.579, - "y": 0.75, + "y": 0.9, "z": 1 }, "scale": { "x": 0.694, - "y": 1.5, + "y": 1.8, "z": 0.1 } } @@ -99,7 +99,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0, "y": 0.25, @@ -107,8 +107,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -116,8 +116,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0, "y": 0.25, @@ -127,28 +127,28 @@ ], "rotates": [ { - "stepBegin": 5, - "stepEnd": 6, + "stepBegin": 7, + "stepEnd": 11, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } }, { - "stepBegin": 7, - "stepEnd": 8, + "stepBegin": 16, + "stepEnd": 20, "vector": { - "x": -45, + "x": -18, "y": 0, "z": 0 } }, { - "stepBegin": 59, - "stepEnd": 60, + "stepBegin": 152, + "stepEnd": 156, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } @@ -156,7 +156,7 @@ ] }, { - "id": "occluder_pole_a619a36e-a460-4f77-ab3d-833e1a915ded", + "id": "occluder_pole_1", "type": "cylinder", "kinematic": true, "structure": true, @@ -167,7 +167,7 @@ "stepBegin": 0, "position": { "x": 3.926, - "y": 0.75, + "y": 0.9, "z": 1 }, "rotation": { @@ -185,7 +185,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0.25, "y": 0, @@ -193,8 +193,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": -0.25, "y": 0, @@ -202,8 +202,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0.25, "y": 0, @@ -213,7 +213,7 @@ ] }, { - "id": "occluder_wall_32b483c2-f26b-4ba2-8f49-0c227de84103", + "id": "occluder_wall_2", "type": "cube", "kinematic": true, "structure": true, @@ -224,12 +224,12 @@ "stepBegin": 0, "position": { "x": -1.603, - "y": 0.75, + "y": 0.9, "z": 1 }, "scale": { "x": 0.733, - "y": 1.5, + "y": 1.8, "z": 0.1 } } @@ -237,7 +237,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0, "y": 0.25, @@ -245,8 +245,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -254,8 +254,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0, "y": 0.25, @@ -265,28 +265,28 @@ ], "rotates": [ { - "stepBegin": 5, - "stepEnd": 6, + "stepBegin": 7, + "stepEnd": 11, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } }, { - "stepBegin": 7, - "stepEnd": 8, + "stepBegin": 16, + "stepEnd": 20, "vector": { - "x": -45, + "x": -18, "y": 0, "z": 0 } }, { - "stepBegin": 59, - "stepEnd": 60, + "stepBegin": 152, + "stepEnd": 156, "vector": { - "x": 45, + "x": 18, "y": 0, "z": 0 } @@ -294,7 +294,7 @@ ] }, { - "id": "occluder_pole_32b483c2-f26b-4ba2-8f49-0c227de84103", + "id": "occluder_pole_2", "type": "cylinder", "kinematic": true, "structure": true, @@ -305,7 +305,7 @@ "stepBegin": 0, "position": { "x": -4.969, - "y": 0.75, + "y": 0.9, "z": 1 }, "rotation": { @@ -323,7 +323,7 @@ "moves": [ { "stepBegin": 1, - "stepEnd": 4, + "stepEnd": 6, "vector": { "x": 0.25, "y": 0, @@ -331,8 +331,8 @@ } }, { - "stepBegin": 9, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": -0.25, "y": 0, @@ -340,8 +340,8 @@ } }, { - "stepBegin": 55, - "stepEnd": 58, + "stepBegin": 146, + "stepEnd": 151, "vector": { "x": 0.25, "y": 0, @@ -353,7 +353,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 60, + "last_step": 160, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/spatio_temporal_continuity_implausible.json b/machine_common_sense/scenes/spatio_temporal_continuity_implausible.json index b4012f569..7b92e216a 100644 --- a/machine_common_sense/scenes/spatio_temporal_continuity_implausible.json +++ b/machine_common_sense/scenes/spatio_temporal_continuity_implausible.json @@ -35,7 +35,7 @@ "y": 0, "z": 0 }, - "stepBegin": 35, + "stepBegin": 100, "scale": { "x": 0.5, "y": 0.25, @@ -46,8 +46,8 @@ "materials": ["UnityAssetStore/Baby_Room/Models/Materials/cabinet metal"], "forces": [ { - "stepBegin": 35, - "stepEnd": 35, + "stepBegin": 100, + "stepEnd": 100, "vector": { "x": -350.0, "y": 0, @@ -57,8 +57,8 @@ ], "shrouds": [ { - "stepBegin": 40, - "stepEnd": 52 + "stepBegin": 105, + "stepEnd": 117 } ] }, @@ -81,7 +81,7 @@ "y": 270, "z": 0 }, - "stepBegin": 20, + "stepBegin": 80, "scale": { "x": 3.5, "y": 3.5, @@ -92,8 +92,8 @@ "materials": ["UnityAssetStore/Baby_Room/Models/Materials/wood 1"], "forces": [ { - "stepBegin": 20, - "stepEnd": 20, + "stepBegin": 80, + "stepEnd": 80, "vector": { "x": -330.0, "y": 0, @@ -114,12 +114,12 @@ "stepBegin": 0, "position": { "x": 0.069, - "y": 0.75, + "y": 0.9, "z": 1 }, "scale": { "x": 0.942, - "y": 1.5, + "y": 1.8, "z": 0.1 } } @@ -135,8 +135,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -144,8 +144,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -155,29 +155,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 85, - "stepEnd": 86, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } } @@ -216,8 +216,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -225,8 +225,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -247,12 +247,12 @@ "stepBegin": 0, "position": { "x": -1.536, - "y": 0.75, + "y": 0.9, "z": 1 }, "scale": { "x": 0.992, - "y": 1.5, + "y": 1.8, "z": 0.1 } } @@ -268,8 +268,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -277,8 +277,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -288,29 +288,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 85, - "stepEnd": 86, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } } @@ -349,8 +349,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -358,8 +358,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -380,12 +380,12 @@ "stepBegin": 0, "position": { "x": 2.4, - "y": 0.75, + "y": 0.9, "z": 1 }, "scale": { "x": 0.9, - "y": 1.5, + "y": 1.8, "z": 0.1 } } @@ -401,8 +401,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -410,8 +410,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -421,29 +421,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 85, - "stepEnd": 86, + "stepBegin": 191, + "stepEnd": 196, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } } @@ -482,8 +482,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -491,8 +491,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -504,7 +504,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 90, + "last_step": 200, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/spatio_temporal_continuity_plausible.json b/machine_common_sense/scenes/spatio_temporal_continuity_plausible.json index 0f44e7673..3469d443a 100644 --- a/machine_common_sense/scenes/spatio_temporal_continuity_plausible.json +++ b/machine_common_sense/scenes/spatio_temporal_continuity_plausible.json @@ -35,7 +35,7 @@ "y": 0, "z": 0 }, - "stepBegin": 35, + "stepBegin": 100, "scale": { "x": 0.5, "y": 0.25, @@ -46,8 +46,8 @@ "materials": ["UnityAssetStore/Baby_Room/Models/Materials/cabinet metal"], "forces": [ { - "stepBegin": 35, - "stepEnd": 35, + "stepBegin": 100, + "stepEnd": 100, "vector": { "x": -350.0, "y": 0, @@ -75,7 +75,7 @@ "y": 270, "z": 0 }, - "stepBegin": 20, + "stepBegin": 80, "scale": { "x": 3.5, "y": 3.5, @@ -86,8 +86,8 @@ "materials": ["UnityAssetStore/Baby_Room/Models/Materials/wood 1"], "forces": [ { - "stepBegin": 20, - "stepEnd": 20, + "stepBegin": 80, + "stepEnd": 80, "vector": { "x": -330.0, "y": 0, @@ -108,12 +108,12 @@ "stepBegin": 0, "position": { "x": 0.069, - "y": 0.75, + "y": 0.9, "z": 1 }, "scale": { "x": 0.942, - "y": 1.5, + "y": 1.8, "z": 0.1 } } @@ -129,8 +129,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -138,8 +138,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -149,29 +149,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 85, - "stepEnd": 86, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } } @@ -210,8 +210,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -219,8 +219,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -241,12 +241,12 @@ "stepBegin": 0, "position": { "x": -1.536, - "y": 0.75, + "y": 0.9, "z": 1 }, "scale": { "x": 0.992, - "y": 1.5, + "y": 1.8, "z": 0.1 } } @@ -262,8 +262,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -271,8 +271,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -282,29 +282,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 85, - "stepEnd": 86, + "stepBegin": 192, + "stepEnd": 196, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } } @@ -343,8 +343,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -352,8 +352,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -374,12 +374,12 @@ "stepBegin": 0, "position": { "x": 2.4, - "y": 0.75, + "y": 0.9, "z": 1 }, "scale": { "x": 0.9, - "y": 1.5, + "y": 1.8, "z": 0.1 } } @@ -395,8 +395,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -404,8 +404,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -415,29 +415,29 @@ ], "rotates": [ { - "stepBegin": 1, - "stepEnd": 2, + "stepBegin": 7, + "stepEnd": 11, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } }, { - "stepBegin": 11, - "stepEnd": 12, + "stepBegin": 16, + "stepEnd": 20, "vector": { "x": 0, - "y": 45, + "y": 18, "z": 0 } }, { - "stepBegin": 85, - "stepEnd": 86, + "stepBegin": 191, + "stepEnd": 196, "vector": { "x": 0, - "y": -45, + "y": -18, "z": 0 } } @@ -476,8 +476,8 @@ } }, { - "stepBegin": 7, - "stepEnd": 12, + "stepBegin": 21, + "stepEnd": 26, "vector": { "x": 0, "y": -0.25, @@ -485,8 +485,8 @@ } }, { - "stepBegin": 85, - "stepEnd": 90, + "stepBegin": 186, + "stepEnd": 191, "vector": { "x": 0, "y": 0.25, @@ -498,7 +498,7 @@ ], "goal": { "category": "intuitive physics", - "last_step": 90, + "last_step": 200, "action_list": [["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"],["Pass"]], "description": "", "metadata": { diff --git a/machine_common_sense/scenes/template_mechanism_dropping_soccer_ball.json b/machine_common_sense/scenes/template_mechanism_dropping_soccer_ball.json index 02ac21072..b781f51a1 100644 --- a/machine_common_sense/scenes/template_mechanism_dropping_soccer_ball.json +++ b/machine_common_sense/scenes/template_mechanism_dropping_soccer_ball.json @@ -91,6 +91,10 @@ "y": 1.5, "z": 1.5 } + }], + "openClose": [{ + "open": false, + "step": 40 }] } ] diff --git a/machine_common_sense/scenes/videos/move_deep_fast_01.gif b/machine_common_sense/scenes/videos/move_deep_fast_01.gif index 44b69a535..195dd3e65 100644 Binary files a/machine_common_sense/scenes/videos/move_deep_fast_01.gif and b/machine_common_sense/scenes/videos/move_deep_fast_01.gif differ diff --git a/machine_common_sense/scenes/videos/move_deep_fast_02.gif b/machine_common_sense/scenes/videos/move_deep_fast_02.gif index 100af07a2..0f052cd07 100644 Binary files a/machine_common_sense/scenes/videos/move_deep_fast_02.gif and b/machine_common_sense/scenes/videos/move_deep_fast_02.gif differ diff --git a/machine_common_sense/scenes/videos/move_deep_fast_03.gif b/machine_common_sense/scenes/videos/move_deep_fast_03.gif index 1eb9ad298..31bb4d897 100644 Binary files a/machine_common_sense/scenes/videos/move_deep_fast_03.gif and b/machine_common_sense/scenes/videos/move_deep_fast_03.gif differ diff --git a/machine_common_sense/scenes/videos/move_deep_fast_04.gif b/machine_common_sense/scenes/videos/move_deep_fast_04.gif index 773d2bb1b..6ee23130b 100644 Binary files a/machine_common_sense/scenes/videos/move_deep_fast_04.gif and b/machine_common_sense/scenes/videos/move_deep_fast_04.gif differ diff --git a/machine_common_sense/scenes/videos/move_deep_slow_01.gif b/machine_common_sense/scenes/videos/move_deep_slow_01.gif index ce0ed9e27..57b12e128 100644 Binary files a/machine_common_sense/scenes/videos/move_deep_slow_01.gif and b/machine_common_sense/scenes/videos/move_deep_slow_01.gif differ diff --git a/machine_common_sense/scenes/videos/move_deep_slow_02.gif b/machine_common_sense/scenes/videos/move_deep_slow_02.gif index 7cdaf2b8c..0fe62efe3 100644 Binary files a/machine_common_sense/scenes/videos/move_deep_slow_02.gif and b/machine_common_sense/scenes/videos/move_deep_slow_02.gif differ diff --git a/machine_common_sense/scenes/videos/move_slow_01.gif b/machine_common_sense/scenes/videos/move_slow_01.gif index 40a0df76f..d50efd069 100644 Binary files a/machine_common_sense/scenes/videos/move_slow_01.gif and b/machine_common_sense/scenes/videos/move_slow_01.gif differ diff --git a/machine_common_sense/scenes/videos/move_slow_02.gif b/machine_common_sense/scenes/videos/move_slow_02.gif index 19d132500..eda251724 100644 Binary files a/machine_common_sense/scenes/videos/move_slow_02.gif and b/machine_common_sense/scenes/videos/move_slow_02.gif differ diff --git a/machine_common_sense/scenes/videos/move_toss_fast_01.gif b/machine_common_sense/scenes/videos/move_toss_fast_01.gif index 9217706e5..42b75aa33 100644 Binary files a/machine_common_sense/scenes/videos/move_toss_fast_01.gif and b/machine_common_sense/scenes/videos/move_toss_fast_01.gif differ diff --git a/machine_common_sense/scenes/videos/move_toss_fast_02.gif b/machine_common_sense/scenes/videos/move_toss_fast_02.gif index 5d1230049..dd8f6187e 100644 Binary files a/machine_common_sense/scenes/videos/move_toss_fast_02.gif and b/machine_common_sense/scenes/videos/move_toss_fast_02.gif differ diff --git a/machine_common_sense/scenes/videos/move_toss_slow_01.gif b/machine_common_sense/scenes/videos/move_toss_slow_01.gif index 02a422109..5809a1261 100644 Binary files a/machine_common_sense/scenes/videos/move_toss_slow_01.gif and b/machine_common_sense/scenes/videos/move_toss_slow_01.gif differ diff --git a/machine_common_sense/scenes/videos/move_toss_slow_02.gif b/machine_common_sense/scenes/videos/move_toss_slow_02.gif index 805bab0bb..cc5e1fec7 100644 Binary files a/machine_common_sense/scenes/videos/move_toss_slow_02.gif and b/machine_common_sense/scenes/videos/move_toss_slow_02.gif differ diff --git a/machine_common_sense/scenes/videos/object_permanence_implausible.gif b/machine_common_sense/scenes/videos/object_permanence_implausible.gif index 9933c183e..2473f2742 100644 Binary files a/machine_common_sense/scenes/videos/object_permanence_implausible.gif and b/machine_common_sense/scenes/videos/object_permanence_implausible.gif differ diff --git a/machine_common_sense/scenes/videos/object_permanence_implausible.mp4 b/machine_common_sense/scenes/videos/object_permanence_implausible.mp4 index 9b75c4a1d..57c8e1925 100644 Binary files a/machine_common_sense/scenes/videos/object_permanence_implausible.mp4 and b/machine_common_sense/scenes/videos/object_permanence_implausible.mp4 differ diff --git a/machine_common_sense/scenes/videos/object_permanence_plausible.gif b/machine_common_sense/scenes/videos/object_permanence_plausible.gif index 75cfafa29..29e87afd9 100644 Binary files a/machine_common_sense/scenes/videos/object_permanence_plausible.gif and b/machine_common_sense/scenes/videos/object_permanence_plausible.gif differ diff --git a/machine_common_sense/scenes/videos/object_permanence_plausible.mp4 b/machine_common_sense/scenes/videos/object_permanence_plausible.mp4 index daa217e24..d3cf80a0c 100644 Binary files a/machine_common_sense/scenes/videos/object_permanence_plausible.mp4 and b/machine_common_sense/scenes/videos/object_permanence_plausible.mp4 differ diff --git a/machine_common_sense/scenes/videos/playroom_3_2.gif b/machine_common_sense/scenes/videos/playroom_3_2.gif deleted file mode 100644 index 249f88a74..000000000 Binary files a/machine_common_sense/scenes/videos/playroom_3_2.gif and /dev/null differ diff --git a/machine_common_sense/scenes/videos/playroom_eval_4.gif b/machine_common_sense/scenes/videos/playroom_eval_4.gif new file mode 100644 index 000000000..eda4d2bc7 Binary files /dev/null and b/machine_common_sense/scenes/videos/playroom_eval_4.gif differ diff --git a/machine_common_sense/scenes/videos/playroom_eval_4.mp4 b/machine_common_sense/scenes/videos/playroom_eval_4.mp4 new file mode 100644 index 000000000..1ee763b1d Binary files /dev/null and b/machine_common_sense/scenes/videos/playroom_eval_4.mp4 differ diff --git a/machine_common_sense/scenes/videos/shape_constancy_implausible.gif b/machine_common_sense/scenes/videos/shape_constancy_implausible.gif index 8d635b08e..98c6ecce3 100644 Binary files a/machine_common_sense/scenes/videos/shape_constancy_implausible.gif and b/machine_common_sense/scenes/videos/shape_constancy_implausible.gif differ diff --git a/machine_common_sense/scenes/videos/shape_constancy_implausible.mp4 b/machine_common_sense/scenes/videos/shape_constancy_implausible.mp4 index 4f600636f..48e3be384 100644 Binary files a/machine_common_sense/scenes/videos/shape_constancy_implausible.mp4 and b/machine_common_sense/scenes/videos/shape_constancy_implausible.mp4 differ diff --git a/machine_common_sense/scenes/videos/shape_constancy_plausible.gif b/machine_common_sense/scenes/videos/shape_constancy_plausible.gif index d147d051d..6eccd1715 100644 Binary files a/machine_common_sense/scenes/videos/shape_constancy_plausible.gif and b/machine_common_sense/scenes/videos/shape_constancy_plausible.gif differ diff --git a/machine_common_sense/scenes/videos/shape_constancy_plausible.mp4 b/machine_common_sense/scenes/videos/shape_constancy_plausible.mp4 index 5ae71cd75..a2cf934d6 100644 Binary files a/machine_common_sense/scenes/videos/shape_constancy_plausible.mp4 and b/machine_common_sense/scenes/videos/shape_constancy_plausible.mp4 differ diff --git a/machine_common_sense/scenes/videos/spatio_temporal_continuity_implausible.gif b/machine_common_sense/scenes/videos/spatio_temporal_continuity_implausible.gif index e4e921902..438c99742 100644 Binary files a/machine_common_sense/scenes/videos/spatio_temporal_continuity_implausible.gif and b/machine_common_sense/scenes/videos/spatio_temporal_continuity_implausible.gif differ diff --git a/machine_common_sense/scenes/videos/spatio_temporal_continuity_implausible.mp4 b/machine_common_sense/scenes/videos/spatio_temporal_continuity_implausible.mp4 index a2f065cb6..aed963592 100644 Binary files a/machine_common_sense/scenes/videos/spatio_temporal_continuity_implausible.mp4 and b/machine_common_sense/scenes/videos/spatio_temporal_continuity_implausible.mp4 differ diff --git a/machine_common_sense/scenes/videos/spatio_temporal_continuity_plausible.gif b/machine_common_sense/scenes/videos/spatio_temporal_continuity_plausible.gif index b032adf1e..621548220 100644 Binary files a/machine_common_sense/scenes/videos/spatio_temporal_continuity_plausible.gif and b/machine_common_sense/scenes/videos/spatio_temporal_continuity_plausible.gif differ diff --git a/machine_common_sense/scenes/videos/spatio_temporal_continuity_plausible.mp4 b/machine_common_sense/scenes/videos/spatio_temporal_continuity_plausible.mp4 index 9a1cf5049..fe2c50f1e 100644 Binary files a/machine_common_sense/scenes/videos/spatio_temporal_continuity_plausible.mp4 and b/machine_common_sense/scenes/videos/spatio_temporal_continuity_plausible.mp4 differ diff --git a/machine_common_sense/scenes/videos/template_mechanism_dropping_soccer_ball.gif b/machine_common_sense/scenes/videos/template_mechanism_dropping_soccer_ball.gif index c48f600ad..88eb0524f 100644 Binary files a/machine_common_sense/scenes/videos/template_mechanism_dropping_soccer_ball.gif and b/machine_common_sense/scenes/videos/template_mechanism_dropping_soccer_ball.gif differ diff --git a/machine_common_sense/scenes/videos/template_mechanism_dropping_soccer_ball.mp4 b/machine_common_sense/scenes/videos/template_mechanism_dropping_soccer_ball.mp4 index 5af33351a..518923eed 100644 Binary files a/machine_common_sense/scenes/videos/template_mechanism_dropping_soccer_ball.mp4 and b/machine_common_sense/scenes/videos/template_mechanism_dropping_soccer_ball.mp4 differ diff --git a/machine_common_sense/serializer.py b/machine_common_sense/serializer.py index 35f08acce..fa7be48af 100644 --- a/machine_common_sense/serializer.py +++ b/machine_common_sense/serializer.py @@ -98,7 +98,8 @@ def _ext_pack(x): msgpack.packb([ x.uuid, x.color, x.dimensions, x.direction, x.distance, x.distance_in_steps, x.distance_in_world, x.held, x.mass, - x.material_list, x.position, x.rotation, x.visible + x.material_list, x.position, x.rotation, x.shape, + x.state_list, x.texture_color_list, x.visible ], default=SerializerMsgPack._ext_pack, strict_types=True)) @@ -158,11 +159,13 @@ def _ext_unpack(code, data): elif code == 5: uuid, color, dimensions, direction, distance, distance_in_steps, \ distance_in_world, held, mass, material_list, position, \ - rotation, visible = msgpack.unpackb( + rotation, shape, state_list, texture_color_list, \ + visible = msgpack.unpackb( data, ext_hook=SerializerMsgPack._ext_unpack) return ObjectMetadata(uuid, color, dimensions, direction, distance, distance_in_steps, distance_in_world, held, mass, material_list, position, rotation, + shape, state_list, texture_color_list, visible) elif code == 6: x = msgpack.unpackb(data, ext_hook=SerializerMsgPack._ext_unpack) @@ -260,6 +263,9 @@ def default(self, x): 'material_list': x.material_list, 'position': x.position, 'rotation': x.rotation, + 'shape': x.shape, + 'state_list': x.state_list, + 'texture_color_list': x.texture_color_list, 'visible': x.visible } elif isinstance(x, np.ndarray): @@ -280,7 +286,8 @@ def convert_object_list(raw_list): object_raw['distance_in_world'], object_raw['held'], object_raw['mass'], object_raw['material_list'], object_raw['position'], object_raw['rotation'], - object_raw['visible']) + object_raw['shape'], object_raw['state_list'], + object_raw['texture_color_list'], object_raw['visible']) object_list.append(obj) return object_list diff --git a/machine_common_sense/step_metadata.py b/machine_common_sense/step_metadata.py index 69d15f60e..83f036698 100644 --- a/machine_common_sense/step_metadata.py +++ b/machine_common_sense/step_metadata.py @@ -1,3 +1,5 @@ +import copy + from .goal_metadata import GoalMetadata from .pose import Pose from .return_status import ReturnStatus @@ -14,6 +16,13 @@ class StepMetadata: The list of all actions that are available for the next step. Each action is returned as a tuple containing the action string and the action's restricted parameters, if any. + For example: ("Pass", {}) forces a Pass action; ("PickupObject", {}) + forces a PickupObject action with any parameters; and + ("PickupObject", {"objectId": "a"}) forces a PickupObject action with + the specific parameters objectId=a. + An action_list of None or an empty list means that all actions will + be available for the next step. + Derived from GoalMetadata.action_list. May be a subset of all possible actions. See [Actions](#Actions). camera_aspect_ratio : (float, float) The player camera's aspect ratio. This will remain constant for the @@ -31,10 +40,12 @@ class StepMetadata: The list of 2-dimensional numpy arrays of depth float data from the scene after the last action and physics simulation were run. This is usually a list with 1 array, except for the output from start_scene - for a scene with a scripted Preview Phase. + for a scene with a scripted Preview Phase (Preview Phase case details + TBD). Each depth float in a 2-dimensional numpy array is a value between 0 and the camera's far clipping plane (default 15) correspondings to the depth in simulation units at that pixel in the image. + Note that this list will be empty if the metadata level is 'none'. goal : GoalMetadata or None The goal for the whole scene. Will be None in "Exploration" scenes. habituation_trial : int or None @@ -48,37 +59,52 @@ class StepMetadata: The list of images from the scene after the last action and physics simulation were run. This is usually a list with 1 image, except for the output from start_scene for a scene with a scripted Preview Phase. + (Preview Phase case details TBD). object_list : list of ObjectMetadata objects The list of metadata for all the visible interactive objects in the - scene. For metadata on structural objects like walls, please see - structural_object_list + scene. This list will be empty if using a metadata level below + the 'oracle' level. For metadata on structural objects like walls, + please see structural_object_list object_mask_list : list of Pillow.Image objects The list of object mask (instance segmentation) images from the scene after the last action and physics simulation were run. This is usually a list with 1 image, except for the output from start_scene for a - scene with a scripted Previous Phase. + scene with a scripted Preview Phase (Preview Phase case details TBD). The color of each object in the mask corresponds to the "color" property in its ObjectMetadata object. + Note that this list will be empty if the metadata level is 'none' + or 'level1'. + performer_radius: float + The radius of the performer. + performer_reach: float + The max reach of the performer. pose : string Your current pose. Either "STANDING", "CRAWLING", or "LYING". position : dict The "x", "y", and "z" coordinates for your global position. + Will be set to 'None' if using a metadata level below the + 'oracle' level. return_status : string The return status from your last action. See [Actions](#Actions). reward : integer Reward is 1 on successful completion of a task, 0 otherwise. rotation : float - Your current rotation angle in degrees. + Your current rotation angle in degrees. Will be set to 'None' + if using a metadata level below the 'oracle' level. step_number : integer The step number of your last action, recorded since you started the current scene. + physics_frames_per_second : float + The frames per second of the physics engine structural_object_list : list of ObjectMetadata objects The list of metadata for all the visible structural objects (like - walls, occluders, and ramps) in the scene. Please note that occluders - are composed of two separate objects, the "wall" and the "pole", with - corresponding object IDs (occluder_wall_ and - occluder_pole_), and ramps are composed of between one and three - objects (depending on the type of ramp), with corresponding object IDs. + walls, occluders, and ramps) in the scene. This list will be empty + if using a metadata level below the 'oracle' level. + Please note that occluders are composed of two separate objects, + the "wall" and the "pole", with corresponding object IDs + (occluder_wall_ and occluder_pole_), and ramps are + composed of between one and three objects (depending on the type + of ramp), with corresponding object IDs. """ def __init__( @@ -95,6 +121,9 @@ def __init__( image_list=None, object_list=None, object_mask_list=None, + performer_radius=0.0, + performer_reach=0.0, + physics_frames_per_second=0, pose=Pose.UNDEFINED.value, position=None, return_status=ReturnStatus.UNDEFINED.value, @@ -124,6 +153,9 @@ def __init__( self.object_mask_list = ( [] if object_mask_list is None else object_mask_list ) + self.performer_radius = performer_radius + self.performer_reach = performer_reach + self.physics_frames_per_second = physics_frames_per_second self.pose = pose self.position = {} if position is None else position self.return_status = return_status @@ -142,6 +174,14 @@ def check_list_none(self, obj_list): else: return dict((obj.uuid, dict(obj)) for obj in obj_list) + def copy_without_depth_or_images(self): + """Return a deep copy of this StepMetadata with default depth_map_list, + image_list, and object_mask_list properties.""" + step_metadata_copy = StepMetadata() + for key, _ in self: + setattr(step_metadata_copy, key, copy.deepcopy(getattr(self, key))) + return step_metadata_copy + # Allows converting the class to a dictionary, along with allowing # certain fields to be left out of output file def __iter__(self): @@ -151,8 +191,12 @@ def __iter__(self): yield 'camera_field_of_view', self.camera_field_of_view yield 'camera_height', self.camera_height yield 'goal', dict(self.goal) + yield 'habituation_trial', self.habituation_trial yield 'head_tilt', self.head_tilt yield 'object_list', self.check_list_none(self.object_list) + yield 'performer_radius', self.performer_radius + yield 'performer_reach', self.performer_reach + yield 'physics_frames_per_second', self.physics_frames_per_second yield 'pose', self.pose yield 'position', self.position yield 'return_status', self.return_status diff --git a/machine_common_sense/uploader.py b/machine_common_sense/uploader.py index 24cab3613..d8e7062ad 100644 --- a/machine_common_sense/uploader.py +++ b/machine_common_sense/uploader.py @@ -1,10 +1,14 @@ import io +import logging import pathlib import boto3 import PIL +logger = logging.getLogger(__name__) + + class S3Uploader(): '''Upload evaluation files to an AWS S3 bucket. @@ -27,7 +31,8 @@ def upload_video(self, Returns: None ''' - print(f"Uploading {video_path} to {self.bucket} as {s3_filename}") + logger.info( + f"Uploading {video_path} to {self.bucket} as {s3_filename}") self._upload_file( filepath=video_path, bucket=self.bucket, @@ -51,6 +56,7 @@ def upload_image(self, image.save(fp=in_memory_file, format='png') in_memory_file.seek(0) + logger.info(f"Uploading image to {self.bucket} as {s3_filename}") self._upload_object( in_memory_file=in_memory_file, bucket=self.bucket, @@ -70,7 +76,8 @@ def upload_history(self, Returns: None ''' - print(f"Uploading {history_path} to {self.bucket} as {s3_filename}") + logger.info( + f"Uploading {history_path} to {self.bucket} as {s3_filename}") self._upload_file( filepath=history_path, bucket=self.bucket, diff --git a/machine_common_sense/util.py b/machine_common_sense/util.py index 6722e5251..af110822b 100644 --- a/machine_common_sense/util.py +++ b/machine_common_sense/util.py @@ -1,9 +1,13 @@ import numpy +import logging from .action import Action from .material import Material +logger = logging.getLogger(__name__) + + class Util: """ Defines utility functions for MCS classes. @@ -174,18 +178,11 @@ def is_in_range(value, min_value, max_value, default_value, label=None): """ if value > max_value or value < min_value: if label is not None: - print( - 'Value of ' + - label + - 'needs to be between ' + - str(min_value) + - ' and ' + - str(max_value) + - '. Current value: ' + - str(value) + - '. Will be reset to ' + - str(default_value) + - '.') + logger.debug( + f'Value of {label} needs to be between ' + f'{min_value} and {max_value}. ' + f'Current value {value} ' + f'will be reset to {default_value}.') return default_value return value @@ -211,10 +208,8 @@ def is_number(value, label=None): return True except ValueError: if label is not None: - print( - 'Value of ' + - label + - ' needs to be a number. Will be set to 0.') + logger.debug(f'Value of {label}' + f' needs to be a number. Will be set to 0.') return False @staticmethod diff --git a/requirements.txt b/requirements.txt index 9527e72f3..7ce7211bc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,6 +17,7 @@ Jinja2==2.11.3 MarkupSafe==1.1.1 matplotlib==3.3.2 msgpack==1.0.0 +numpy==1.19.4 opencv-python==4.4.0.44 packaging==20.4 pre-commit==2.7.1 diff --git a/sample_config.ini b/sample_config.ini index 0ccef5f61..4bd409819 100644 --- a/sample_config.ini +++ b/sample_config.ini @@ -1,3 +1,2 @@ [MCS] -debug = false metadata = oracle \ No newline at end of file diff --git a/scripts/config_debug_to_file.ini b/scripts/config_debug_to_file.ini deleted file mode 100644 index 5144a7e41..000000000 --- a/scripts/config_debug_to_file.ini +++ /dev/null @@ -1,4 +0,0 @@ -[MCS] -debug_output: file -history_enabled: false -metadata: none diff --git a/scripts/config_debug_to_terminal.ini b/scripts/config_debug_to_terminal.ini deleted file mode 100644 index 4ddb1f57e..000000000 --- a/scripts/config_debug_to_terminal.ini +++ /dev/null @@ -1,4 +0,0 @@ -[MCS] -debug_output: terminal -history_enabled: false -metadata: none diff --git a/scripts/config_level1.ini b/scripts/config_level1.ini index 3bcd2f897..ebab15424 100644 --- a/scripts/config_level1.ini +++ b/scripts/config_level1.ini @@ -1,4 +1,5 @@ [MCS] -debug: false history_enabled: false metadata: level1 +save_debug_images: false +save_debug_json: false diff --git a/scripts/config_level1_debug.ini b/scripts/config_level1_debug.ini index 59b5ffc56..2a7437d5a 100644 --- a/scripts/config_level1_debug.ini +++ b/scripts/config_level1_debug.ini @@ -1,4 +1,5 @@ [MCS] -debug: true history_enabled: false metadata: level1 +save_debug_images: true +save_debug_json: true diff --git a/scripts/config_level2.ini b/scripts/config_level2.ini index 85d49bf1e..487040e13 100644 --- a/scripts/config_level2.ini +++ b/scripts/config_level2.ini @@ -1,4 +1,5 @@ [MCS] -debug: false history_enabled: false metadata: level2 +save_debug_images: false +save_debug_json: false diff --git a/scripts/config_level2_debug.ini b/scripts/config_level2_debug.ini index fe6f8c7b2..cb78588a6 100644 --- a/scripts/config_level2_debug.ini +++ b/scripts/config_level2_debug.ini @@ -1,4 +1,5 @@ [MCS] -debug: true history_enabled: false metadata: level2 +save_debug_images: true +save_debug_json: true diff --git a/scripts/config_no_debug.ini b/scripts/config_no_debug.ini index c4b8b918f..fea1ef96b 100644 --- a/scripts/config_no_debug.ini +++ b/scripts/config_no_debug.ini @@ -1,4 +1,5 @@ [MCS] -debug: false history_enabled: false metadata: none +save_debug_images: false +save_debug_json: false diff --git a/scripts/config_oracle.ini b/scripts/config_oracle.ini index f9b4bb448..053ab87d3 100644 --- a/scripts/config_oracle.ini +++ b/scripts/config_oracle.ini @@ -1,4 +1,5 @@ [MCS] -debug: false history_enabled: false metadata: oracle +save_debug_images: false +save_debug_json: false diff --git a/scripts/config_oracle_debug.ini b/scripts/config_oracle_debug.ini index d964702ef..255b7001f 100644 --- a/scripts/config_oracle_debug.ini +++ b/scripts/config_oracle_debug.ini @@ -1,4 +1,5 @@ [MCS] -debug: true history_enabled: false metadata: oracle +save_debug_images: true +save_debug_json: true diff --git a/scripts/config_with_debug.ini b/scripts/config_with_debug.ini index 9f2798d39..c06f6557d 100644 --- a/scripts/config_with_debug.ini +++ b/scripts/config_with_debug.ini @@ -1,4 +1,5 @@ [MCS] -debug: true history_enabled: false metadata: none +save_debug_images: true +save_debug_json: true diff --git a/scripts/log.config.py b/scripts/log.config.py new file mode 100644 index 000000000..3a79d419b --- /dev/null +++ b/scripts/log.config.py @@ -0,0 +1,91 @@ +# This file is loaded as a python dictionary. Documentation on the format +# can be found here: +# https://docs.python.org/3/library/logging.config.html#logging-config-dictschema +# +# The goal here is to create a logging file that will work for most while +# providing additional options to make changing the configuration relatively +# easy. +# +# Basic structure of logging. +# Code should get and use a logger determined by the class name: +# logger = logging.getLogger(__name__) +# Loggers are configured here to pass log data zero or more handlers +# Loggers have a level which filters out any logs below that level +# Handlers determine where to send the data (console, files, sockets) +# Handlers have a level which filters out any logs below that level +# Handlers can reference a formatter +# Formatters determine the format of the log message +# Note: For a message to be logged, its level must be equal to or above +# both the logger's level and the handler's level +{ + "version": 1, + # Essentially the default. Anything that isn't defined elsewhere, will + # take these settings + "root": { + "level": "WARN", + "handlers": ["console", "debug-file"], + "propagate": False + }, + "loggers": { + # Sets all machine_common_sense loggers to these settings and + # logs them into the listed handlers + "machine_common_sense": { + "level": "DEBUG", + "handlers": ["console", "debug-file"], + "propagate": False + } + # Sample of how to change the level at a more detailed level: + # , + # "machine_common_sense.controller": { + # "level": "TRACE", + # "handlers": ["console", "debug-file"], + # "propagate": False + # } + }, + # Handlers take log messages and put them somewhere (console, files, + # sockets, syslog, smtp, http) + # See https://docs.python.org/3/library/logging.handlers.html for + # all the different built in handlers + "handlers": { + "console": { + "class": "logging.StreamHandler", + "formatter": "brief", + "level": "DEBUG", + "stream": "ext://sys.stdout" + }, + # The file handlers have a nice feature to rotate log files so you + # don't use up all your disk space (maxBytes and backupCount). + "debug-file": { + "level": "DEBUG", + "class": "logging.handlers.RotatingFileHandler", + "formatter": "precise", + "filename": "logs/mcs.debug.log", + "maxBytes": 10240000, + "backupCount": 3 + }, + # This is mostly here for a sample. We don't seem to have enough + # differentiation between debug and info yet to make this useful + "info-file": { + "level": "INFO", + "class": "logging.handlers.RotatingFileHandler", + "formatter": "precise", + "filename": "logs/mcs.info.log", + "maxBytes": 10240000, + "backupCount": 3 + } + }, + # Formatters just specify the format of the log message. Sometimes its + # useful to have a lot of detail. Sometimes it more annoying than useful. + # Simply change which formatter you want in the handlers section.False + "formatters": { + "brief": { + "format": "%(message)s" + }, + "precise": { + "format": "%(asctime)s <%(levelname)s>: %(message)s" + }, + "full": { + "format": "[%(name)s] %(asctime)s <%(levelname)s>: %(message)s" + } + } +} diff --git a/scripts/run_action_file.py b/scripts/run_action_file.py index 1d0088b86..aaaa01e9b 100644 --- a/scripts/run_action_file.py +++ b/scripts/run_action_file.py @@ -3,7 +3,7 @@ from runner_script import SingleFileRunnerScript -action_list = [] +action_list_from_file = [] class ActionFileRunnerScript(SingleFileRunnerScript): @@ -21,16 +21,16 @@ def read_subclass_args(self, parser): def action_callback(scene_data, step_metadata, runner_script): - if not action_list: + if not action_list_from_file: with open(runner_script.args.action_filename, 'r') as action_file: for line in action_file: - action_list.append(line.strip()) + action_list_from_file.append(line.strip()) - if len(action_list) <= step_metadata.step_number: + if len(action_list_from_file) <= step_metadata.step_number: return None, None return mcs.Util.input_to_action_and_params( - action_list[step_metadata.step_number] + action_list_from_file[step_metadata.step_number] ) diff --git a/scripts/run_human_input.py b/scripts/run_human_input.py index fa848ff33..ef282cf3a 100644 --- a/scripts/run_human_input.py +++ b/scripts/run_human_input.py @@ -37,16 +37,13 @@ class HumanInputShell(cmd.Cmd): prompt = '(command)->' - def __init__( - self, - input_controller, - input_previous_output, - input_scene_data): + def __init__(self, input_controller, input_scene_data): super(HumanInputShell, self).__init__() self.controller = input_controller - self.previous_output = input_previous_output self.scene_data = input_scene_data + self.previous_output = None + self.auto = False def precmd(self, line): return line @@ -57,46 +54,30 @@ def postcmd(self, stopFlag, line) -> bool: return stopFlag def default(self, line): - - if self.previous_output.action_list is not None and len( - self.previous_output.action_list) < len(commandList): - print('Only actions available during this step:') - for action in self.previous_output.action_list: - print(' ' + action) - else: - print('All actions are available during this step.') - - if self.previous_output.action_list is not None and len( - self.previous_output.action_list) == 1: - print('Automatically selecting the only available action...') - userInput = self.previous_output.action_list - else: - userInput = line.split(',') + split_input = line.split(',') # Check for shortcut key, if attempted shortcut key, map and check # valid key try: - if len(userInput[0]) == 1: - userInput[0] = mcs.Action(userInput[0]).value + if len(split_input[0]) == 1: + split_input[0] = mcs.Action(split_input[0]).value except BaseException: print( "You entered an invalid shortcut key, please try again. " "(Type 'help' to display commands again)") - print("You entered: " + userInput[0]) - return - - if userInput and userInput[0].lower() == 'exit': - self.do_exit(line) - return - if userInput and userInput[0].lower() == 'help': - self.do_help(line) - return - if userInput and userInput[0].lower() == 'reset': - self.do_reset(line) + print("You entered: " + split_input[0]) return - action, params = mcs.Util.input_to_action_and_params( - ','.join(userInput)) + if ( + self.auto and self.previous_output.action_list and + len(self.previous_output.action_list) == 1 + ): + print('Automatically selecting the only available action...') + action, params = self.previous_output.action_list[0] + else: + action, params = mcs.Util.input_to_action_and_params( + ','.join(split_input) + ) if action is None: print( @@ -111,7 +92,23 @@ def default(self, line): return output = self.controller.step(action, **params) - self.previous_output = output + + # The output may be None if given an invalid action. + if output: + self.previous_output = output + self.show_available_actions(self.previous_output) + # If auto mode is True, loop as long as possible. + if ( + self.auto and self.previous_output.action_list and + len(self.previous_output.action_list) == 1 + ): + self.default('') + + def help_auto(self): + print( + "Automatically runs the next action if only one action is " + "available at that step." + ) def help_print(self): print("Prints all commands that the user can use.") @@ -126,18 +123,29 @@ def help_shortcut_key_mode(self): print("Toggles on mode where the user can execute single key " "commands without hitting enter.") - def do_exit(self, args) -> bool: + def do_auto(self, args=None): + self.auto = (not self.auto) + print(f"Toggle auto mode {('ON' if self.auto else 'OFF')}") + if ( + self.auto and self.previous_output.action_list and + len(self.previous_output.action_list) == 1 + ): + self.default('') + + def do_exit(self, args=None) -> bool: print("Exiting Human Input Mode\n") self.controller.end_scene("", 1) return True - def do_print(self, args): + def do_print(self, args=None): print_commands() - def do_reset(self, args): + def do_reset(self, args=None): + print("Resetting the current scene...") self.previous_output = (self.controller).start_scene(self.scene_data) + self.show_available_actions(self.previous_output) - def do_shortcut_key_mode(self, args): + def do_shortcut_key_mode(self, args=None): print("Entering shortcut mode...") print("Press key 'e' to exit\n") list_of_action_keys = [ @@ -151,6 +159,20 @@ def do_shortcut_key_mode(self, args): elif char in list_of_action_keys: self.default(char) + def show_available_actions(self, output): + if ( + output.action_list and + len(output.action_list) < len(self.controller.ACTION_LIST) + ): + print('Only actions available during this step:') + for action, params in output.action_list: + action_string = action + ''.join([ + (',' + key + '=' + value) for key, value in params.items() + ]) + print(f' {action_string}') + else: + print('All actions available during this step.') + def build_commands(): '''Define all the possible human input commands.''' @@ -184,6 +206,7 @@ def print_commands(): print(" ") print("----------------- Other Commands -----------------") print(" ") + print("Enter 'auto' to start auto mode.") print("Enter 'print' to print the commands again.") print("Enter 'reset' to reset the scene.") print("Enter 'exit' to exit the program.") @@ -202,13 +225,13 @@ def run_scene(controller, scene_data): build_commands() print_commands() - output = controller.start_scene(scene_data) - - input_commands = HumanInputShell(controller, output, scene_data) + input_commands = HumanInputShell(controller, scene_data) + input_commands.do_reset() input_commands.cmdloop() def main(): + mcs.init_logging() args = parse_args() scene_data, status = mcs.load_scene_json_file(args.mcs_scene_json_file) diff --git a/scripts/run_last_action.py b/scripts/run_last_action.py index 843478f22..44a291320 100644 --- a/scripts/run_last_action.py +++ b/scripts/run_last_action.py @@ -1,7 +1,5 @@ from runner_script import SingleFileRunnerScript -import machine_common_sense as mcs - def action_callback(scene_data, step_metadata, runner_script): last_step = 60 @@ -9,8 +7,9 @@ def action_callback(scene_data, step_metadata, runner_script): if 'last_step' in scene_data['goal'].keys(): last_step = scene_data['goal']['last_step'] if step_metadata.step_number <= last_step: - action, params = mcs.Util.input_to_action_and_params( + action, params = ( step_metadata.action_list[len(step_metadata.action_list) - 1] + if len(step_metadata.action_list) else (None, None) ) return action, params return None, None diff --git a/scripts/run_passive_scenes.py b/scripts/run_passive_scenes.py index d3c1aceb1..b210c8cee 100644 --- a/scripts/run_passive_scenes.py +++ b/scripts/run_passive_scenes.py @@ -1,7 +1,5 @@ from runner_script import MultipleFileRunnerScript -import machine_common_sense as mcs - def action_callback(scene_data, step_metadata, runner_script): last_step = 60 @@ -9,13 +7,9 @@ def action_callback(scene_data, step_metadata, runner_script): if 'last_step' in scene_data['goal'].keys(): last_step = scene_data['goal']['last_step'] if step_metadata.step_number <= last_step: - action_list = ( - step_metadata.action_list[len(step_metadata.action_list) - 1] - if len(step_metadata.action_list) else [] - ) action, params = ( - mcs.Util.input_to_action_and_params(action_list[0]) - if len(action_list) else (None, None) + step_metadata.action_list[len(step_metadata.action_list) - 1] + if len(step_metadata.action_list) else (None, None) ) return action, params return None, None diff --git a/scripts/runner_script.py b/scripts/runner_script.py index 772a2ad98..50108be45 100644 --- a/scripts/runner_script.py +++ b/scripts/runner_script.py @@ -1,10 +1,16 @@ import argparse import glob +import logging import os.path import subprocess import machine_common_sense as mcs +logger = logging.getLogger('machine_common_sense') +logger.setLevel(logging.DEBUG) +stream_handler = logging.StreamHandler() +stream_handler.setLevel(logging.DEBUG) +logger.addHandler(stream_handler) SCRIPT_FOLDER = os.path.dirname(os.path.abspath(__file__)) BLACK_IMAGE_PATH = SCRIPT_FOLDER + '/black_image.png' diff --git a/tests/test.msgpack b/tests/test.msgpack index 6dc5a1956..f1ee1653f 100644 Binary files a/tests/test.msgpack and b/tests/test.msgpack differ diff --git a/tests/test_config_manager.py b/tests/test_config_manager.py index 68a71180a..c39a4157e 100644 --- a/tests/test_config_manager.py +++ b/tests/test_config_manager.py @@ -88,29 +88,6 @@ def test_get_aws_secret_access_key(self): self.config_mngr.get_aws_secret_access_key(), 'some_secret') - def test_get_debug_output(self): - self.assertIsNone(self.config_mngr.get_debug_output()) - - self.config_mngr._config[ - self.config_mngr.CONFIG_DEFAULT_SECTION - ][ - self.config_mngr.CONFIG_DEBUG_OUTPUT - ] = 'file' - - self.assertEqual( - self.config_mngr.get_debug_output(), - 'file') - - self.config_mngr._config[ - self.config_mngr.CONFIG_DEFAULT_SECTION - ][ - self.config_mngr.CONFIG_DEBUG_OUTPUT - ] = 'terminal' - - self.assertEqual( - self.config_mngr.get_debug_output(), - 'terminal') - def test_get_evaluation_name(self): self.assertEqual(self.config_mngr.get_evaluation_name(), '') @@ -126,7 +103,7 @@ def test_get_evaluation_name(self): @mock_env() def test_get_metadata_tier(self): - self.assertEqual(self.config_mngr.get_metadata_tier(), '') + self.assertEqual(self.config_mngr.get_metadata_tier(), 'default') self.config_mngr._config[ self.config_mngr.CONFIG_DEFAULT_SECTION @@ -203,42 +180,6 @@ def test_get_team(self): self.config_mngr.get_team(), 'team-name') - @mock_env() - def test_is_debug(self): - self.assertFalse(self.config_mngr.is_debug()) - - self.config_mngr._config[ - self.config_mngr.CONFIG_DEFAULT_SECTION - ][ - self.config_mngr.CONFIG_DEBUG - ] = 'true' - - self.assertTrue(self.config_mngr.is_debug()) - - self.config_mngr._config[ - self.config_mngr.CONFIG_DEFAULT_SECTION - ][ - self.config_mngr.CONFIG_DEBUG - ] = 'false' - - self.assertFalse(self.config_mngr.is_debug()) - - @mock_env(MCS_DEBUG_MODE='True') - def test_is_debug_true_with_env_variable(self): - self.assertTrue(self.config_mngr.is_debug()) - - @mock_env(MCS_DEBUG_MODE='') - def test_is_debug_empty_str_with_env_variable(self): - self.assertFalse(self.config_mngr.is_debug()) - - @mock_env(MCS_DEBUG_MODE='False') - def test_is_debug_false_with_env_variable(self): - self.assertFalse(self.config_mngr.is_debug()) - - @mock_env(MCS_DEBUG_MODE='0') - def test_is_debug_zero_with_env_variable(self): - self.assertFalse(self.config_mngr.is_debug()) - def test_is_evaluation(self): self.assertFalse(self.config_mngr.is_evaluation()) diff --git a/tests/test_controller.py b/tests/test_controller.py index 392cd5eba..2eee8fcce 100644 --- a/tests/test_controller.py +++ b/tests/test_controller.py @@ -21,7 +21,7 @@ class TestController(unittest.TestCase): def setUp(self): self.controller = MockControllerAI2THOR() - self.controller.set_metadata_tier('') + self.controller.set_metadata_tier('default') self.maxDiff = None @classmethod @@ -74,7 +74,9 @@ def create_retrieve_object_list_scene_event(self): }, "salientMaterials": [], "shape": "shape1", - "visibleInCamera": True + "visibleInCamera": True, + "isOpen": False, + "openable": False }, { "colorsFromMaterials": ["c2", "c3"], "direction": { @@ -111,7 +113,9 @@ def create_retrieve_object_list_scene_event(self): }, "salientMaterials": ["Foobar", "Metal", "Plastic"], "shape": "shape2", - "visibleInCamera": True + "visibleInCamera": True, + "isOpen": False, + "openable": False }, { "colorsFromMaterials": [], "direction": { @@ -148,7 +152,9 @@ def create_retrieve_object_list_scene_event(self): }, "salientMaterials": ["Wood"], "shape": "shape3", - "visibleInCamera": False + "visibleInCamera": False, + "isOpen": False, + "openable": False }] } } @@ -227,7 +233,9 @@ def create_wrap_output_scene_event(self): }, "salientMaterials": ["Wood"], "shape": "shape", - "visibleInCamera": True + "visibleInCamera": True, + "isOpen": False, + "openable": False }, { "colorsFromMaterials": [], "direction": { @@ -264,7 +272,9 @@ def create_wrap_output_scene_event(self): }, "salientMaterials": ["Wood"], "shape": "shapeHidden", - "visibleInCamera": False + "visibleInCamera": False, + "isOpen": False, + "openable": False }], "structuralObjects": [{ "colorsFromMaterials": ["c2"], @@ -302,7 +312,9 @@ def create_wrap_output_scene_event(self): }, "salientMaterials": ["Ceramic"], "shape": "structure", - "visibleInCamera": True + "visibleInCamera": True, + "isOpen": False, + "openable": False }, { "colorsFromMaterials": [], "direction": { @@ -339,7 +351,9 @@ def create_wrap_output_scene_event(self): }, "salientMaterials": ["Ceramic"], "shape": "structureHidden", - "visibleInCamera": False + "visibleInCamera": False, + "isOpen": False, + "openable": False }] } }, image_data, depth_data, object_mask_data @@ -351,7 +365,7 @@ def create_step_data(self, **kwargs): gridSize=mcs.Controller.GRID_SIZE, horizon=0, logs=True, - moveMagnitude=mcs.controller.MOVE_DISTANCE, + moveMagnitude=mcs.controller.DEFAULT_MOVE, objectId=None, objectImageCoords={ 'x': 0.0, @@ -367,8 +381,7 @@ def create_step_data(self, **kwargs): rotation={'y': 0.0}, snapToGrid=False, teleportPosition=None, - teleportRotation=None, - visibilityDistance=mcs.controller.MAX_REACH_DISTANCE + teleportRotation=None ) for key, value in kwargs.items(): @@ -522,15 +535,16 @@ def test_step_validate_action(self): output = self.controller.step('Foobar') self.assertIsNone(output) - self.controller.set_goal(mcs.GoalMetadata(action_list=[['Pass']])) + self.controller.set_goal(mcs.GoalMetadata(action_list=[ + [('Pass', {})] + ])) output = self.controller.step('MoveAhead') self.assertIsNone(output) - self.controller.set_goal( - mcs.GoalMetadata( - action_list=[ - ['MoveAhead'], - ['MoveBack']])) + self.controller.set_goal(mcs.GoalMetadata(action_list=[ + [('MoveAhead', {})], + [('MoveBack', {})]] + )) output = self.controller.step('MoveAhead') self.assertIsNotNone(output) output = self.controller.step('MoveAhead') @@ -543,28 +557,28 @@ def test_step_validate_parameters_move(self): self.controller.get_last_step_data(), self.create_step_data( action='MoveAhead', - moveMagnitude=mcs.controller.MOVE_DISTANCE)) + moveMagnitude=mcs.controller.DEFAULT_MOVE)) self.controller.step('MoveAhead') self.assertEqual( self.controller.get_last_step_data(), self.create_step_data( action='MoveAhead', - moveMagnitude=mcs.controller.MOVE_DISTANCE)) + moveMagnitude=mcs.controller.DEFAULT_MOVE)) self.controller.step('MoveAhead') self.assertEqual( self.controller.get_last_step_data(), self.create_step_data( action='MoveAhead', - moveMagnitude=mcs.controller.MOVE_DISTANCE)) + moveMagnitude=mcs.controller.DEFAULT_MOVE)) self.controller.step('MoveAhead') self.assertEqual( self.controller.get_last_step_data(), self.create_step_data( action='MoveAhead', - moveMagnitude=mcs.controller.MOVE_DISTANCE)) + moveMagnitude=mcs.controller.DEFAULT_MOVE)) def test_step_validate_parameters_rotate(self): _ = self.controller.start_scene({'name': TEST_FILE_NAME}) @@ -905,15 +919,8 @@ def test_restrict_step_output_metadata_none(self): self.assertEqual(actual.position, None) self.assertEqual(actual.rotation, None) - def test_retrieve_action_list(self): + def test_retrieve_action_list_at_step(self): test_action_list = [ - 'Pass', - 'LookUp,amount=10', - 'MoveAhead,amount=0.1', - 'PickupObject,objectId=ball', - 'PickupObject,objectId=duck' - ] - test_output_list = [ ('Pass', {}), ('LookUp', {'amount': 10}), ('MoveAhead', {'amount': 0.1}), @@ -923,12 +930,15 @@ def test_retrieve_action_list(self): # With no action list self.assertEqual( - self.controller.retrieve_action_list(mcs.GoalMetadata(), 0), + self.controller.retrieve_action_list_at_step( + mcs.GoalMetadata(), + 0 + ), self.controller.ACTION_LIST ) # With empty action list self.assertEqual( - self.controller.retrieve_action_list( + self.controller.retrieve_action_list_at_step( mcs.GoalMetadata(action_list=[]), 0 ), @@ -936,7 +946,7 @@ def test_retrieve_action_list(self): ) # With empty nested action list self.assertEqual( - self.controller.retrieve_action_list( + self.controller.retrieve_action_list_at_step( mcs.GoalMetadata(action_list=[[]]), 0 ), @@ -944,15 +954,15 @@ def test_retrieve_action_list(self): ) # With test action list self.assertEqual( - self.controller.retrieve_action_list( + self.controller.retrieve_action_list_at_step( mcs.GoalMetadata(action_list=[test_action_list]), 0 ), - test_output_list + test_action_list ) # With index greater than action list length self.assertEqual( - self.controller.retrieve_action_list( + self.controller.retrieve_action_list_at_step( mcs.GoalMetadata(action_list=[test_action_list]), 1 ), @@ -960,7 +970,7 @@ def test_retrieve_action_list(self): ) # With incorrect index self.assertEqual( - self.controller.retrieve_action_list( + self.controller.retrieve_action_list_at_step( mcs.GoalMetadata(action_list=[test_action_list, []]), 1 ), @@ -968,7 +978,7 @@ def test_retrieve_action_list(self): ) # With incorrect index self.assertEqual( - self.controller.retrieve_action_list( + self.controller.retrieve_action_list_at_step( mcs.GoalMetadata(action_list=[[], test_action_list]), 0 ), @@ -976,95 +986,29 @@ def test_retrieve_action_list(self): ) # With correct index self.assertEqual( - self.controller.retrieve_action_list( + self.controller.retrieve_action_list_at_step( mcs.GoalMetadata(action_list=[[], test_action_list]), 1 ), - test_output_list + test_action_list ) # Before last step self.assertEqual( - self.controller.retrieve_action_list( + self.controller.retrieve_action_list_at_step( mcs.GoalMetadata(action_list=[test_action_list], last_step=1), 0 ), - test_output_list + test_action_list ) # On last step self.assertEqual( - self.controller.retrieve_action_list( + self.controller.retrieve_action_list_at_step( mcs.GoalMetadata(action_list=[test_action_list], last_step=0), 0 ), [] ) - # Same, but with string_list=True - self.assertEqual( - self.controller.retrieve_action_list( - mcs.GoalMetadata(), - 0, - string_list=True - ), - [action[0] for action in self.controller.ACTION_LIST] - ) - self.assertEqual( - self.controller.retrieve_action_list( - mcs.GoalMetadata(action_list=[]), - 0, - string_list=True - ), - [action[0] for action in self.controller.ACTION_LIST] - ) - self.assertEqual( - self.controller.retrieve_action_list( - mcs.GoalMetadata(action_list=[[]]), - 0, - string_list=True - ), - [action[0] for action in self.controller.ACTION_LIST] - ) - self.assertEqual( - self.controller.retrieve_action_list( - mcs.GoalMetadata(action_list=[test_action_list]), - 0, - string_list=True - ), - test_action_list - ) - self.assertEqual( - self.controller.retrieve_action_list( - mcs.GoalMetadata(action_list=[test_action_list]), - 1, - string_list=True - ), - [action[0] for action in self.controller.ACTION_LIST] - ) - self.assertEqual( - self.controller.retrieve_action_list( - mcs.GoalMetadata(action_list=[test_action_list, []]), - 1, - string_list=True - ), - [action[0] for action in self.controller.ACTION_LIST] - ) - self.assertEqual( - self.controller.retrieve_action_list( - mcs.GoalMetadata(action_list=[[], test_action_list]), - 0, - string_list=True - ), - [action[0] for action in self.controller.ACTION_LIST] - ) - self.assertEqual( - self.controller.retrieve_action_list( - mcs.GoalMetadata(action_list=[[], test_action_list]), - 1, - string_list=True - ), - test_action_list - ) - def test_retrieve_goal(self): goal_1 = self.controller.retrieve_goal({}) self.assertEqual(goal_1.action_list, None) @@ -1088,9 +1032,9 @@ def test_retrieve_goal(self): goal_3 = self.controller.retrieve_goal({ "goal": { "action_list": [ - ["action1"], + [("MoveAhead", {"amount": 0.1})], [], - ["action2", "action3", "action4"] + [("Pass", {}), ("RotateLeft", {}), ("RotateRight", {})] ], "category": "test category", "description": "test description", @@ -1101,10 +1045,11 @@ def test_retrieve_goal(self): } } }) - self.assertEqual( - goal_3.action_list, [ - ["action1"], [], [ - "action2", "action3", "action4"]]) + self.assertEqual(goal_3.action_list, [ + [("MoveAhead", {"amount": 0.1})], + [], + [("Pass", {}), ("RotateLeft", {}), ("RotateRight", {})] + ]) self.assertEqual(goal_3.category, "test category") self.assertEqual(goal_3.description, "test description") self.assertEqual(goal_3.habituation_total, 5) @@ -1934,7 +1879,6 @@ def test_wrap_step(self): "renderObjectImage": False, "snapToGrid": False, "stringProperty": "test_property", - "visibilityDistance": 1.0, "consistentColors": False } self.assertEqual(actual, expected) @@ -1955,7 +1899,6 @@ def test_wrap_step_metadata_oracle(self): "renderObjectImage": False, "snapToGrid": False, "stringProperty": "test_property", - "visibilityDistance": 1.0, "consistentColors": True } self.assertEqual(actual, expected) @@ -1971,6 +1914,15 @@ def test_generate_noise(self): currentNoise = self.controller.generate_noise() self.assertTrue(minValue <= currentNoise <= maxValue) + def test_get_metadata_level(self): + self.assertEqual('default', self.controller.get_metadata_level()) + + self.controller.set_metadata_tier('oracle') + self.assertEqual('oracle', self.controller.get_metadata_level()) + + self.controller.set_metadata_tier('none') + self.assertEqual('none', self.controller.get_metadata_level()) + if __name__ == '__main__': unittest.main() diff --git a/tests/test_object_metadata.py b/tests/test_object_metadata.py index f5e5a1bdf..5521393bb 100644 --- a/tests/test_object_metadata.py +++ b/tests/test_object_metadata.py @@ -22,7 +22,9 @@ class TestObjectMetadata(unittest.TestCase): "shape": "", "state_list": [], "texture_color_list": [], - "visible": false + "visible": false, + "is_open": false, + "openable": false }''' @classmethod diff --git a/tests/test_plotter.py b/tests/test_plotter.py index bd1d5e00f..00b8e2edf 100644 --- a/tests/test_plotter.py +++ b/tests/test_plotter.py @@ -7,15 +7,10 @@ class TestTopDownPlotter(unittest.TestCase): - PLOT_WIDTH = 600 - PLOT_HEIGHT = 400 - def setUp(self): self.plotter = TopDownPlotter( team="test", - scene_name="scene", - plot_width=self.PLOT_WIDTH, - plot_height=self.PLOT_HEIGHT + scene_name="scene" ) def test_convert_color_empty(self): @@ -59,8 +54,6 @@ def test_plot_image_size(self): scene_event = ai2thor.server.Event(metadata=metadata) img = self.plotter.plot(scene_event=scene_event, step_number=1) self.assertIsInstance(img, PIL.Image.Image) - self.assertEqual(img.width, self.PLOT_WIDTH) - self.assertEqual(img.height, self.PLOT_HEIGHT) def test_plot_twice(self): metadata = { @@ -337,9 +330,7 @@ def test_scene_name(self): def test_scene_name_prefix(self): plotter = TopDownPlotter( team="test", - scene_name="prefix/scene", - plot_width=self.PLOT_WIDTH, - plot_height=self.PLOT_HEIGHT + scene_name="prefix/scene" ) self.assertEqual(plotter._scene_name, "scene") diff --git a/tests/test_recorder.py b/tests/test_recorder.py new file mode 100644 index 000000000..b81c55c22 --- /dev/null +++ b/tests/test_recorder.py @@ -0,0 +1,112 @@ +import unittest +import pathlib +import PIL + +from machine_common_sense.recorder import VideoRecorder + + +class TestVideoRecorder(unittest.TestCase): + + test_video_file = pathlib.Path('tests/test.mp4') + fps = 30 + + def setUp(self): + self.recorder = VideoRecorder( + vid_path=self.test_video_file, + fps=self.fps + ) + + def tearDown(self): + if self.test_video_file.exists(): + self.test_video_file.unlink() + + def test_active(self): + '''Recorder automatically starts (i.e. becomes active)''' + self.assertTrue(self.recorder.active) + + def test_thread(self): + '''Thread should start automatically''' + self.assertTrue(self.recorder.thread.is_alive()) + + def test_video_path(self): + self.assertEqual(self.recorder.path, self.test_video_file) + + def test_fps(self): + self.assertEqual(self.recorder.fps, self.fps) + + def test_default_fourcc(self): + self.assertEqual(self.recorder.fourcc, 'mp4v') + + def test_queue_empty(self): + '''No frames sitting in the queue''' + self.assertTrue(self.recorder.frame_queue.empty()) + + def test_frames_written(self): + '''No frames have been written yet''' + self.assertEqual(self.recorder._frames_written, 0) + + def test_video_writer_none(self): + '''The actual writer is None until the first frame''' + self.assertIsNone(self.recorder.writer) + + def test_flush(self): + '''Flushing an empty recorder queue should not be a problem''' + self.recorder.flush() + self.assertTrue(self.recorder.frame_queue.empty()) + + def test_add(self): + size = (50, 100) + img = PIL.Image.new("RGB", size) + self.recorder.add(img) + self.assertFalse(self.recorder.frame_queue.empty()) + self.assertIsNotNone(self.recorder.writer) + + def test_add_flush(self): + size = (50, 100) + img = PIL.Image.new("RGB", size) + self.recorder.add(img) + self.recorder.add(img) + self.recorder.add(img) + self.assertFalse(self.recorder.frame_queue.empty()) + self.recorder.flush() + self.assertEqual(self.recorder._frames_written, 3) + + def test_finish(self): + nframes = 100 + size = (50, 100) + img = PIL.Image.new("RGB", size) + for _ in range(nframes): + self.recorder.add(img) + self.recorder.finish() + self.assertFalse(self.recorder.active) + self.assertTrue(self.recorder.frame_queue.empty()) + self.assertEqual(self.recorder._frames_written, nframes) + + def test_empty_finish(self): + nframes = 0 + # wrap up the recorder without writing any frames + self.recorder.finish() + self.assertFalse(self.recorder.active) + self.assertIsNone(self.recorder.writer) + self.assertTrue(self.recorder.frame_queue.empty()) + self.assertEqual(self.recorder._frames_written, nframes) + + def test_wrong_size_frame(self): + # the first frame established the video recorder size + size = (50, 100) + img = PIL.Image.new("RGB", size) + self.recorder.add(img) + + # any different sized frame will cause a ValueError exception + wrong_size = (100, 100) + wrong_size_img = PIL.Image.new("RGB", wrong_size, color='red') + self.assertRaises(ValueError, self.recorder.add, wrong_size_img) + + self.recorder.finish() + self.assertFalse(self.recorder.active) + self.assertTrue(self.recorder.frame_queue.empty()) + self.assertEqual(self.recorder._frames_written, 1) + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/test_reward.py b/tests/test_reward.py index 966c92c8e..51e7cbea2 100644 --- a/tests/test_reward.py +++ b/tests/test_reward.py @@ -1,5 +1,4 @@ import unittest -import time from typing import Tuple from shapely import geometry @@ -9,31 +8,24 @@ class TestReward(unittest.TestCase): - def setUp(self): - self._start_at = time.time() - - def tearDown(self): - elapsed = time.time() - self._start_at - print(f"{self.id()} ({round(elapsed,2)}s)") - def test_default_reward(self): goal = mcs.GoalMetadata() reward = mcs.Reward.calculate_reward( - goal, objects={}, agent={}, number_steps=1) + goal, objects={}, agent={}, number_steps=1, reach=1.0) self.assertEqual(reward, -0.001) self.assertIsInstance(reward, float) def test_none_goal(self): goal = None reward = mcs.Reward.calculate_reward( - goal, objects={}, agent={}, number_steps=5) + goal, objects={}, agent={}, number_steps=5, reach=1.0) self.assertEqual(reward, -0.005) self.assertIsInstance(reward, float) def test_penalty_step_calcuation(self): goal = None reward = mcs.Reward.calculate_reward( - goal, objects={}, agent={}, number_steps=456) + goal, objects={}, agent={}, number_steps=456, reach=1.0) penalty = 0 - ((456) * 0.001) self.assertEqual(reward, penalty) self.assertIsInstance(reward, float) @@ -144,7 +136,8 @@ def test_retrieval_reward(self): for i in range(10): obj = {"objectId": str(i), 'isPickedUp': not i} obj_list.append(obj) - reward = mcs.Reward._calc_retrieval_reward(goal, obj_list, agent={}) + reward = mcs.Reward._calc_retrieval_reward(goal, obj_list, agent={}, + performer_reach=1.0) self.assertEqual(reward, 1) self.assertIsInstance(reward, int) @@ -155,7 +148,8 @@ def test_retrieval_reward_nothing_pickedup(self): for i in range(10): obj = {"objectId": str(i), 'isPickedUp': False} obj_list.append(obj) - reward = mcs.Reward._calc_retrieval_reward(goal, obj_list, agent={}) + reward = mcs.Reward._calc_retrieval_reward(goal, obj_list, agent={}, + performer_reach=1.0) self.assertEqual(reward, 0) self.assertIsInstance(reward, int) @@ -191,7 +185,8 @@ def test_traversal_reward(self): obj_list.append(obj) agent = {'position': {'x': -0.9, 'y': 0.5, 'z': 0.0}} - reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent) + reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent, + performer_reach=1.0) self.assertEqual(reward, 1) self.assertIsInstance(reward, int) @@ -222,7 +217,8 @@ def test_traversal_reward_large_object_inside(self): obj_list.append(obj) agent = {'position': {'x': 5.0, 'y': 0.5, 'z': 5.0}} - reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent) + reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent, + performer_reach=1.0) self.assertEqual(reward, 1) self.assertIsInstance(reward, int) @@ -253,7 +249,8 @@ def test_traversal_reward_large_object_long_side(self): obj_list.append(obj) agent = {'position': {'x': 10.1, 'y': 0.5, 'z': 1.1}} - reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent) + reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent, + performer_reach=1.0) self.assertEqual(reward, 1) self.assertIsInstance(reward, int) @@ -284,7 +281,8 @@ def test_traversal_reward_large_object_long_side_out_of_reach(self): obj_list.append(obj) agent = {'position': {'x': 11.1, 'y': 0.5, 'z': 1.1}} - reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent) + reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent, + performer_reach=1.0) self.assertEqual(reward, 0) self.assertIsInstance(reward, int) @@ -315,7 +313,8 @@ def test_traversal_reward_large_object_short_side(self): obj_list.append(obj) agent = {'position': {'x': -0.5, 'y': 0.5, 'z': 0.0}} - reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent) + reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent, + performer_reach=1.0) self.assertEqual(reward, 1) self.assertIsInstance(reward, int) @@ -346,7 +345,8 @@ def test_traversal_reward_large_object_short_side_out_of_reach(self): obj_list.append(obj) agent = {'position': {'x': -1.5, 'y': 0.5, 'z': 0.0}} - reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent) + reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent, + performer_reach=1.0) self.assertEqual(reward, 0) self.assertIsInstance(reward, int) @@ -355,7 +355,8 @@ def test_traversal_reward_outside_agent_reach(self): goal.metadata['target'] = {'id': '0'} obj_list = [] agent = {'position': {'x': -0.9, 'y': 0.5, 'z': -1.0}} - reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent) + reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent, + performer_reach=1.0) self.assertEqual(reward, 0) self.assertIsInstance(reward, int) @@ -364,7 +365,8 @@ def test_traversal_reward_with_missing_target(self): goal.metadata['target'] = {'id': '111'} # missing target obj_list = [] agent = {'position': {'x': -0.9, 'y': 0.5, 'z': 0.0}} - reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent) + reward = mcs.Reward._calc_traversal_reward(goal, obj_list, agent, + performer_reach=1.0) self.assertEqual(reward, 0) self.assertIsInstance(reward, int) @@ -400,7 +402,8 @@ def test_transferral_reward_with_missing_relationship(self): obj['position'] = {'x': 0.5 + i, 'z': 0.5} obj_list.append(obj) agent = {'position': {'x': -0.9, 'y': 0.5, 'z': 0.0}} - reward = mcs.Reward._calc_transferral_reward(goal, obj_list, agent) + reward = mcs.Reward._calc_transferral_reward(goal, obj_list, agent, + performer_reach=1.0) self.assertEqual(reward, 0) self.assertIsInstance(reward, int) @@ -436,7 +439,8 @@ def test_transferral_reward_next_to(self): obj['position'] = {'x': 0.5 + i, 'z': 0.5} obj_list.append(obj) agent = {'position': {'x': -0.9, 'y': 0.5, 'z': 0.0}} - reward = mcs.Reward._calc_transferral_reward(goal, obj_list, agent) + reward = mcs.Reward._calc_transferral_reward(goal, obj_list, agent, + performer_reach=1.0) self.assertEqual(reward, 1) self.assertIsInstance(reward, int) @@ -473,7 +477,8 @@ def test_transferral_reward_next_to_with_pickedup_object(self): obj['position'] = {'x': 0.5 + i, 'z': 0.5} obj_list.append(obj) agent = {'position': {'x': -0.9, 'y': 0.5, 'z': 0.0}} - reward = mcs.Reward._calc_transferral_reward(goal, obj_list, agent) + reward = mcs.Reward._calc_transferral_reward(goal, obj_list, agent, + performer_reach=1.0) self.assertEqual(reward, 0) self.assertIsInstance(reward, int) @@ -509,7 +514,8 @@ def test_transferral_reward_on_top_of(self): obj['position'] = {'x': 0.5, 'y': 0.0 + i, 'z': 0.5} obj_list.append(obj) agent = {'position': {'x': -0.9, 'y': 0.5, 'z': 0.0}} - reward = mcs.Reward._calc_transferral_reward(goal, obj_list, agent) + reward = mcs.Reward._calc_transferral_reward(goal, obj_list, agent, + performer_reach=1.0) self.assertEqual(reward, 1) self.assertIsInstance(reward, int) @@ -546,7 +552,8 @@ def test_transferral_reward_on_top_of_with_pickedup_object(self): obj['position'] = {'x': 0.5, 'y': 0.0 + i, 'z': 0.5} obj_list.append(obj) agent = {'position': {'x': -0.9, 'y': 0.5, 'z': 0.0}} - reward = mcs.Reward._calc_transferral_reward(goal, obj_list, agent) + reward = mcs.Reward._calc_transferral_reward(goal, obj_list, agent, + performer_reach=1.0) self.assertEqual(reward, 0) self.assertIsInstance(reward, int) diff --git a/tests/test_serializer.py b/tests/test_serializer.py index 1a8473578..c6a7d1287 100644 --- a/tests/test_serializer.py +++ b/tests/test_serializer.py @@ -17,8 +17,12 @@ def _helper_get_step_metadata(): def test_serialization_msgpack(self): unpacked_metadata = TestSerializer._helper_get_step_metadata() - assert unpacked_metadata.reward == 0.0, 'Reward unexpected.' - assert unpacked_metadata.rotation == 0.0, 'Rotation unexpected.' + assert abs(unpacked_metadata.reward - (-0.036000000000000004) + ) < 1e-04, 'Reward unexpected.' + assert abs(unpacked_metadata.rotation - + 0.0) < 1e-04, 'Rotation unexpected.' + assert isinstance(unpacked_metadata.object_list[-1].shape, str + ), 'Shape type unexpected.' def test_serialization_json(self): unpacked_metadata = TestSerializer._helper_get_step_metadata() @@ -30,8 +34,9 @@ def test_serialization_json(self): self.assertIsInstance(unpacked_metadata.depth_map_list[0], np.ndarray) self.assertEqual(unpacked_metadata.depth_map_list[0].shape, (400, 600)) self.assertIsInstance(unpacked_metadata, mcs.StepMetadata) - self.assertEqual(unpacked_metadata.reward, 0.0) - self.assertEqual(unpacked_metadata.rotation, 0.0) + self.assertAlmostEqual(unpacked_metadata.reward, -0.036000000000000004) + self.assertAlmostEqual(unpacked_metadata.rotation, 0.0, delta=1e-04) + self.assertIsInstance(unpacked_metadata.object_list[-1].shape, str) if __name__ == '__main__': diff --git a/tests/test_step_metadata.py b/tests/test_step_metadata.py index fe8c12693..848186fcd 100644 --- a/tests/test_step_metadata.py +++ b/tests/test_step_metadata.py @@ -27,6 +27,9 @@ class TestStepMetadata(unittest.TestCase): "image_list": [], "object_list": [], "object_mask_list": [], + "performer_radius": 0.0, + "performer_reach": 0.0, + "physics_frames_per_second": 0, "pose": "UNDEFINED", "position": {}, "return_status": "UNDEFINED", @@ -88,6 +91,14 @@ def test_object_mask_list(self): self.assertFalse(self.step_metadata.object_mask_list) self.assertIsInstance(self.step_metadata.object_mask_list, list) + def test_performer_radius(self): + self.assertEqual(self.step_metadata.performer_radius, 0.0) + self.assertIsInstance(self.step_metadata.performer_radius, float) + + def test_performer_reach(self): + self.assertEqual(self.step_metadata.performer_reach, 0.0) + self.assertIsInstance(self.step_metadata.performer_reach, float) + def test_pose(self): self.assertEqual(self.step_metadata.pose, mcs.Pose.UNDEFINED.value) self.assertIsInstance(self.step_metadata.pose, str) @@ -122,6 +133,85 @@ def test_str(self): self.assertEqual(str(self.step_metadata), textwrap.dedent(self.str_output)) + def test_copy_without_depth_or_images(self): + data = mcs.StepMetadata( + action_list=['action_1', 'action_2'], + camera_aspect_ratio=[3, 2], + camera_clipping_planes=[0, 10], + camera_field_of_view=10, + camera_height=2, + depth_map_list=['depth_1', 'depth_2'], + goal=mcs.GoalMetadata(metadata={'key': 'value'}), + habituation_trial=1, + head_tilt=15, + image_list=['image_1', 'image_2'], + object_list=[ + mcs.ObjectMetadata(uuid='object_1'), + mcs.ObjectMetadata(uuid='object_2') + ], + object_mask_list=['segmentation_1', 'segmentation_2'], + performer_radius=0.5, + performer_reach=1, + physics_frames_per_second=20, + pose=mcs.Pose.CRAWLING.value, + position={'x': 1, 'z': 2}, + return_status=mcs.ReturnStatus.SUCCESSFUL.value, + reward=0, + rotation=90, + step_number=25, + structural_object_list=[ + mcs.ObjectMetadata(uuid='structure_1'), + mcs.ObjectMetadata(uuid='structure_2') + ] + ) + copy = data.copy_without_depth_or_images() + # Assert are exactly equal + self.assertEqual(data.action_list, copy.action_list) + self.assertEqual(data.camera_aspect_ratio, copy.camera_aspect_ratio) + self.assertEqual( + data.camera_clipping_planes, + copy.camera_clipping_planes + ) + self.assertEqual( + data.camera_field_of_view, + copy.camera_field_of_view + ) + self.assertEqual(data.camera_height, copy.camera_height) + self.assertEqual(dict(data.goal), dict(copy.goal)) + self.assertEqual(data.habituation_trial, copy.habituation_trial) + self.assertEqual(data.head_tilt, copy.head_tilt) + self.assertEqual( + [dict(object_data) for object_data in data.object_list], + [dict(object_data) for object_data in copy.object_list] + ) + self.assertEqual(data.performer_radius, copy.performer_radius) + self.assertEqual(data.performer_reach, copy.performer_reach) + self.assertEqual( + data.physics_frames_per_second, + copy.physics_frames_per_second + ) + self.assertEqual(data.pose, copy.pose) + self.assertEqual(data.position, copy.position) + self.assertEqual(data.return_status, copy.return_status) + self.assertEqual(data.reward, copy.reward) + self.assertEqual(data.rotation, copy.rotation) + self.assertEqual(data.step_number, copy.step_number) + self.assertEqual( + [dict(object_data) for object_data in data.structural_object_list], + [dict(object_data) for object_data in copy.structural_object_list] + ) + # Assert are empty lists + self.assertEqual(copy.depth_map_list, []) + self.assertEqual(copy.image_list, []) + self.assertEqual(copy.object_mask_list, []) + # Assert are not the same instances + self.assertNotEqual(data.goal, copy.goal) + self.assertNotEqual(data.object_list, copy.object_list) + self.assertNotEqual( + data.structural_object_list, + copy.structural_object_list + ) + if __name__ == '__main__': unittest.main()