|
37 | 37 | class PoseResult: |
38 | 38 | pose: np.ndarray | None |
39 | 39 | timestamp: float |
40 | | - packet: "PosePacket | None" = None |
| 40 | + packet: PosePacket | None = None |
41 | 41 |
|
42 | 42 |
|
43 | 43 | @dataclass(slots=True, frozen=True) |
44 | 44 | class PoseSource: |
45 | | - backend: str # e.g. "DLCLive" |
| 45 | + backend: str # e.g. "DLCLive" |
46 | 46 | model_type: ModelType | None = None |
47 | 47 |
|
48 | 48 |
|
@@ -73,19 +73,22 @@ def validate_pose_array(pose: Any, *, source_backend: str = "DLCLive") -> np.nda |
73 | 73 |
|
74 | 74 | if arr.ndim not in (2, 3): |
75 | 75 | raise ValueError( |
76 | | - f"{source_backend} returned an invalid pose output format: expected a 2D or 3D array, got ndim={arr.ndim}, shape={arr.shape!r}" |
| 76 | + f"{source_backend} returned an invalid pose output format:" |
| 77 | + f" expected a 2D or 3D array, got ndim={arr.ndim}, shape={arr.shape!r}" |
77 | 78 | ) |
78 | 79 |
|
79 | 80 | if arr.shape[-1] != 3: |
80 | 81 | raise ValueError( |
81 | | - f"{source_backend} returned an invalid pose output format: expected last dimension size 3 (x, y, likelihood), got shape={arr.shape!r}" |
| 82 | + f"{source_backend} returned an invalid pose output format:" |
| 83 | + f" expected last dimension size 3 (x, y, likelihood), got shape={arr.shape!r}" |
82 | 84 | ) |
83 | 85 |
|
84 | 86 | if arr.ndim == 2 and arr.shape[0] <= 0: |
85 | 87 | raise ValueError(f"{source_backend} returned an invalid pose output format: expected at least one keypoint") |
86 | 88 | if arr.ndim == 3 and (arr.shape[0] <= 0 or arr.shape[1] <= 0): |
87 | 89 | raise ValueError( |
88 | | - f"{source_backend} returned an invalid pose output format: expected at least one individual and one keypoint, got shape={arr.shape!r}" |
| 90 | + f"{source_backend} returned an invalid pose output format:" |
| 91 | + f" expected at least one individual and one keypoint, got shape={arr.shape!r}" |
89 | 92 | ) |
90 | 93 |
|
91 | 94 | if not np.issubdtype(arr.dtype, np.number): |
|
0 commit comments