image.manual nested items

Hi there,

Is it possible to generate labels for images that contain rows of nested items.
For example:

    "file_name": "0001.png",
    "invoice_lines": [
          "service_name": "labelling",
          "service_hours": 111,
          "service_price_per_hour": 111


Welcome to the forum @ghost :wave:

Could you specify what you mean by "generate labels for images"?
Do you refer to how the data should be stored in the resulting dataset? You can restructure how the data is stored using before_db callback in your custom recipe. How the the data is stored by default is determined by the view_idyou use. The docs on different annotation interfaces detail the data structure they produce (you can also always inspect the annotations in the DB. You will probably want to work with choice for classifying images.

Or do you mean a custom arrangement of options in the UI? In the latter case you would need either several blocks of choice options or a custom html block. Here you can check the solution for custom options interface - you might need sth simpler if you don't need this dynamic aspect to it but it gives you an idea what it takes to create a custom choice UI.

1 Like

Thank you, and thank you for taking the time.

Sorry, I was thinking about having to enter the text manually for each label box on the image in the UI, but Prodigy has a much more efficient approach.

I was trying to figure out how I can group a bunch of labels inside a parent label, but I think that's very easy to do in the UI and then I just have to do a quick check which boxes are contained within the parent label and that should solve it.

I would then just use the coordinates to parse the text with tesseract or the like.

Hi @ghost,

Manually entering each label is almost never a good idea. It's super tedious and very prone to errors so you might end up with useless/hard to process labels.
It's definitely best to spend some time designing the UI that would make annotation as easy as possible.

Also, if your labels are grouped in some sort of hierarchy, another option to consider would be to do annotation in two passes: 1) coarse or parent labels and then 2) fine-grained labels. You could then be showing only the fine grained labels that make sense in the context of the coarse label for the example. Such two-step workflow will also facilitate the annotation task which directly translates to the quality of the final labels.

Let us know if you need any help at all with setting up the right UI for your task :slight_smile:

Hey @magdaaniol ,

Sorry for the late reply.
That sounds like a very good idea.

Thank you