From ad32a8ee5760601632dd5835376b77b598c99401 Mon Sep 17 00:00:00 2001 From: Riti Sharma <52715641+sharma-riti@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:53:48 -0700 Subject: [PATCH] add batch scoring script for other od models (#2690) * add batch scoring for other od models * fix doc * remove duplicate scoring script --- .../scripts/batch_scoring.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sdk/python/jobs/automl-standalone-jobs/automl-image-object-detection-task-fridge-items-batch-scoring/scripts/batch_scoring.py b/sdk/python/jobs/automl-standalone-jobs/automl-image-object-detection-task-fridge-items-batch-scoring/scripts/batch_scoring.py index 70543715ea..5591c6e82c 100644 --- a/sdk/python/jobs/automl-standalone-jobs/automl-image-object-detection-task-fridge-items-batch-scoring/scripts/batch_scoring.py +++ b/sdk/python/jobs/automl-standalone-jobs/automl-image-object-detection-task-fridge-items-batch-scoring/scripts/batch_scoring.py @@ -2,10 +2,7 @@ # Licensed under the MIT license. import os -import argparse -import json -from azureml.core.model import Model from azureml.automl.core.shared import logging_utilities from azureml.automl.dnn.vision.common.logging_utils import get_logger @@ -13,6 +10,12 @@ load_model, run_inference_batch, ) + +# Uncomment line 16-18 and comment line 19-21 to run batch scoring +# for models other than yolo. +# from azureml.automl.dnn.vision.object_detection.writers.score import ( +# _score_with_model, +# ) from azureml.automl.dnn.vision.object_detection_yolo.writers.score import ( _score_with_model, ) @@ -49,6 +52,7 @@ def init(): def run(mini_batch): logger.info("Running inference.") - result = run_inference_batch(model, mini_batch, _score_with_model, batch_size) + result = run_inference_batch( + model, mini_batch, _score_with_model, batch_size) logger.info("Finished inferencing.") return result