File tree Expand file tree Collapse file tree
dlclive/pose_estimation_pytorch Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,6 +132,16 @@ class PyTorchRunner(BaseRunner):
132132 Processors that were implemented.
133133 dynamic: Whether to use dynamic cropping.
134134 top_down_config: Only for top-down models running with a detector.
135+
136+ returns:
137+ pose: The pose of the animal(s) in the frame.
138+ shape:
139+ (n_bodyparts, 3) if single_animal is True
140+ (n_individuals, n_bodyparts, 3) if single_animal is False.
141+ If no detections are found, the pose consists of zeros.
142+
143+ Raises:
144+ ValueError: If the model is not loaded. Call load_model() or init_inference() before calling get_pose().
135145 """
136146
137147 def __init__ (
@@ -182,6 +192,10 @@ def close(self) -> None:
182192
183193 @torch .inference_mode ()
184194 def get_pose (self , frame : np .ndarray ) -> np .ndarray :
195+ if self .model is None :
196+ raise ValueError (
197+ "Model not loaded. Call load_model() or init_inference() before calling get_pose()."
198+ )
185199 c , h , w = frame .shape
186200 tensor = torch .from_numpy (frame ).permute (2 , 0 , 1 ) # CHW, still on CPU
187201
You can’t perform that action at this time.
0 commit comments