Skip to content

How to apply inferred mask to image #581

@simonmelouah

Description

@simonmelouah

Following along with the multiclass segmentation example, the model performs fairly well on a custom dataset however when I try to use the mask on the original image using OpenCV's bitwise_and function I get

error: OpenCV(4.8.0) [/Users/runner/work/opencv-python/opencv-python/opencv/modules/core/src/arithm.cpp:230](https://file+.vscode-resource.vscode-cdn.net/Users/runner/work/opencv-python/opencv-python/opencv/modules/core/src/arithm.cpp:230): error: (-215:Assertion failed) (mtype == CV_8U || mtype == CV_8S) && _mask.sameSize(*psrc1) in function 'binary_op'

Is there some post processing required to be able to use the inferred masks output by the trained model (apologies for the noise, have exhausted all possible other resources to try and figure it out)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions