Parse command line arguments
()
| 7 | |
| 8 | |
| 9 | def parse_args(): |
| 10 | """Parse command line arguments""" |
| 11 | CUR_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 12 | parser = argparse.ArgumentParser( |
| 13 | description='MBench: Motion generation benchmark', |
| 14 | formatter_class=argparse.RawTextHelpFormatter |
| 15 | ) |
| 16 | parser.add_argument( |
| 17 | "--output_path", |
| 18 | type=str, |
| 19 | default='./evaluation_results/', |
| 20 | help="Output path to save the evaluation results", |
| 21 | ) |
| 22 | parser.add_argument( |
| 23 | "--full_info_json", |
| 24 | type=str, |
| 25 | default=f'{CUR_DIR}/data/meta_info/MBench_eval_info.json', |
| 26 | help="Path to the JSON file that contains the prompt and dimension information", |
| 27 | ) |
| 28 | parser.add_argument( |
| 29 | "--evaluation_path", |
| 30 | type=str, |
| 31 | required=True, |
| 32 | help="Folder that contains the model generated results", |
| 33 | ) |
| 34 | parser.add_argument( |
| 35 | "--dimension", |
| 36 | nargs='+', |
| 37 | default=None, |
| 38 | help="List of evaluation dimensions, usage: --dimension <dim_1> <dim_2>", |
| 39 | ) |
| 40 | parser.add_argument( |
| 41 | "--device", |
| 42 | type=str, |
| 43 | default="cuda" if torch.cuda.is_available() else "cpu", |
| 44 | help="Device to use for evaluation (cuda or cpu)", |
| 45 | ) |
| 46 | # Dimension-specific arguments |
| 47 | parser.add_argument( |
| 48 | "--gemini_api_key", |
| 49 | type=str, |
| 50 | default=None, |
| 51 | help="Gemini API key for Action_Accuracy evaluation (can also use GEMINI_API_KEY env var)", |
| 52 | ) |
| 53 | args = parser.parse_args() |
| 54 | return args |
| 55 | |
| 56 | |
| 57 | def main(): |