labelme icon indicating copy to clipboard operation
labelme copied to clipboard

Add label specific content

Open wosiu opened this issue 2 years ago • 4 comments

This is a refactor of: https://github.com/wkentaro/labelme/pull/917

TLDR: Ability to add some generic extra info for label. For example: information about text in a polygon or some other text metadata unique per object.

Testing performed: [x] flake8 . [x] black --line-length 79 --check labelme/ [x] MPLBACKEND='agg' pytest -vsx tests/ [x] manual testing - details below.

wosiu avatar May 12 '22 01:05 wosiu

Manual testing:

  1. opening existing annotations: image and editing: image

works fine:

{
  "version": "5.0.1",
  "flags": {},
  "shapes": [
    {
      "label": "class_id",
      "points": [
        [
          193.5494505494505,
          100.3956043956044
        ],
        [
          773.7692307692307,
          68.52747252747253
        ],
        [
          806.7362637362637,
          990.5054945054944
        ],
        [
          223.2197802197802,
          1001.4945054945055
        ]
      ],
      "group_id": 0,
      "content": "\"Sadsa\" 123123\n'dsdsa'  \nescaping \\\" \\\\\"",
      "shape_type": "polygon",
      "flags": {}
    }
  ],
  "imagePath": "2022-05-05 at 12.03.12 copy.png",
  "imageData": null,
  "imageHeight": 1181,
  "imageWidth": 883
}
  1. adding new polygon - works as expected.

  2. reopeninng edition of exising polygon with previously added concente - works as expected.

wosiu avatar May 12 '22 01:05 wosiu

@xulihang, any chances for having this merged and released? 🥺

wosiu avatar May 17 '22 08:05 wosiu

I'm afraid that you've mentioned the wrong person. I am the person who created the original pr.

xulihang avatar May 17 '22 10:05 xulihang

Oh sorry 🤦 Bumping the question, @wkentaro - any chances for having this merged and released? I'm afraid it'll get drifted again compared to the main branch with time.

wosiu avatar May 23 '22 11:05 wosiu

@wkentaro do you need any help, so that it could be merged?

wosiu avatar Feb 07 '23 16:02 wosiu

@wosiu Can you explain what would be the example use case of this?

wkentaro avatar Feb 13 '23 11:02 wkentaro

Annotating fragments of image with text for end to end OCR training

wosiu avatar Feb 14 '23 20:02 wosiu

@wkentaro Does it make sense? I can elaborate more if needed or help :) I'm just worried it'll get drifted if we don't merge it.

wosiu avatar Apr 05 '23 16:04 wosiu

@wosiu Thank you for the reminder and yes the OCR example made the use case clear for me. I'll work on this as the next work.

wkentaro avatar Apr 06 '23 09:04 wkentaro