Merge branch 'stable' of yahoo.com.hk@192.168.192.190:D:\repo\orisyssdk_git into stable

This commit is contained in:
bluepulsar
2026-04-14 19:53:14 +08:00
2 changed files with 39 additions and 15 deletions
+10 -4
View File
@@ -151,9 +151,12 @@ class Sensor:
self.__tracker = Tracker(adaptive=True, cuda=cuda, verbose=self.verbose, config_tracker=self.__config_tracker)
self.__contact3d = Contact3D(config_contact=self.__config_contact, verbose=self.verbose)
self.__hhd = None
# cfg_ds = self.__config_tracker.get("hhd_downsample", None)
# self._hhd_downsample = max(1, int(cfg_ds if cfg_ds is not None else hhd_downsample))
self._hhd_downsample = self.__config_tracker.get("hhd_downsample", None)
# Integer >= 1: run HHD on flow downsampled by this factor for speed (1 = full res).
_raw_ds = self.__config_tracker.get("hhd_downsample", 1)
try:
self._hhd_downsample = max(1, int(_raw_ds)) if _raw_ds is not None else 1
except (TypeError, ValueError):
self._hhd_downsample = 1
self._hhd_grid_shape = None
cfg_backend = self.__config_tracker.get("backend", None)
self.poisson_backend = cfg_backend if cfg_backend is not None else backend
@@ -300,7 +303,10 @@ class Sensor:
raise Exception("Warning: Compute flow first")
orig_h, orig_w = flow.shape[:2]
k = self._hhd_downsample
try:
k = max(1, int(self._hhd_downsample))
except (TypeError, ValueError):
k = 1
if k > 1:
ds_w = max(1, orig_w // k)