Spaces:
Sleeping
Sleeping
Commit
·
be00b48
1
Parent(s):
64d7cd0
Add challenge_evaluate option to validate function in CLI
Browse files- medvqa/cli.py +9 -4
medvqa/cli.py
CHANGED
|
@@ -10,7 +10,7 @@ If it still cannot solve the problem, don't hesitate to add an issue at https://
|
|
| 10 |
⚠️⚠️⚠️'''
|
| 11 |
|
| 12 |
|
| 13 |
-
def validate(args, unk_args, submit=False):
|
| 14 |
# Dynamically find the base directory of the MedVQA library
|
| 15 |
base_dir = os.path.dirname(os.path.abspath(__file__))
|
| 16 |
|
|
@@ -27,6 +27,9 @@ def validate(args, unk_args, submit=False):
|
|
| 27 |
if submit:
|
| 28 |
subprocess.run(['python', task_file] + unk_args,
|
| 29 |
env={**os.environ, "_MEDVQA_SUBMIT_FLAG_": "TRUE"})
|
|
|
|
|
|
|
|
|
|
| 30 |
else:
|
| 31 |
subprocess.run(
|
| 32 |
['python', task_file] + unk_args)
|
|
@@ -35,9 +38,9 @@ def validate(args, unk_args, submit=False):
|
|
| 35 |
def main():
|
| 36 |
parser = argparse.ArgumentParser(description='MedVQA CLI')
|
| 37 |
subparsers = parser.add_subparsers(
|
| 38 |
-
dest='command', required=True, help="Either 'validate' or '
|
| 39 |
|
| 40 |
-
for cmd in ['validate', 'validate_and_submit']:
|
| 41 |
subparser = subparsers.add_parser(cmd)
|
| 42 |
subparser.add_argument(
|
| 43 |
'--competition', required=True, help='Name of the competition (e.g., gi-2025)')
|
|
@@ -47,8 +50,10 @@ def main():
|
|
| 47 |
args, _unk_args = parser.parse_known_args()
|
| 48 |
if args.command == 'validate':
|
| 49 |
validate(args, _unk_args)
|
| 50 |
-
|
| 51 |
validate(args, _unk_args, submit=True)
|
|
|
|
|
|
|
| 52 |
|
| 53 |
|
| 54 |
if __name__ == "__main__":
|
|
|
|
| 10 |
⚠️⚠️⚠️'''
|
| 11 |
|
| 12 |
|
| 13 |
+
def validate(args, unk_args, submit=False, challenge_evaluate=False):
|
| 14 |
# Dynamically find the base directory of the MedVQA library
|
| 15 |
base_dir = os.path.dirname(os.path.abspath(__file__))
|
| 16 |
|
|
|
|
| 27 |
if submit:
|
| 28 |
subprocess.run(['python', task_file] + unk_args,
|
| 29 |
env={**os.environ, "_MEDVQA_SUBMIT_FLAG_": "TRUE"})
|
| 30 |
+
elif challenge_evaluate:
|
| 31 |
+
subprocess.run(['python', task_file] + unk_args,
|
| 32 |
+
env={**os.environ, "_MEDVQA_CHALLENGE_EVALUATE_FLAG_": "TRUE"})
|
| 33 |
else:
|
| 34 |
subprocess.run(
|
| 35 |
['python', task_file] + unk_args)
|
|
|
|
| 38 |
def main():
|
| 39 |
parser = argparse.ArgumentParser(description='MedVQA CLI')
|
| 40 |
subparsers = parser.add_subparsers(
|
| 41 |
+
dest='command', required=True, help="Either 'validate', 'validate_and_submit', or 'challenge_evaluate'")
|
| 42 |
|
| 43 |
+
for cmd in ['validate', 'validate_and_submit', 'challenge_evaluate']:
|
| 44 |
subparser = subparsers.add_parser(cmd)
|
| 45 |
subparser.add_argument(
|
| 46 |
'--competition', required=True, help='Name of the competition (e.g., gi-2025)')
|
|
|
|
| 50 |
args, _unk_args = parser.parse_known_args()
|
| 51 |
if args.command == 'validate':
|
| 52 |
validate(args, _unk_args)
|
| 53 |
+
elif args.command == 'validate_and_submit':
|
| 54 |
validate(args, _unk_args, submit=True)
|
| 55 |
+
elif args.command == 'challenge_evaluate':
|
| 56 |
+
validate(args, _unk_args, challenge_evaluate=True)
|
| 57 |
|
| 58 |
|
| 59 |
if __name__ == "__main__":
|