File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
inference/core/workflows/core_steps
models/roboflow/multi_label_classification
sinks/roboflow/dataset_upload Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ def run_locally(
181181 api_key = self ._api_key ,
182182 )
183183 predictions = self ._model_manager .infer_from_request_sync (
184- model_id = model_id , request = request
184+ model_id = model_id , request = request , confidence = confidence
185185 )
186186 if isinstance (predictions , list ):
187187 predictions = [
Original file line number Diff line number Diff line change @@ -552,7 +552,9 @@ def is_prediction_registration_forbidden(
552552 return True
553553 if isinstance (prediction , sv .Detections ) and len (prediction ) == 0 :
554554 return True
555- if isinstance (prediction , dict ) and "top" not in prediction :
555+ if isinstance (prediction , dict ) and all (
556+ k not in prediction for k in ["top" , "predicted_classes" ]
557+ ):
556558 return True
557559 return False
558560
@@ -561,6 +563,8 @@ def encode_prediction(
561563 prediction : Union [sv .Detections , dict ],
562564) -> Tuple [str , str ]:
563565 if isinstance (prediction , dict ):
566+ if "predicted_classes" in prediction :
567+ return "," .join (prediction ["predicted_classes" ]), "txt"
564568 return prediction ["top" ], "txt"
565569 detections_in_inference_format = serialise_sv_detections (detections = prediction )
566570 return json .dumps (detections_in_inference_format ), "json"
You can’t perform that action at this time.
0 commit comments