-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #425 from NextCenturyCorporation/development
[Python] Release 0.4.6
- Loading branch information
Showing
13 changed files
with
65 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.4.5' | ||
__version__ = '0.4.6' |
37 changes: 37 additions & 0 deletions
37
machine_common_sense/scripts/extract_ground_truth_from_debug_files.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import argparse | ||
import glob | ||
import json | ||
|
||
|
||
def main(debug_scene_folder: str, output_file_name: str): | ||
json_file_list = glob.glob(debug_scene_folder + '*_debug.json') | ||
json_file_list = sorted(json_file_list) | ||
print(f'Found {len(json_file_list)} debug files in {debug_scene_folder}') | ||
all_ground_truth = {} | ||
for json_file_name in json_file_list: | ||
with open(json_file_name) as json_file: | ||
data = json.load(json_file) | ||
scene_name = data['name'] | ||
ground_truth = data['goal']['answer']['choice'] | ||
all_ground_truth[scene_name] = ground_truth | ||
print(f'Saving {len(all_ground_truth.keys())} rows to {output_file_name}') | ||
with open(output_file_name, 'w') as output_file: | ||
output_file.write('scene_name,ground_truth\n') | ||
for scene_name, ground_truth in all_ground_truth.items(): | ||
output_file.write(f'{scene_name},{ground_truth}\n') | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(description=('Extract Ground Truth')) | ||
parser.add_argument( | ||
'debug_scene_folder', | ||
type=str, | ||
help='Folder containing the MCS scene JSON debug files' | ||
) | ||
parser.add_argument( | ||
'output_file_name', | ||
type=str, | ||
help='Name of the output CSV file' | ||
) | ||
args = parser.parse_args() | ||
main(args.debug_scene_folder, args.output_file_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
machine_common_sense/scripts/run_interactive_scenes_pass.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from runner_script import MultipleFileRunnerScript | ||
|
||
|
||
def action_callback(scene_data, step_metadata, runner_script): | ||
return 'Pass', {} | ||
|
||
|
||
def main(): | ||
MultipleFileRunnerScript('Interactive Scenes - Pass', action_callback) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
6 changes: 3 additions & 3 deletions
6
...n_sense/scripts/run_interactive_scenes.py → .../scripts/run_interactive_scenes_rotate.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters