-
Notifications
You must be signed in to change notification settings - Fork 8
Apply score threshold filter #944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ore filters from project settings
…ore filters from project settings
…t, TaxonViewSet, SourceImageViewSet, EventViewSet, and SummaryView
Remove OccurrenceDeterminationScoreFilter to ensure apply_defaults parameter is respected.
✅ Deploy Preview for antenna-preview canceled.
|
…s feature flag is enabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…user and filter_by_score_threshold filters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird since the default score threshold filter is already applied in Line 1387 in 8968940
|
…ab/antenna into feat/apply-score-filter
…Set, SourceImageCollectionViewSet, EventViewSet, and SummaryView
… not directly linked to project
@annavik I committed an experiment that uses the project threshold to color code the bounding boxes in the session detail view (with the help of Claude Sonnet 4!). Below is an example of the session detail when the threshold is set to zero and when it is set to 0.8. With the new global threshold filter, the red color is never visible. So the new idea here is that the color thresholds should be applied after the project threshold. Scale the color thresholds to the low/medium/high scores that remain after the hard cut off is made from the project threshold. Is it possible to pass the color thresholds to the identification component in the nova library? ![]() ![]() ![]() ![]() |
Suggestions for FE fixes:
|
Conclusions after meeting:
|
…core threshold This reverts the dynamic color coding feature introduced in commits: - a006d3d - 7d9675c - 4e89b31 Changes reverted: - Remove calculateDynamicScoreThresholds() and getScoreColorClass() functions - Remove projectScoreThreshold prop from Frame and FrameDetections components - Remove neutral color styling for detections below threshold - Restore static SCORE_THRESHOLDS usage (WARNING: 0.8, ALERT: 0.6) Preserved changes: - Keep projectId parameter for capture details endpoint (from 15db557)
@annavik I reverted the dynamic color coding, and they gray/neutral coloring, and I am now returning occurrence data for all detections that have it. Use the new |
7e6af40
to
4f07b64
Compare
Summary
In #929, we setup a view to make it possible to adjust default filters for a project. In this PR, we apply the filter for score threshold. The changes includes both frontend and backend updates.
Related Issues
Fixes #926
List of Changes
Added
get_default_classification_threshold(project, request)
to read threshold from project settings (falling back to request params ifapply_defaults=false
).Added
filter_by_score_threshold()
filtering queryset method toOccurrenceQuerySet
.Applied default threshold filtering in:
OccurrenceViewSet
TaxonViewSet
SourceImageViewSet
SourceImageCollectionViewSet
EventViewSet
SummaryView
Removed
OccurrenceDeterminationScoreFilter
.Detailed Description
This PR is the first step toward using default project-level settings filters across the platform.
It introduces support for applying the project’s configured default classification score threshold to multiple API endpoints. When a threshold is defined in the project settings, all relevant endpoints (Occurrences, Taxa, Events, Source Images, Collections, and Summary) automatically filter out records below that threshold.
At the same time, flexibility is preserved: users can bypass the defaults by passing
apply_defaults=false
in their request, which reverts filtering behavior back to the per-request classification_threshold parameter.How to Test the Changes
Go to the Project Details admin page and set a default classification score threshold.
Check that the Occurrence, Taxon, Event, and Summary endpoints all respect the threshold.
Add ?apply_defaults=false to API requests and confirm that results are no longer filtered by the project defaults.
Remove the flag (or set apply_defaults=true) and confirm that defaults are applied again.
Screenshots
TBD
Deployment Notes
TBD
Checklist