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

No default attributes in dumped annotation #601

Closed
sbanori opened this issue Jul 31, 2019 · 6 comments · Fixed by #656
Closed

No default attributes in dumped annotation #601

sbanori opened this issue Jul 31, 2019 · 6 comments · Fixed by #656
Assignees
Labels
bug Something isn't working

Comments

@sbanori
Copy link

sbanori commented Jul 31, 2019

Hello,
I have a little problem after dump annotation. But first... My labels look this like:

Label_1 @Number=Shelf_ID:1,10,1 @checkbox=Face:true @Number=Order_on_shelf:1,50,1
Label_2 @Number=Shelf_ID:1,10,1 @checkbox=Face:true @Number=Order_on_shelf:1,50,1
Label_3 @Number=Shelf_ID:1,10,1 @checkbox=Face:true @Number=Order_on_shelf:1,50,1
Label_4 @Number=Shelf_ID:1,10,1 @checkbox=Face:true @Number=Order_on_shelf:1,50,1
Label_5 @Number=Shelf_ID:1,10,1 @checkbox=Face:true @Number=Order_on_shelf:1,50,1

On annotated photo we see a rack in the shop with few shelfs. We use attributes to count on which shelf and on which place on shelf is annotated product. Of course on every photo we don't need to change attributes for only one product (this product which have posistion on first shelf and on the first position on shelf) so it means that default attributes are good for him.

And here we have a problem because if we won't do anything with any attribute on this instance of label, after dump annotation, in xml file we can see only his name but with no values of attributes like below:

<box label="Label_1" occluded="0" xtl="308.15" ytl="1436.57" xbr="536.26" ybr="1707.47">
      <attribute name="Order_on_shelf">2</attribute>
      <attribute name="Shelf_ID">1</attribute>
      <attribute name="Face">false</attribute>
    </box>
    <box label="Label_2" occluded="0" xtl="3.26" ytl="1410.68" xbr="119.15" ybr="1680.02">
    </box>
    <box label="Label_3" occluded="0" xtl="527.86" ytl="1492.75" xbr="760.65" ybr="1722.92">
      <attribute name="Order_on_shelf">3</attribute>
      <attribute name="Face">true</attribute>
      <attribute name="Shelf_ID">1</attribute>
    </box>

When I will change any attribute on this instance for example:

  1. Shelf_ID=1 ---> ShelfId=2
  2. Save work
  3. Shelf_ID=2 ---> Shelft_ID=1
  4. Save work.

Then everything is OK, instance was "touched" so we can see his default values, but only because I changed them for a moment. After dump anotation we see now correct values.:

<box label="Label_1" occluded="0" xtl="308.15" ytl="1436.57" xbr="536.26" ybr="1707.47">
      <attribute name="Order_on_shelf">2</attribute>
      <attribute name="Shelf_ID">1</attribute>
      <attribute name="Face">false</attribute>
    </box>
    <box label="Label_2" occluded="0" xtl="3.26" ytl="1410.68" xbr="119.15" ybr="1680.02">
      <attribute name="Order_on_shelf">1</attribute>
      <attribute name="Shelf_ID">1</attribute>
      <attribute name="Face">true</attribute>
    </box>
    <box label="Label_3" occluded="0" xtl="527.86" ytl="1492.75" xbr="760.65" ybr="1722.92">
      <attribute name="Order_on_shelf">3</attribute>
      <attribute name="Face">true</attribute>
      <attribute name="Shelf_ID">1</attribute>
    </box>

EDIT: Or maybe this is normal funcionality in CVAT, which means that no changes on default values of attributes aren't copied on every line of unchanged instance of objects.

@nmanovic nmanovic added the bug Something isn't working label Jul 31, 2019
@nmanovic
Copy link
Contributor

@sbanori , it looks like a bug. We should dump attributes in the case I believe. Let us reproduce the issue on our side. @azhavoro , could you please look at the issue?

