[Python] How to convert "raw" confidence score and bounding box to actual mask

Discussão em 'Python' iniciado por Stack, Junho 16, 2025.

  1. Stack

    Stack Membro Participativo

    I need to know how can I use the confidence array (which for some reason has negative values on it) and the boundingBox to produce a segmentation mask/contour.

    I wrote an Android app that uses Chaquopy and Flutter (and its YOLO plug-in) to run a YOLOv8 segmentation model. It outputs the following:

    1. className
    2. confidence (the confidence on the object detection and classification)
    3. boundingBox (the boundingBox of the object in left-right-top-bottom format)
    4. mask (a 160x160 array which I believe is the confidence matrix; however, it has negative values, e.g. -0.656, which I find really weird).

    I am able to send these values to a Python script via Chaquopy for processing along with the original image. However, I am lost as to what to do next.

    How can I take these data and make a mask and a contour similar to what results[0].masks.xy outputs when using the ultralytics library in pure Python.

    Continue reading...

Compartilhe esta Página