How to programmatically add polygon annotations text files with a matching image?

Hi, I tried loading images with text files annotated as polygon (x1,y,…x4,y4).
I had two problems:

  1. The annotations are not drawn on the image as a polygon but as a BB. I want to put in YOLOv5 ob.
  2. Some of the images have no objects, so the annotation file is empty. The software recognizes this as annotation images. How to solve?

Please share the following so we may better assist you:

  1. Project type (Object detection-Polygon)
  2. The operating system & browser you are using and their versions: windows10
  1. Some of the images have no objects, so the annotation file is empty. The software recognizes this image to be without annotations.


Full resources for Uploading via API are here Upload API - Roboflow

This video is a detailed walk through which shows uploading multiple detection formats Upload an Annotation with the Roboflow API - YouTube

For images without objects, you’ll need to indicate if they are unannotated or if they are NULL. Unannotated would put them into a queue to be annotated and NULL would indicate your objects of interest are not in the image.

Thank you very much for the answer! I’ll go over it .
Have a nice day and thanks again!

‫בתאריך יום ג׳, 14 בפבר׳ 2023 ב-18:54 מאת ‪trevorhlynn via Roboflow‬‏ <‪‬‏>:‬

Hi Trevor,
Well, I watched the video. I’ll give it a try although I’ve already tried programmatically uploading files and it didn’t recognize them as OBB text files. Is there no parameter in the API for polygon type annotation?
Another problem: I have some text files that are NULL. How can these files be uploaded programmatically? Last time I tried, the images just came up without the corresponding empty text files.

Thank You!

YOLOv5 format doesn’t keep annotation records for null annotations. You’ll need to mark those images null in the platform.

Did your YOLOv5-obb format match the example on the annotation formats examples page?

We do have a CLI option for upload, too: Command Line Interface - Roboflow