question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support key points in COCO/TFRecord/YOLO formats

See original GitHub issue

I tried to generate “dump my annotation” to different formats, but only CVAT XML generated properly. I correctly annotated the images, because the CVAT XML contains my points data, and I see the annotation even if I close and reopen the job. YOLO format text files are empty. At TF Record format, the the label_map.pbtxt is generated properly, but the binary .tfrecord file size is 0 byte.

What did I do wrong?

An empty PASCAL VOC file:

<annotation>
    <folder></folder>
    <filename>IMG_160729_071349_0000_RGB.JPG</filename>
    <path></path>
    <source>
        <database>Unknown</database>
    </source>
    <size>
        <width>4608</width>
        <height>3456</height>
        <depth>3</depth>
    </size>
    <segmented>0</segmented>

</annotation>

Part of the CVAT XML file which contains the points:

<image id="0" name="IMG_160729_071349_0000_RGB.JPG" width="4608" height="3456">
    <polygon label="tree" occluded="0" points="810.72,479.23;720.24,541.51; ...
    </polygon>
    <polygon label="tree" occluded="0" points="1791.47,904.28;1802.24,861.19; ...
	</polygon>
    <polygon label="tree" occluded="0" points="1650.91,1209.43;1619.18,1221.18; ...
	</polygon>
    <polygon label="tree" occluded="0" points="782.52,465.13;757.85,451.03;737.87,431.06; ...
	</polygon>
    <polygon label="tree" occluded="0" points="1173.69,992.94;1204.97,995.66;1217.21,965.05; ...
	</polygon>
    <polygon label="tree" occluded="0" points="1631.40,518.13;1593.10,525.65;1593.10,525.65; ...
	</polygon>
    <polygon label="tree" occluded="0" points="1932.48,627.94;1977.53,644.59;2012.78,612.27; ...
	</polygon>
    <polygon label="tree" occluded="0" points="695.08,120.67;616.20,152.63;599.20,160.11; ...
	</polygon>
    <polygon label="roof" occluded="0" points="1937.74,955.25;1880.60,938.72;1829.60,937.78; ...
	</polygon>
  </image>
  <image id="1" name="IMG_160729_071351_0001_RGB.JPG" width="4608" height="3456"> ...
   ...

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
azhavorocommented, Nov 6, 2019
0reactions
zhiltsov-maxcommented, Oct 28, 2020

In general, TFrecords have no fixed format. Technically, we could come up with our own format, allowing exporting all CVAT data, but this format would be incompatible with any existing tools and scripts. If there is an established format for keypoints in TFrecords, we can implement it - please, give a link to its specification.

To export lists of points in COCO format, do:

  1. Export task in Datumaro format
  2. Follow README.md
  3. datum project export -f coco_instances [-- --save-images]

This way, you can export points, but they won’t contain visibility info.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Convert Dataset Formats — FiftyOne 0.18.0 documentation
In this recipe we'll use the FiftyOne Dataset Zoo to download some open source datasets to work with. Specifically, we'll need TensorFlow and...
Read more >
How to Create to a TFRecord File for Computer Vision
We'll break it down in this post: the what, why, and how of TFRecords for computer vision.
Read more >
Converting a custom dataset from COCO format to YOLO format
Converting a custom dataset from COCO format to YOLO format · 1. The first element of each row is a class id, then...
Read more >
COCO Object Detection dataset in TFRecord - Kaggle
Therefore, having our data stored as thousands of individual files is not ideal. We are going to batch the COCO dataset with object...
Read more >
Conversion of image annotation formats into tfrecords for ...
As, we know there are two annotation formats for images, Pascal VOC and COCO formats. Both have their own specification here's the main...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found