# Hiding bounding boxes in image classification task

**URL:** <https://support.prodi.gy/t/hiding-bounding-boxes-in-image-classification-task/5605>\
**Category:** Uncategorized\
**Created:** [May 2, 2022, 2:57pm UTC](https://support.prodi.gy/t/hiding-bounding-boxes-in-image-classification-task/5605 "2022-05-02T14:57:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jame76](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/jame76/32/2693_2.png) [@Jame76](https://support.prodi.gy/u/Jame76)\
**Post date:** [May 2, 2022, 2:57pm UTC](https://support.prodi.gy/t/hiding-bounding-boxes-in-image-classification-task/5605/1 "2022-05-02T14:57:52Z")

</div>

Dear all,

I am currently working on a project where annotators have to classify tables from scanned documents.

It turned out that the annotation process is much faster when annotators get to see the original table rather than the OCR output which is why I decided to setup a custom recipe which is based on image classification.

Under the hood I also pass the OCR output to prodigy along with word bounding boxes for feeding my model. However, I do not want to have the bounding boxes to be displayed during the annotation process.

The problem is that if I use the 'choice' interface, all boxes are being displayed making it impossible to do the annotation job and I do not have any idea how to hide the labels let alone the boxes. I was expecting that boxes would only be displayed in the 'image\_manual' interface. So my question is, do you have any suggestion how I can fix this problem ? Is there any customizing available ?

Thank you very much in advance.

 ![s2_0205](https://us1.discourse-cdn.com/flex020/uploads/prodigy/original/2X/a/afba4e6bbeaaf232bdc4f1e8f47c0e4c779b9440.png)

---

<div class="post-metadata">

**Author:** ![koaning](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/koaning/32/230_2.png) [@koaning](https://support.prodi.gy/u/koaning)\
**Post date:** [May 3, 2022, 1:52pm UTC](https://support.prodi.gy/t/hiding-bounding-boxes-in-image-classification-task/5605/2 "2022-05-03T13:52:34Z")

</div>

I'm wondering if your stream uses a key that's also used by the `image_manual` view. Could you perhaps share (a part) of the custom recipe as well as an example from your stream? That way I might be able to reproduce/think along easier.

---

<div class="post-metadata">

**Author:** ![Jame76](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/jame76/32/2693_2.png) [@Jame76](https://support.prodi.gy/u/Jame76)\
**Post date:** [May 3, 2022, 4:51pm UTC](https://support.prodi.gy/t/hiding-bounding-boxes-in-image-classification-task/5605/3 "2022-05-03T16:51:07Z")

</div>

> [@koaning](#):
>
> I'm wondering if your stream uses a key that's also used by the `image_manual` view.

Yes, it does, namely the spans for the word bounding boxes! Even though not necessary for the annotation task itself I need the bounding boxes as inputs for the multi modal model that not only receives words but also their positions.

I think, I could use a different key, say 'word\_spans'. However, this will require to change several mappings in the downstream task after loading the dataset from the prodigy database.

Does this make sense ?

Please find attached the recipe. You can see the input keys in the `map_to_prodigy_input` function.

```python
OPTIONS = [{"id": 0, "text": "ASSETS/LIABILITIES"},...]

@recipe("classify_tables")
def classify_tables_recipe():

        def get_stream():
            analyzer = get_analyzer()
            df = analyzer.analyze()

            def map_to_prodigy_input(source):
                dp["image"] = source.image
                dp["meta"] = {"filename": source.file_name}
                dp["spans"] = source.word_annotations # will give a list of dicts 
                # with 'labels', 'type', 'points', as requested for the image_manual recipe  
                dp["options"] = OPTIONS
                return dp

            df = MapData(df, map_to_prodigy_input)
            return df

    return {
        "dataset": "tables" ,
        "stream": get_stream(),
        "view_id": "choice",
        "progress": _no_progress_bar,
        "config": {
            "choice_style": "single",
            "choice_auto_accept": True,
            "feed_overlap": False
        }
    }

```

---

<div class="post-metadata">

**Author:** ![koaning](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/koaning/32/230_2.png) [@koaning](https://support.prodi.gy/u/koaning)\
**Post date:** [May 4, 2022, 7:46am UTC](https://support.prodi.gy/t/hiding-bounding-boxes-in-image-classification-task/5605/4 "2022-05-04T07:46:47Z")

</div>

The simplest way to omit the bounding boxes is indeed to rename the dictionary key so that you still have it around. That way it does not get rendered. So `word_spans` sounds feasible to me.

Another option is to omit the spans in this annotation table and have two separate datasets that you'll join later. Whether or not this is a practical decision depends a lot on your application/situation.
