Skip to content

Dataset not well formated? #1737

Discussion options

You must be logged in to vote

Hi @johnlockejrr 👋,

The values are already absolute so that's fine 👍
But what you have is a multi-point polygon and doctr requires a 4-point polygon as label :)
So what you have simply to do is to extract the top-left, top-right, bottom-right and bottom-left points from each polygon label to get

[[x1, y1], [x2, y2], [x3, y3], [x4, y4]]

Then the polygons key in the labels.json contains all the annotations for 1 image:

{
    "sample_img_01.png" = {
        'img_dimensions': (900, 600),
        'img_hash': "theimagedumpmyhash",
        'polygons': [
             [[x1, y1], [x2, y2], [x3, y3], [x4, y4]],
             [[x1, y1], [x2, y2], [x3, y3], [x4, y4]],
            .....
        ]
     …

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@felixdittrich92
Comment options

Answer selected by johnlockejrr
@johnlockejrr
Comment options

@felixdittrich92
Comment options

@johnlockejrr
Comment options

Comment options

You must be logged in to vote
1 reply
@felixdittrich92
Comment options

Comment options

You must be logged in to vote
1 reply
@felixT2K
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants