Skip to content

Inconsistent Number of Predictions #2886

@agp-ka32

Description

@agp-ka32

Hi @ppwwyyxx ,

====Some background:====
I am able to run a pre-trained model on any input image to get mask predictions as well as the bounding boxes. I have set my model in eval mode, as required.

In doing so, I also display the output of my model as below:

output = model([inputs])
print('output instances are:', output[0]['instances'])

This gives me 7 class predictions for different objects in my image, i.e, num_instances = 7.
So far so good.

====My question:====
I am also getting the mask features from the same pre-trained model used above, using the following code:

features = model.backbone(images.tensor)
proposals, _ = model.proposal_generator(images, features)
instances, _ = model.roi_heads(images, features, proposals)

(I have omitted the required two lines to get mask features for brevity.)

The num_instances here is 5, which is different from when I run the model without any incisions, as described earlier (it was 7 there).

I am curious to know why this inconsistency.

Can you clarify? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationProblems about existing documentation or comments

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions