Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import JSON format annotations #65

Closed
lonnylundsten opened this issue Nov 20, 2018 · 7 comments
Closed

import JSON format annotations #65

lonnylundsten opened this issue Nov 20, 2018 · 7 comments

Comments

@lonnylundsten
Copy link

I would like to have the ability to import JSON annotation files. See attached file for format type.
Here's an example of the JSON:

{
"detections": [
{
"image_file": "Osedax_lonnyi.jpeg",
"species": "round",
"subspecies": "red hake",
"id": "1",
"x": "0",
"y": "0",
"w": "85",
"h": "85",
"type": "box"
},
{
"image_file": "Osedax_lonnyi.jpeg",
"species": "round",
"subspecies": "red hake",
"id": "2",
"x": "0",
"y": "0",
"w": "85",
"h": "85",
"type": "box"
},
{
"image_file": "Osedax_lonnyi.jpeg",
"species": "round",
"subspecies": "red hake",
"id": "3",
"x": "0",
"y": "0",
"w": "85",
"h": "85",
"type": "box"
},
{
"image_file": "Osedax_lonnyi.jpeg",
"species": "round",
"subspecies": "red hake",
"id": "4",
"x": "0",
"y": "0",
"w": "85",
"h": "85",
"type": "box"
},
{
"image_file": "Osedax_lonnyi.jpeg",
"species": "round",
"subspecies": "red hake",
"id": "5",
"x": "145",
"y": "573",
"w": "231",
"h": "114",
"type": "box"
},
{
"image_file": "Osedax_lonnyi.jpeg",
"species": "round",
"subspecies": "red hake",
"id": "6",
"x": "483",
"y": "479",
"w": "218",
"h": "150",
"type": "box"
},
{
"image_file": "Osedax_lonnyi.jpeg",
"species": "round",
"subspecies": "red hake",
"id": "7",
"x": "562",
"y": "308",
"w": "110",
"h": "120",
"type": "box"
},
{
"image_file": "Osedax_lonnyi.jpeg",
"species": "round",
"subspecies": "red hake",
"id": "8",
"x": "994",
"y": "314",
"w": "143",
"h": "225",
"type": "box"
}
],
"global_state": [
{
"state": "ad",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "anemone",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "bhydra",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "brittlestar",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "clams",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "cobble",
"value": "false",
"header": "Substrates",
"type": "bool"
},
{
"state": "comments",
"value": "",
"header": "Info",
"type": "string"
},
{
"state": "coral",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "ctenophores",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "detritus",
"value": "false",
"header": "Substrates",
"type": "bool"
},
{
"state": "echinodermother",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "euphausids",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "filo",
"value": "false",
"header": "Substrates",
"type": "bool"
},
{
"state": "gravel",
"value": "false",
"header": "Substrates",
"type": "bool"
},
{
"state": "holes",
"value": "false",
"header": "Substrates",
"type": "bool"
},
{
"state": "imagehasbeenchecked",
"value": "false",
"header": "Info",
"type": "bool"
},
{
"state": "imagehasbeenmeasured",
"value": "false",
"header": "Info",
"type": "bool"
},
{
"state": "jellyfish",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "mussels",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "othercrustaceans",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "othermolluscs",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "rock",
"value": "false",
"header": "Substrates",
"type": "bool"
},
{
"state": "sand",
"value": "false",
"header": "Substrates",
"type": "bool"
},
{
"state": "sanddollars",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "sandlance",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "sandripple",
"value": "false",
"header": "Substrates",
"type": "bool"
},
{
"state": "seaweed",
"value": "false",
"header": "Substrates",
"type": "bool"
},
{
"state": "seed",
"value": "false",
"header": "Substrates",
"type": "bool"
},
{
"state": "shelldebris",
"value": "false",
"header": "Substrates",
"type": "bool"
},
{
"state": "silt",
"value": "false",
"header": "Substrates",
"type": "bool"
},
{
"state": "sponges",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "tunicate",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "urchin",
"value": "false",
"header": "Organisms",
"type": "bool"
},
{
"state": "wasvisible",
"value": "false",
"header": "Info",
"type": "bool"
}
]
}

@ryouchinsa
Copy link
Owner

Could you tell us which neural network tools are using the JSON format?
Let us know the url of the JSON format details.

@lonnylundsten
Copy link
Author

lonnylundsten commented Nov 21, 2018

We're trying to use RectLabel so that it can input/output files that are compatible with tator -- a program that external colleagues are using for image and video annotation.
Here's the link:
https://github.com/cvisionai/Tator

@ryouchinsa
Copy link
Owner

At first, though you can label with Tator, why do you use RectLabel with Tator?

Let us ask some questions about the JSON format.

  • The "image_file" does not include its folder path. Can we assume those images are in the same folder as the JSON file?

  • Is the "id" necessary in the "detection" dictionary? RectLabel can preserve the order of boxes.

  • For the "type": "box", are there any other types?

  • RectLabel represents the label name combining the object name and some attribute names.
    The "species" would be the object name. The "subspecies" would be an attribute name.
    When RectLabel imports the label {"species": "round", "subspecies": "red hake"}, the label name would be converted to "round-red hake".
    Is it ok for you?

  • For the "global_state", what does it mean? Do you have to import the meta data and edit on RectLabel?

@lonnylundsten
Copy link
Author

Hi Ryo,

First, we have been using RectLabel for a while now, we know how to use it, and we are all MacOS users so it makes more sense to continue using it. It has a more intuitive feel. We have a colleague that is using tator so interoperability is helpful. I thought adding JSON capability would be straightforward and beneficial to others, if not, maybe we should not pursue this.

#1. Yes, Tator assumes annotations are inside the image folder.
#2. I don't know.
#3. There are box, line, and point annotations.
#4. Yes
#5. I don't know, but probably not necessary.

Thank you,
Lonny

@ryouchinsa
Copy link
Owner

Thanks for answering the questions.

To label video frames, you might need the Tator.

For the first implementation, if we could ignore the "global_state" and convert the lines and points to the polygons, importing the Tator JSON files into XML files would be possible.

Let us read the document for a while.

Now we are working on the super pixel and brush tools so that it would take time.
https://rectlabel.com/help#feedback

@matsujju
Copy link

Hey guys,
I am new here.
Can someone guide me for conversion of image annotated json files to the compatible one for U-net model?
I have images and labelled images(used polygon shapes for segmentation) in different folders and each label image is in one json file. (used Labelme tool for annotation)
I think the format of files are not appropriate for loading images and label files in the model(U-net).
Any help will be appreciated.

@ryouchinsa
Copy link
Owner

Currently If you need our support to implement this feature, please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants