Copy object tool is greyed out

Hi everyone,

I am labeling images in a time sequence, so I want to be able to copy the objects (freestyle, polygon, etc.) onto the next image since they do not change much from image to image. When I try to copy each object (either ctrl + c or right clicking to see copy option) this option is greyed out and ctrl+c does not work. Anyone else have this problem?

Thanks,

Michael


Most tools come with a “copy” feature, except for mask.
If you have a few variations across your project, I would advise you to make 1 label, export, and use MAL to pre-annotate the rest so you don’t have to start from scratch or go back and forth.

Hi PT,

Do you know if there is a way to copy using the mask tool? I want to use the mask tool because it assigns the value by pixel, but I also want to be able to apply one of thee mask objects to all of my images.

Thank you,

Michael

the mask as mentioned before is not part of the copy/paste feature, one workaround (if there are a lot of similarities across would be to pre-import the mask before doing the labeling so you can review and adjust instead of doing the mask from the start every time.

sample -

color = (255, 255, 255)
mask_data = lb_types.MaskData(url="<MASK_URL>")
mask_annotation = lb_types.ObjectAnnotation(
    name="<MASK_FEATURE_ONTOLOGY>",
    value=lb_types.Mask(mask=mask_data, color=color)
)

annotations = [
    mask_annotation,
]

labels = [
    lb_types.Label(
        data={
          "uid": "<DATA_ROW_ID>"
        },
        annotations=annotations,
    )
]

Thank you for the idea, this should work!

Could you expand the code a little more. I am lost in how I am supposed import the masks (two separate objects in the images), I keep getting error messages.

so if you have 3 masks for an image it would go like -

color = (255, 255, 255)
mask_data_1 = lb_types.MaskData(url="<LINK_TO_MASK_1>")
mask_annotation_1 = lb_types.ObjectAnnotation(
    name="<MASK_FEATURE_ONTOLOGY_1>",
    value=lb_types.Mask(mask=mask_data_1, color=color)
)
color = (255, 255, 255)
mask_data_2 = lb_types.MaskData(url="<LINK_TO_MASK_2>")
mask_annotation_2 = lb_types.ObjectAnnotation(
    name="<MASK_FEATURE_ONTOLOGY_2>",
    value=lb_types.Mask(mask=mask_data_2, color=color)
)
color = (255, 255, 255)
mask_data_3 = lb_types.MaskData(url="<LINK_TO_MASK_3>")
mask_annotation_3 = lb_types.ObjectAnnotation(
    name="<MASK_FEATURE_ONTOLOGY_3>",
    value=lb_types.Mask(mask=mask_data_3, color=color)
)

annotations = [
    mask_annotation_1,
    mask_annotation_2,
    mask_annotation_3
]

labels = [
    lb_types.Label(
        data={
          "uid": "<DATA_ROW_ID>"
        },
        annotations=annotations,
    )
]

Thank you, I was able to get it to work a few days ago.

1 Like