@nmanovic nmanovic added this to the 0.5.0 - Release milestone Jul 31, 2019
@azhavoro
Copy link
Contributor

Hi @sbanori, I can reproduce this behaviour only if I uploaded (via 'upload annotation' button on dashboard view) annotation that doesn't contain a attribute values. After that a dumped annotation will have attributes only for a changed objects. Does it look like on you scenario?

@sbanori
Copy link
Author

sbanori commented Jul 31, 2019

Hello @azhavoro , no it doesn't look exactly like this. I don't use "upload annotation" functionality in this case.
I do annotation myself. Let's take example from my first post in this issue.
If the product on photo is first product on first shelf, it means that I don't need to touch attributes on this instance of label (Label_2) so I stay on default values of attributes. If now we have next product, it will be next instance (of Label_1) next to first instance (Label_2), it means that is still first shelf (so I don't touch this attribute Shelf_ID) but I change value of attribute "Order_on_shelf" from 1 to 2. Label_1 will have changed one value (Order_on_shelf). On Label_2 we haven't changed any value so we still have default values of attributes. And here is a problem, if we don't change anything in attributes on instance, this instance won't have attributes in xml dumped file.
I solved this temporary by change for a while on any other values and after Save Work, come back to default value, then it will be in xml file.

@azhavoro
Copy link
Contributor

azhavoro commented Jul 31, 2019

Ok, it's very strange...
Could you please little bit help to investigate issue? It would be nice if you do following steps:

  1. Open any your own job
  2. open devtools (F12) and go to Network tab
  3. add any object (dont touch attributes, just draw a box)
  4. save job
  5. In devtools you can see several requests, you should choose annotations?action=create from the list. Click on it, expand 'request payload' section and please post a screenshot or json that you find on this section

For example:
image

@sbanori
Copy link
Author

sbanori commented Jul 31, 2019

I know why wee see another effects :) But first, here is json from your steps:

{
  "version": 5,
  "shapes": [
    {
      "attributes": [
        {
          "value": "1",
          "spec_id": 399
        },
        {
          "value": "true",
          "spec_id": 400
        },
        {
          "value": "1",
          "spec_id": 401
        }
      ],
      "label_id": 3441,
      "group": 0,
      "frame": 0,
      "type": "rectangle",
      "occluded": false,
      "z_order": 1,
      "points": [
        333.80078125,
        1746.416015625,
        566.4331359863281,
        1996.9431610107422
      ]
    }
  ],
  "tracks": [],
  "tags": []
}

And it work properly when I did it like you said. Default attributes are in the xml file and it works without bug.

I made some tests and know I see when is this bug. It's when I use AutoAnnotation.
When I write boundingbox by my hand, with default attributes, it's OK. Xml will show these attributes. But when I use AutoAnnotation, then untouched default attributes aren't visible in Xml files.

