Skip to content

Conversation

mihow
Copy link
Collaborator

@mihow mihow commented Sep 10, 2025

Summary

Formerly we allowed prediction responses to define the algorithm & category map they used. This was flexible but added a lot of complexity. Now the algorithms and category maps must defined ahead of time and a PipelineNotConfigured exception will be thrown if an unexpected algorithm is returned from the processing service. The pipeline registration already handles the checking & creation of the algorithms available from a processing service.

Related Issues

Relates to #782 & #721. Closes #941

Deployment Notes

  • Remove the AlgorithmCategoryMap from each prediction response in the live processing service (the ADC). This should improve performance as well by greatly reducing the size of the serialized object returned & passed to the save_results task. Currently every detection in every image includes a list of all classes in each response.
    The changes on the ADC side are now done and deployed Remove algorithm and category map details in every result response ami-data-companion#93

Checklist

  • I have tested these changes appropriately - tested on live db snapshot with latest ADC.
  • I have added and/or modified relevant tests.
  • I updated relevant documentation or comments.
  • I have verified that this PR follows the project's coding standards.
  • Any dependent changes have already been merged to main.

@Copilot Copilot AI review requested due to automatic review settings September 10, 2025 06:20
Copy link

netlify bot commented Sep 10, 2025

Deploy Preview for antenna-preview ready!

Name Link
🔨 Latest commit c7516d8
🔍 Latest deploy log https://app.netlify.com/projects/antenna-preview/deploys/68cb596b3005510008848a8b
😎 Deploy Preview https://deploy-preview-942--antenna-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 64 (🟢 up 4 from production)
Accessibility: 89 (🟢 up 9 from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 100 (🟢 up 8 from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enforces a stricter pipeline configuration by requiring algorithms and category maps to be pre-registered before processing, removing the previous flexibility of dynamically creating them from pipeline responses. This change simplifies the system by throwing PipelineNotConfigured exceptions when unregistered algorithms are encountered.

  • Algorithms and category maps must be defined ahead of time via pipeline registration
  • Unknown algorithms returned from processing services now raise exceptions instead of being dynamically created
  • Processing service dependency added to docker-compose to ensure proper initialization order

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
docker-compose.yml Adds ml_backend dependency to ensure processing service is available before pipeline registration
ami/ml/exceptions.py Introduces new PipelineNotConfigured exception for better error handling
ami/ml/schemas.py Renames PipelineConfig to PipelineConfigResponse for clarity
ami/ml/models/algorithm.py Adds task type enums, category map validation, and improved manager
ami/ml/models/processing_service.py Updates to support pipeline configuration parameter passing
ami/ml/models/pipeline.py Major refactoring to use pre-registered algorithms instead of dynamic creation
ami/ml/tests.py Updates tests to verify new exception behavior and removes dynamic algorithm creation tests

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mihow mihow merged commit 8c2d73c into main Sep 18, 2025
6 checks passed
@mihow mihow deleted the fix/duplicate-category-maps branch September 18, 2025 01:14
@mihow mihow restored the fix/duplicate-category-maps branch September 18, 2025 01:17
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.

Fix "get() returned more than one AlgorithmCategoryMap" error
1 participant