Git Product home page Git Product logo

Comments (3)

dengdan avatar dengdan commented on June 11, 2024

The label value of a bbox might be negative after preprocessing, meaning do-not-care. Such bboxes are ignored and won't contribute the loss when training.

from seglink.

abc8350712 avatar abc8350712 commented on June 11, 2024

The function of bboxes_filter_overlap is

with tf.name_scope(scope, 'bboxes_filter', [labels, bboxes]):
    scores = bboxes_intersection(tf.constant([0, 0, 1, 1], bboxes.dtype),bboxes)
                
    mask = scores > threshold
    if assign_negative:
        labels = tf.where(mask, labels, -labels)
    else:
        labels = tf.boolean_mask(labels, mask)
        bboxes = tf.boolean_mask(bboxes, mask)
        scores = bboxes_intersection(tf.constant([0, 0, 1, 1], bboxes.dtype),bboxes)
        xs = tf.boolean_mask(xs, mask);
        ys = tf.boolean_mask(ys, mask);
    return labels, bboxes, xs, ys

The scores is used to filter out the bboxes.
But i see the code of bboxes_intersection

with tf.name_scope(name, 'bboxes_intersection'):
    # Should be more efficient to first transpose.
    bboxes = tf.transpose(bboxes)
    bbox_ref = tf.transpose(bbox_ref)
    # Intersection bbox and volume.
    int_ymin = tf.maximum(bboxes[0], bbox_ref[0])
    int_xmin = tf.maximum(bboxes[1], bbox_ref[1])
    int_ymax = tf.minimum(bboxes[2], bbox_ref[2])
    int_xmax = tf.minimum(bboxes[3], bbox_ref[3])
    h = tf.maximum(int_ymax - int_ymin, 0.)
    w = tf.maximum(int_xmax - int_xmin, 0.)
    # Volumes.
    inter_vol = h * w
    bboxes_vol = (bboxes[2] - bboxes[0]) * (bboxes[3] - bboxes[1])
    scores = tfe_math.safe_divide(inter_vol, bboxes_vol, 'intersection')
    return scores

if the values in bboxes are postive, the scores should be 1.
some of bboxes with negative are filtered out, but some are not if the score is still larger than threshold.

But if the bboxes with negative mean do-not-care, what is the aim to filter out some of bboxes?

from seglink.

dengdan avatar dengdan commented on June 11, 2024

In preprocessing and data augmentation, the original images are randomly cropped, and the coordinate values of a bounding box might be negative, and then the scores in method bboxes_intersection may be less than 1.0.

from seglink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.