How to output image binary stream results

Now, the method of result.save saves the prediction results to a file. For example:

result.save(filename=f"/test.jpg", labels=True, line_width=2, font_size=10)

But I want to get the image binary stream without saving the image to the disk. What method should I use?

When you have a result object, you can use

annotated_image = result.plot()  # include your args

which will return a numpy or PIL object. See the documentation here for more information.