|
import argparse |
|
from code.detection3d import Detection3dEval |
|
from code.eval_handler import EvaluationHandler |
|
from code.semantic_segmentation import SemanticSegmentationEval |
|
|
|
from aidisdk import AIDIClient |
|
|
|
|
|
def process(args): |
|
task_type = args.task_type |
|
endpoint = args.endpoint |
|
token = args.token |
|
experiment_name = args.experiment_name |
|
group_name = args.group_name |
|
run_name = args.run_name |
|
if args.images_dataset_id: |
|
images_dataset_id = args.images_dataset_id |
|
else: |
|
images_dataset_id = None |
|
if args.labels_dataset_id: |
|
labels_dataset_id = args.labels_dataset_id |
|
else: |
|
labels_dataset_id = None |
|
if args.predictions_dataset_id: |
|
predictions_dataset_id = args.predictions_dataset_id |
|
else: |
|
predictions_dataset_id = None |
|
if args.gt_dataset_id: |
|
gt_dataset_id = args.gt_dataset_id |
|
else: |
|
gt_dataset_id = None |
|
prediction_name = args.prediction_name |
|
setting_file_name = args.setting_file_name |
|
|
|
if task_type == "Detection_3D": |
|
eval_class = Detection3dEval |
|
elif task_type == "Semantic_Segmentation": |
|
eval_class = SemanticSegmentationEval |
|
else: |
|
raise NotImplementedError |
|
|
|
client = AIDIClient(token=token, endpoint=endpoint) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
with client.experiment.init( |
|
experiment_name=experiment_name, run_name=run_name, enabled=True |
|
) as run: |
|
|
|
|
|
|
|
|
|
run.log_runtime( |
|
runtime="local", |
|
horizon_hat="1.3.1", |
|
) |
|
|
|
EvaluationHandler( |
|
endpoint, |
|
token, |
|
group_name, |
|
images_dataset_id, |
|
gt_dataset_id, |
|
labels_dataset_id, |
|
predictions_dataset_id, |
|
prediction_name, |
|
setting_file_name, |
|
eval_class, |
|
).execute() |
|
|
|
|
|
if __name__ == "__main__": |
|
parser = argparse.ArgumentParser() |
|
parser.add_argument("--task_type", type=str) |
|
parser.add_argument("--endpoint", type=str) |
|
parser.add_argument("--token", type=str) |
|
parser.add_argument("--group_name", type=str) |
|
parser.add_argument("--experiment_name", type=str) |
|
parser.add_argument("--run_name", type=str) |
|
parser.add_argument("--images_dataset_id", type=str) |
|
parser.add_argument("--gt_dataset_id", type=str) |
|
parser.add_argument("--labels_dataset_id", type=str) |
|
parser.add_argument("--predictions_dataset_id", type=str) |
|
parser.add_argument("--prediction_name", type=str) |
|
parser.add_argument("--setting_file_name", type=str) |
|
args = parser.parse_args() |
|
process(args) |
|
|