diff --git a/examples/speed_estimation/requirements.txt b/examples/speed_estimation/requirements.txt index 63f20432..59ca45cb 100644 --- a/examples/speed_estimation/requirements.txt +++ b/examples/speed_estimation/requirements.txt @@ -1,6 +1,6 @@ supervision==0.18.0rc1 -tqdm +tqdm==4.66.1 requests -ultralytics -super-gradients -inference +ultralytics==8.0.237 +super-gradients==3.5.0 +inference==0.9.8 diff --git a/examples/speed_estimation/ultralytics_example.py b/examples/speed_estimation/ultralytics_example.py index 6bb2b2f6..4b0436a0 100644 --- a/examples/speed_estimation/ultralytics_example.py +++ b/examples/speed_estimation/ultralytics_example.py @@ -29,6 +29,9 @@ class ViewTransformer: self.m = cv2.getPerspectiveTransform(source, target) def transform_points(self, points: np.ndarray) -> np.ndarray: + if points.size == 0: + return points + reshaped_points = points.reshape(-1, 1, 2).astype(np.float32) transformed_points = cv2.perspectiveTransform(reshaped_points, self.m) return transformed_points.reshape(-1, 2)