# image.manual nested items

**URL:** <https://support.prodi.gy/t/image-manual-nested-items/7294>\
**Category:** Uncategorized\
**Created:** [July 4, 2024, 8:35pm UTC](https://support.prodi.gy/t/image-manual-nested-items/7294 "2024-07-04T20:35:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghost](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@ghost](https://support.prodi.gy/u/ghost)\
**Post date:** [July 4, 2024, 8:35pm UTC](https://support.prodi.gy/t/image-manual-nested-items/7294/1 "2024-07-04T20:35:01Z")

</div>

Hi there,

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

```python
{
    "file_name": "0001.png",
    "invoice_lines": [
      {
          "service_name": "labelling",
          "service_hours": 111,
          "service_price_per_hour": 111
      }
  ]
}

```

Thanks

---

<div class="post-metadata">

**Author:** ![magdaaniol](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/magdaaniol/32/2787_2.png) [@magdaaniol](https://support.prodi.gy/u/magdaaniol)\
**Post date:** [July 5, 2024, 10:41am UTC](https://support.prodi.gy/t/image-manual-nested-items/7294/2 "2024-07-05T10:41:26Z")

</div>

Welcome to the forum @ghost 👋

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`](https://prodi.gy/docs/custom-recipes#before_db) callback in your custom recipe. How the the data is stored by default is determined by the `view_id`you use. The docs on different annotation [interfaces](https://prodi.gy/docs/api-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](https://prodi.gy/docs/custom-interfaces#blocks) of `choice` options or a custom `html` [block](https://prodi.gy/docs/custom-interfaces#html). [Here](https://support.prodi.gy/t/multiple-choice-with-free-text-input/7189/4) 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.

---

<div class="post-metadata">

**Author:** ![ghost](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@ghost](https://support.prodi.gy/u/ghost)\
**Post date:** [July 6, 2024, 3:31pm UTC](https://support.prodi.gy/t/image-manual-nested-items/7294/3 "2024-07-06T15:31:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![magdaaniol](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/magdaaniol/32/2787_2.png) [@magdaaniol](https://support.prodi.gy/u/magdaaniol)\
**Post date:** [July 7, 2024, 2:01pm UTC](https://support.prodi.gy/t/image-manual-nested-items/7294/4 "2024-07-07T14:01:07Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![ghost](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@ghost](https://support.prodi.gy/u/ghost)\
**Post date:** [July 16, 2024, 8:59am UTC](https://support.prodi.gy/t/image-manual-nested-items/7294/5 "2024-07-16T08:59:09Z")

</div>

Hey @magdaaniol ,

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

Thank you
