ai-cfia / nachet-frontend

Frontend application for seed classification of images acquired from digital microscopes
MIT License
2 stars 2 forks source link

As a frontend developer, I want to incorporate the colors value of the boxes around the seed to the rendering of the canvas #117

Open MaxenceGui opened 1 month ago

MaxenceGui commented 1 month ago

Description πŸš€

With the latest change to Nachet Backend, the boxes return by the backend now have a colors attribute. This attribute can be return in HEX or RGB format (Default is HEX). As a frontend developer, I want to integrate these change to the canvas so the users can visually identifies different seed species in the image.

Expected BehaviorπŸ“ˆ

Use the color attribute from the box to colors the boxes around the seed.

Current Behavior πŸ“‰

Draw every boxes in red.

Effort and impact πŸƒ

This issue required low effort, since it's a small to integrate in the frontend, but can have a really high impact on the users.

Acceptance Criteria βœ…

Additional Context πŸ“Œ

Return value of the inference request:

{
    "filename": "tmp/tmp_file_name",
    "boxes": [
        {"box": {
                "topX": 0.0,
                "topY": 0.0,
                "bottomX": 0.0,
                "bottomY": 0.0
            },
        "label": "top_label_name",
        "score": 0.912,
        "color": "#ff0",  <== Color attribute
        "topN": [
            {
                "score": 0.912,
                "label": "top_label_name",
            },
            {
                "score": 0.053,
                "label": "seed_name",
            },
            {
                "score": 0.0029,
                "label": "seed_name",
            },
            {
                "score": 0.005,
                "label": "seed_name",
            },
            {
                "score": 0.001,
                "label": "seed_name",
            }
        ],
        "overlapping": false,
        "overlappingIndices": 0
        },
    ],
    "labelOccurrence": {
        "seed_name": 1,
    },
    "totalBoxes": 1
}