Skip to content

feat: Add Pydantic schemas and config builders for type-safe configuration#1050

Draft
GeorgePearse wants to merge 1 commit intomainfrom
config-management
Draft

feat: Add Pydantic schemas and config builders for type-safe configuration#1050
GeorgePearse wants to merge 1 commit intomainfrom
config-management

Conversation

@GeorgePearse
Copy link
Copy Markdown
Collaborator

Summary

  • Adds comprehensive Pydantic schemas for all major components (backbones, necks, heads, models, data, training)
  • Introduces visdet.py_configs module with builder functions providing full IDE autocomplete
  • Enhances SchemaRegistry with reverse type name lookup for config validation
  • Adds SimpleRunner.from_config() method for creating runners from Pydantic configs

Motivation

This provides a type-safe alternative to YAML/Python config files with full IDE support, making configuration errors catchable at development time rather than runtime.

Example Usage

from visdet.py_configs import mask_rcnn_swin_tiny_coco
from visdet import SimpleRunner

# Create config with full IDE autocomplete
cfg = mask_rcnn_swin_tiny_coco(data_root='/data/coco')
cfg.train_cfg.max_epochs = 24  # Modify with autocomplete

# Create runner from Pydantic config
runner = SimpleRunner.from_config(cfg)
runner.train()

Test plan

  • Verify schemas validate example configs correctly
  • Test SimpleRunner.from_config() with preset configs
  • Confirm IDE autocomplete works with py_configs builders

🤖 Generated with Claude Code

…ation

This adds a comprehensive type-safe configuration system with:

- Pydantic schemas for all major components (backbones, necks, heads, models)
- Builder functions with IDE autocomplete support in py_configs
- Reverse type name lookup in SchemaRegistry for config validation
- SimpleRunner.from_config() method for creating runners from Pydantic configs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Skylos Scan: No dead code or security issues detected.

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.

1 participant