Skip to content

object detection : matchin outputs.last_hidden_state with results #39426

@fenaux

Description

@fenaux

Feature request

it seems to me that would be possible with a little modification in the function post_process_object_detection

with

``for score, label, box, index in zip(scores, labels, boxes, indexes):
            results.append(
                {
                    "scores": score[score > threshold],
                    "labels": label[score > threshold],
                    "boxes": box[score > threshold],
                    "indexes": index[score > threshold],
                }
            )``

and then
outputs.last_hidden_state[0][results[0]['indexes']]
gives me the desired vector features

Am I right or is there a better way to obtain this matching ?

Thanks for your help

Motivation

I would like to use outputs.last_hidden_state as features for auxiliary tasks. So I need to know the label and the bounding box associated to one given vector of outputs.last_hidden_state

Your contribution

I am not a top coder and do not know how to submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions