- 
                Notifications
    
You must be signed in to change notification settings  - Fork 679
 
Description
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.
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