Skip to content

[BUG] Within the App, excluding samples by label tags does not work as expected #6388

@gboeer

Description

@gboeer

Describe the problem

Within the App, filtering by label tags and switching to "Omit samples with tags", does not correctly exclude the samples for which at least one label has the specified tag, which is not the expected behavior in my opinion.

Image

Code to reproduce issue

Using the quickstart dataset, select any label from any sample and assign it a tag (e.g. "good"). Then in the sidebar at "filter by label tag" insert the given tag ("good"). When changing the filter option just below the field to "Omit samples with tags", the sample, for which the label was tagged before, is still visible.

Looking at the generated Mongo Query reveals this:

[
  {
    "$match": {
      "$or": [
        {
          "ground_truth.detections.tags": {
            "$nin": [
              "good"
            ]
          }
        },
        {
          "predictions.detections.tags": {
            "$nin": [
              "good"
            ]
          }
        }
      ]
    }
  }
]

While I believe the correct query should be:

[
  {
    "$match": {
      "$nor": [
        {
          "ground_truth.detections.tags": {
            "$in": [
              "good"
            ]
          }
        },
        {
          "predictions.detections.tags": {
            "$in": [
              "good"
            ]
          }
        }
      ]
    }
  }
]

Changing this manually indeed correctly excludes the complete sample for which at least one label has the specified tag.

System information

  • FiftyOne version 2.11.1 (Enterprise)

Willingness to contribute

The FiftyOne Community encourages bug fix contributions. Would you or another
member of your organization be willing to contribute a fix for this bug to the
FiftyOne codebase?

  • Yes. I can contribute a fix for this bug independently
  • Yes. I would be willing to contribute a fix for this bug with guidance
    from the FiftyOne community
  • No. I cannot contribute a bug fix at this time

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug fixes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions