Affected Component
Schemas / Libs (libs/)
Bug Description
When DetectionSchema is instantiated without passing the center field, a Pydantic ValidationError is raised because center is marked as a required field (...). Since bbox already contains a computed property for center, the center field should be optional and automatically calculated from bbox if not provided.
This bug currently causes multiple test failures across test_tracker.py, test_detector.py, and test_pipeline.py.
Steps to Reproduce
- Run the detector unit tests:
python -m pytest tests/test_detector.py -v
### Expected Behavior
DetectionSchema should successfully initialize by automatically computing the center coordinates from the bbox bounds if not explicitly provided.
### Actual Behavior
Running unit tests or running the pipeline fails with a `ValidationError` because `center` is a required field of `DetectionSchema` but is not passed:
pydantic_core._pydantic_core.ValidationError: 1 validation error for DetectionSchema
center
Field required [type=missing, input_value={'label': 'person', 'bbox...0.0), 'confidence': 0.9}, input_type=dict]
### Python Version
3.11
### Operating System
Windows 11
### Inference Device
None
### Error Log / Traceback
```shell
Screenshots or Recordings
No response
Additional Context
No response
Checklist
Affected Component
Schemas / Libs (libs/)
Bug Description
When
DetectionSchemais instantiated without passing thecenterfield, a PydanticValidationErroris raised becausecenteris marked as a required field (...). Sincebboxalready contains a computed property forcenter, thecenterfield should be optional and automatically calculated frombboxif not provided.This bug currently causes multiple test failures across
test_tracker.py,test_detector.py, andtest_pipeline.py.Steps to Reproduce
Screenshots or Recordings
No response
Additional Context
No response
Checklist
mainbranch.