How to insert information text to image frame?

Hi, I am working on a 3-class image detector. I am currently using yolov4 on pytorch. I am able to detect several classes in a single image. I want to improve it by counting the number of images per class and displaying on the top left hand of the image. For example, if the image has detected 2 broccolis and 1 carrot, the image should have “broccoli: 2, carrot: 1” text on the top left hand of the image in addition to the bounding boxes. What command do I have to input to have text on the top left corner of the image? [note: I am new to pytorch so I’m not familiar with the commands]

You won’t be able to use PyTorch directly to add text to an image, but should instead use any image processing library such as PIL.
This post describes how text can be added to a PIL.Image.