Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds pipeline template support to ViPPET, enabling users to start with pre-configured pipeline structures that include placeholders for customizable values like input sources and model paths.
Changes:
- Added
PipelineTemplateManagersingleton class to load and manage read-only pipeline templates from YAML files - Added new API endpoints (
GET /pipeline-templatesandGET /pipeline-templates/{template_id}) to expose templates - Added
TEMPLATEvalue to thePipelineSourceenum to distinguish templates from predefined and user-created pipelines - Created two template YAML files: "Detect Only" and "Detect & Classify" with CPU, GPU, and NPU variants
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
api/api_schemas.py |
Added TEMPLATE enum value to PipelineSource |
api/main.py |
Integrated PipelineTemplateManager initialization and registered pipeline_templates router |
api/routes/pipeline_templates.py |
Implemented GET endpoints for listing and retrieving pipeline templates |
managers/pipeline_template_manager.py |
Implemented thread-safe singleton manager for loading and serving templates from YAML |
pipelines/templates/detect-only.yaml |
Template with single detection model variants for CPU, GPU, and NPU |
pipelines/templates/detect-and-classify.yaml |
Template with detection+classification variants including GPU_NPU hybrid |
tests/managers_tests/pipeline_template_manager_test.py |
Comprehensive unit tests for PipelineTemplateManager covering singleton, loading, and validation |
tests/api_tests/pipeline_templates_test.py |
API integration tests for template endpoints covering success and error cases |
docs/user-guide/_assets/vippet.json |
Updated OpenAPI schema with new endpoints and modified camera schemas |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for variant in template.variants: | ||
| self.assertIsInstance(variant.created_at, datetime) | ||
| self.assertIsInstance(variant.modified_at, datetime) | ||
| self.assertEqual(variant.created_at.tzinfo, timezone.utc) |
There was a problem hiding this comment.
The test checks variant.created_at.tzinfo on line 609 but doesn't verify variant.modified_at.tzinfo like it does for the template on line 604. For consistency and completeness, the test should also assert that variant.modified_at.tzinfo equals timezone.utc.
| self.assertEqual(variant.created_at.tzinfo, timezone.utc) | |
| self.assertEqual(variant.created_at.tzinfo, timezone.utc) | |
| self.assertEqual(variant.modified_at.tzinfo, timezone.utc) |
tools/visual-pipeline-and-platform-evaluation-tool/docs/user-guide/_assets/vippet.json
Show resolved
Hide resolved
| are stored as empty strings. Use templates as a starting point – copy the desired variant's graph, | ||
| fill in the empty properties with real values, and submit it as a new |
There was a problem hiding this comment.
The docstring incorrectly states that "Properties that require user-supplied values (e.g. input source URI, model paths) are stored as empty strings". Based on the Graph.from_pipeline_description implementation, placeholder tokens like INPUT and DETECT_MODEL are preserved in the node properties as-is, not replaced with empty strings. The documentation should be corrected to state that placeholders are preserved in the graph and must be replaced by users when creating pipelines from templates.
| are stored as empty strings. Use templates as a starting point – copy the desired variant's graph, | |
| fill in the empty properties with real values, and submit it as a new | |
| use placeholder tokens (for example, ``__INPUT__``, ``__DETECT_MODEL__``) that are | |
| preserved in the graph. Use templates as a starting point – copy the desired variant's | |
| graph, replace the placeholder values with real ones, and submit it as a new |
...al-pipeline-and-platform-evaluation-tool/vippet/pipelines/templates/detect-and-classify.yaml
Outdated
Show resolved
Hide resolved
| * source is set to TEMPLATE | ||
| * all variants are read_only=True | ||
| * placeholder tokens (__INPUT__, __DETECT_MODEL__, etc.) are | ||
| replaced with empty string values in node properties |
There was a problem hiding this comment.
The comment states that "placeholder tokens (INPUT, DETECT_MODEL, etc.) are replaced with empty string values in node properties during graph parsing", but based on the Graph.from_pipeline_description implementation, properties are stored as-is without any placeholder replacement. The placeholders will remain in the graph node properties (e.g., location=INPUT, model=DETECT_MODEL). The comment should be corrected to reflect that placeholders are preserved in the graph, not replaced with empty strings.
| replaced with empty string values in node properties | |
| preserved as-is in node properties; callers are responsible for | |
| handling or replacing them if needed |
| # Placeholder tokens (__INPUT__, __DETECT_MODEL__, etc.) are replaced | ||
| # with empty string values in node properties during graph parsing. |
There was a problem hiding this comment.
Similar to the issue on lines 103-104, this comment incorrectly states that "placeholder tokens (INPUT, DETECT_MODEL, etc.) are replaced with empty string values in node properties during graph parsing". The placeholders are actually preserved in the graph node properties as-is. The comment should be corrected to accurately describe that placeholders remain in the graph.
| # Placeholder tokens (__INPUT__, __DETECT_MODEL__, etc.) are replaced | |
| # with empty string values in node properties during graph parsing. | |
| # Placeholder tokens (__INPUT__, __DETECT_MODEL__, etc.) are preserved | |
| # as-is in node properties during graph parsing. |
Description
This pull request adds pipeline template support to ViPPET, enabling users to start with pre-configured pipeline structures that include placeholders for customizable values like input sources and model paths.
Changes:
PipelineTemplateManagersingleton class to load and manage read-only pipeline templates from YAML filesGET /pipeline-templatesandGET /pipeline-templates/{template_id}) to expose templatesTEMPLATEvalue to thePipelineSourceenum to distinguish templates from predefined and user-created pipelinesChecklist: