# YoloV8 annotation format for object detection

**URL:** <https://discuss.roboflow.com/t/yolov8-annotation-format-for-object-detection/3619>\
**Category:** 🤝  Community Help\
**Created:** [November 3, 2023, 3:10pm UTC](https://discuss.roboflow.com/t/yolov8-annotation-format-for-object-detection/3619 "2023-11-03T15:10:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Malo\_Durand](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/malo_durand/32/3198_2.png) [@Malo\_Durand](https://discuss.roboflow.com/u/Malo_Durand)\
**Post date:** [November 3, 2023, 3:10pm UTC](https://discuss.roboflow.com/t/yolov8-annotation-format-for-object-detection/3619/1 "2023-11-03T15:10:05Z")

</div>

Hello everyone,

I’m trying to learn YoloV8 annotation syntax in order to build a tool for object detection model and here is what I got :

The format is supposed to be `classId,centerX,centerY,width,height`

but the thing is when I export a dataset from roboflow as TXT Format for YoloV8, I get way more values than expected :

 ![roboflow](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/4/404ad0acaba03d3385a83e9760ece1b9519f12ea.png)

I tried to identify one of the values using scales, and it appears that, at some point, the first one corresponds to a coordinate, but not the centerX. More like a point which is used to create a border.

I discussed a bit with Roboflow AI before posting this and it said that YoloV8 is having such format to create segmentatino model and all… and the format I got was indeed YoloV5’s one.

I still want to use YoloV8, so I would like to know if any of you already tried to parse such values, and if not, at least to know what they are supposed to represent, and the position of each field.

Thanks in advance, best regards.

---

<div class="post-metadata">

**Author:** ![Jacob\_Witt](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/jacob_witt/32/347_2.png) [@Jacob\_Witt](https://discuss.roboflow.com/u/Jacob_Witt)\
**Post date:** [November 3, 2023, 3:29pm UTC](https://discuss.roboflow.com/t/yolov8-annotation-format-for-object-detection/3619/2 "2023-11-03T15:29:23Z")

</div>

Are you exporting from an object detection project or an instance segmentation project?

---

<div class="post-metadata">

**Author:** ![Malo\_Durand](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/malo_durand/32/3198_2.png) [@Malo\_Durand](https://discuss.roboflow.com/u/Malo_Durand)\
**Post date:** [November 6, 2023, 9:07am UTC](https://discuss.roboflow.com/t/yolov8-annotation-format-for-object-detection/3619/4 "2023-11-06T09:07:44Z")

</div>

So I just checked the kind of project, and it says “Object Detection”. + I don’t have any choice excepted the format of which I want to export my dataset, such as YoloV8, YoloV5 Pytorch, etc… So I assume it’s only Object Detection, which should contain all this informations.

It appears though that some of my polygon contain more than 4 points. Is that a problem ?

---

<div class="post-metadata">

**Author:** ![Jacob\_Witt](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/jacob_witt/32/347_2.png) [@Jacob\_Witt](https://discuss.roboflow.com/u/Jacob_Witt)\
**Post date:** [November 6, 2023, 4:27pm UTC](https://discuss.roboflow.com/t/yolov8-annotation-format-for-object-detection/3619/5 "2023-11-06T16:27:38Z")

</div>

When you click `export`, you will see an option to pick the format type. Scroll down to pick Yolo8

 ![CleanShot 2023-11-06 at 08.25.22@2x](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/3/3fab724598e08433a87736cfd7a7afce8df2419f.png)

 ![CleanShot 2023-11-06 at 08.25.40@2x](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/a/a9495f5627ae7d86875113fd8ac7d358267bc961.jpeg)

---

<div class="post-metadata">

**Author:** ![Malo\_Durand](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/malo_durand/32/3198_2.png) [@Malo\_Durand](https://discuss.roboflow.com/u/Malo_Durand)\
**Post date:** [November 7, 2023, 8:18am UTC](https://discuss.roboflow.com/t/yolov8-annotation-format-for-object-detection/3619/6 "2023-11-07T08:18:55Z")

</div>

Well the issue is that the data I posted on my first post comes from a YoloV8 object detection export.

As I mentionned in one of my reply, some of my shape have more points than 4, is that a problem, even though the project is Object Detection and the format is YoloV8 ?

---

<div class="post-metadata">

**Author:** ![Jacob\_Witt](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/jacob_witt/32/347_2.png) [@Jacob\_Witt](https://discuss.roboflow.com/u/Jacob_Witt)\
**Post date:** [November 7, 2023, 4:44pm UTC](https://discuss.roboflow.com/t/yolov8-annotation-format-for-object-detection/3619/7 "2023-11-07T16:44:08Z")

</div>

Do you mind adding Roboflow support (via the `Invite page`) to your workspace so I can take a closer look?

---

<div class="post-metadata">

**Author:** ![Malo\_Durand](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/malo_durand/32/3198_2.png) [@Malo\_Durand](https://discuss.roboflow.com/u/Malo_Durand)\
**Post date:** [November 8, 2023, 8:57am UTC](https://discuss.roboflow.com/t/yolov8-annotation-format-for-object-detection/3619/8 "2023-11-08T08:57:13Z")

</div>

There is a checked box saying “Grand access” along side with “Roboflow Support”, so I think you already can access the repo.

[servers and rack detection - v11 2023-10-23 3:38pm (roboflow.com)](https://app.roboflow.com/vesontia/servers-and-rack-detection/11)

---

<div class="post-metadata">

**Author:** ![Jacob\_Witt](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/jacob_witt/32/347_2.png) [@Jacob\_Witt](https://discuss.roboflow.com/u/Jacob_Witt)\
**Post date:** [November 8, 2023, 3:07pm UTC](https://discuss.roboflow.com/t/yolov8-annotation-format-for-object-detection/3619/9 "2023-11-08T15:07:57Z")

</div>

Ah - this is because you are using polygon annotations. Our native train will handle the distinction and train an object detection dataset; otherwise you’ll want to do the conversion on your own if you want to train outside of our platform. Here’s a good resource: [Ultimate Guide to Converting Bounding Boxes, Masks and Polygons](https://blog.roboflow.com/convert-bboxes-masks-polygons/)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/1X/bb6edbfa56d0cf2ee603f061e9e09103502cc8cc.png) [@system](https://discuss.roboflow.com/u/system)\
**Post date:** [November 15, 2023, 3:08pm UTC](https://discuss.roboflow.com/t/yolov8-annotation-format-for-object-detection/3619/10 "2023-11-15T15:08:40Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
