diff --git a/inference/core/interfaces/stream_manager/manager_app/inference_pipeline_manager.py b/inference/core/interfaces/stream_manager/manager_app/inference_pipeline_manager.py index af3acb1f3..03762ecda 100644 --- a/inference/core/interfaces/stream_manager/manager_app/inference_pipeline_manager.py +++ b/inference/core/interfaces/stream_manager/manager_app/inference_pipeline_manager.py @@ -293,15 +293,6 @@ def webrtc_sink( "Please try to adjust the scene so models detect objects" ) errors.append("or stop preview, update workflow and try again.") - elif parsed_payload.stream_output[0] not in prediction: - if not parsed_payload.stream_output[0]: - errors.append("No stream output selected to show") - else: - errors.append( - f"{parsed_payload.stream_output[0]} not available in results" - ) - errors.append("Please stop, update outputs and try again") - if errors: result_frame = video_frame.image.copy() for row, error in enumerate(errors): result_frame = cv.putText( @@ -315,6 +306,13 @@ def webrtc_sink( ) from_inference_queue.sync_put(result_frame) return + if parsed_payload.stream_output[0] not in prediction or not isinstance( + prediction[parsed_payload.stream_output[0]], WorkflowImageData + ): + for output in prediction.values(): + if isinstance(output, WorkflowImageData): + from_inference_queue.sync_put(output.numpy_image) + return from_inference_queue.sync_put( prediction[parsed_payload.stream_output[0]].numpy_image )