And here we have a file which is annotataed in both ways in one task. These without attributes, are from AutoAnnotation, and these from handAnnotation ale with attributes:

 <image id="0" name="A65_00.jpg" width="2448" height="3264">
    <box label="Label_4" occluded="0" xtl="309.72" ytl="1389.80" xbr="499.20" ybr="1606.56">
    </box>
    <box label="Label_3" occluded="0" xtl="7.12" ytl="1388.27" xbr="158.04" ybr="1598.04">
    </box>
    <box label="Label_1" occluded="0" xtl="412.98" ytl="1033.03" xbr="616.50" ybr="1212.46">
    </box>
    <box label="Label_1" occluded="0" xtl="236.77" ytl="1006.49" xbr="440.74" ybr="1216.72">
    </box>
    <box label="Label_1" occluded="0" xtl="194.46" ytl="210.67" xbr="415.19" ybr="463.48">
    </box>
    <box label="Label_1" occluded="0" xtl="445.06" ytl="201.70" xbr="613.23" ybr="449.56">
    </box>
    <box label="Label_1" occluded="0" xtl="229.17" ytl="552.18" xbr="419.61" ybr="799.78">
    </box>
    <box label="Label_1" occluded="0" xtl="408.63" ytl="550.74" xbr="606.38" ybr="798.35">
    </box>
    <box label="Label_2" occluded="0" xtl="98.93" ytl="963.27" xbr="259.68" ybr="1192.88">
    </box>
    <box label="Label_2" occluded="0" xtl="30.80" ytl="195.85" xbr="228.04" ybr="462.64">
    </box>
    <box label="Label_2" occluded="0" xtl="7.48" ytl="547.47" xbr="228.95" ybr="808.97">
    </box>
    <box label="Label_5" occluded="0" xtl="383.55" ytl="2605.37" xbr="473.38" ybr="2841.58">
      <attribute name="Shelf_ID">1</attribute>
      <attribute name="Face">true</attribute>
      <attribute name="Order_on_shelf">1</attribute>
    </box>
    <box label="Label_4" occluded="0" xtl="888.18" ytl="2594.63" xbr="1156.96" ybr="2812.95">
      <attribute name="Shelf_ID">1</attribute>
      <attribute name="Face">true</attribute>
      <attribute name="Order_on_shelf">1</attribute>
    </box>
    <box label="Label_3" occluded="0" xtl="1711.34" ytl="2752.10" xbr="1919.28" ybr="2909.58">
      <attribute name="Shelf_ID">1</attribute>
      <attribute name="Face">true</attribute>
      <attribute name="Order_on_shelf">1</attribute>
    </box>
    <box label="Label_2" occluded="0" xtl="2173.03" ytl="2222.42" xbr="2391.70" ybr="2548.10">
      <attribute name="Shelf_ID">1</attribute>
      <attribute name="Face">true</attribute>
      <attribute name="Order_on_shelf">1</attribute>
    </box>
    <box label="Label_2" occluded="0" xtl="2015.91" ytl="1692.73" xbr="2230.65" ybr="1921.78">
      <attribute name="Shelf_ID">1</attribute>
      <attribute name="Face">true</attribute>
      <attribute name="Order_on_shelf">1</attribute>
    </box>
    <box label="Label_1" occluded="0" xtl="1632.96" ytl="568.94" xbr="1790.44" ybr="840.94">
      <attribute name="Shelf_ID">1</attribute>
      <attribute name="Face">true</attribute>
      <attribute name="Order_on_shelf">1</attribute>
    </box>
    <box label="Label_1" occluded="0" xtl="1156.96" ytl="1012.73" xbr="1364.54" ybr="1238.20">
      <attribute name="Shelf_ID">1</attribute>
      <attribute name="Face">true</attribute>
      <attribute name="Order_on_shelf">1</attribute>
    </box>
    <box label="Label_1" occluded="0" xtl="1096.12" ytl="1388.52" xbr="1296.54" ybr="1606.84">
      <attribute name="Shelf_ID">1</attribute>
      <attribute name="Face">true</attribute>
      <attribute name="Order_on_shelf">1</attribute>
    </box>
    <box label="Label_1" occluded="0" xtl="1074.64" ytl="2068.52" xbr="1264.33" ybr="2329.79">
      <attribute name="Shelf_ID">1</attribute>
      <attribute name="Face">true</attribute>
      <attribute name="Order_on_shelf">1</attribute>
    </box>
    <box label="Label_1" occluded="0" xtl="226.43" ytl="2057.79" xbr="401.80" ybr="2336.94">
      <attribute name="Shelf_ID">1</attribute>
      <attribute name="Face">true</attribute>
      <attribute name="Order_on_shelf">1</attribute>
    </box>
    <box label="Label_1" occluded="0" xtl="330.22" ytl="1363.47" xbr="512.75" ybr="1621.15">
      <attribute name="Shelf_ID">1</attribute>
      <attribute name="Face">true</attribute>
      <attribute name="Order_on_shelf">1</attribute>
    </box>
  </image>

@azhavoro
Copy link
Contributor

@sbanori Got it, thanks for help! We'll fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants