Skip to content

Conversation

@Fl4m3Ph03n1x
Copy link
Contributor

@Fl4m3Ph03n1x Fl4m3Ph03n1x commented Dec 29, 2021

Background

This PR adds attribute import support for superannotate attributes.

How can I test?

Before testing there is one important detail: The attributes will only be imported if they already exist. Because for this condition to be true, the AnnotationClass must already exist and have the attributes defined, this means that if you are importing a new class, the class import will work, but it won't have any attributes.

A print message was added to give visibility to this issue.

test.json

{
    "instances": [
        {
            "type": "bbox",
            "classId": 2,
            "probability": 100,
            "points": {
                "x1": 275.4,
                "x2": 570.3,
                "y1": 590.8,
                "y2": 1440
            },
            "groupId": 0,
            "pointLabels": {},
            "locked": false,
            "visible": true,
            "attributes": [
                {
                    "id": 2,
                    "groupId": 1
                },
                {
                    "id": 3,
                    "groupId": 2
                }
            ]
        }
    ],
    "tags": [],
    "metadata": {
        "version": "1.0.0",
        "name": "sonnie-hiles-PUBt7UPbJFY-unsplash.jpg",
        "status": "Completed"
    }
}

classes.json

[
    {
        "attribute_groups": [
            {
                "id": 1,
                "name": "Sex",
                "is_multiselect": false,
                "attributes": [
                    {
                        "id": 1,
                        "name": "Male"
                    },
                    {
                        "id": 2,
                        "name": "Female"
                    }
                ],
                "opened": true,
                "hasChanges": false
            },
            {
                "id": 2,
                "name": "Emotion",
                "is_multiselect": false,
                "attributes": [
                    {
                        "id": 3,
                        "name": "Smiling"
                    },
                    {
                        "id": 4,
                        "name": "Sadness"
                    },
                    {
                        "id": 5,
                        "name": "Crying"
                    }
                ],
                "opened": true,
                "hasChanges": false
            }
        ],
        "color": "#fd7007",
        "id": 2,
        "name": "Pedestrian",
        "opened": true
    }
]

command:
darwin dataset import cars superannotate YOUR_FOLDER

@Fl4m3Ph03n1x Fl4m3Ph03n1x added documentation Improvements or additions to documentation enhancement New feature or request wind-team labels Dec 29, 2021
@Fl4m3Ph03n1x Fl4m3Ph03n1x self-assigned this Dec 29, 2021
Copy link
Member

@andreaazzini andreaazzini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One tiny thing

Copy link
Member

@andreaazzini andreaazzini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now!

@Fl4m3Ph03n1x Fl4m3Ph03n1x merged commit 18a3d07 into master Dec 30, 2021
@Fl4m3Ph03n1x Fl4m3Ph03n1x deleted the v7-2629-support-attributes branch December 30, 2021 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request wind-team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants