Skip to content
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

feat: find best_detections for classifications (#631) #632

Merged
merged 3 commits into from
Jun 19, 2024

Conversation

veckatimest
Copy link
Contributor

✅ DoD

(use na when API docs (Release notes, etc) do not need to be updated)

📝 Summary

Now when "classifications" query parameter is passed to
GET /classifier-jobs/{jobId}/best-detections
or
GET /classifier-jobs/{jobId}/best-detections/summary
The returned detections will be related to specific classification_id

🛑 Problems

  • Write any discovered & unresolved problems (link to created Jira issues)

💡 More ideas

Write any more ideas you have

@veckatimest veckatimest self-assigned this Jun 17, 2024
@@ -22,6 +22,15 @@ const Converter = require('../../common/converter')
* description: List of stream ids to limit results
* in: query
* type: array|string
* - name: classifications
Copy link
Member

@Tooseriuz Tooseriuz Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* - name: classifications
* - name: classification_ids

some other places, we use classifications for classification name not ids. so better make it consistent

@@ -83,18 +92,20 @@ router.get('/:jobId/best-detections', (req, res) => {
const { jobId } = req.params
const converter = new Converter(req.query, {}, true)
converter.convert('streams').optional().toArray()
converter.convert('classifications').optional().toArray()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
converter.convert('classifications').optional().toArray()
converter.convert('classification_ids').optional().toArray()

@@ -90,7 +90,7 @@ async function defaultQueryOptions (filters = {}, options = {}) {

async function defaultBestDetectionsQueryOptions (filters, opts) {
const { user, limit, offset, fields } = opts
const { streams, reviewStatuses } = filters
const { streams, classifications, reviewStatuses } = filters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const { streams, classifications, reviewStatuses } = filters
const { streams, classificationIds, reviewStatuses } = filters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment on lines 124 to 127
if (classifications) {
byClassicication = true

bestDetectionsWhere.classificationId = classifications
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (classifications) {
byClassicication = true
bestDetectionsWhere.classificationId = classifications
if (classificationIds) {
byClassicication = true
bestDetectionsWhere.classificationId = classificationIds

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this migration gets run again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only somewhere where we did not have it yet (probably not)

@veckatimest veckatimest merged commit 42c0a68 into develop Jun 19, 2024
3 checks passed
@veckatimest veckatimest deleted the feat/best-per-species-detection branch June 19, 2024 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support best detections based on classification_id, stream_id and both
3 participants