add debug option

This commit is contained in:
bluepulsar
2026-03-01 20:42:12 +08:00
parent 1e3751c388
commit c95e810e87
5 changed files with 27 additions and 317 deletions
+4 -3
View File
@@ -59,7 +59,7 @@ class Sensor:
# Initialization
# =========================================================================
def __init__(self, vid_src, cuda=True, isstitch=True, verbose=True,
def __init__(self, vid_src, cuda=True, isstitch=True, verbose=True, debug=False,
config_name="prototype", cal_path=None, override=False, box=None, mirror=True, poisson_backend='auto'):
"""
Initialize Sensor with video source and configuration.
@@ -86,6 +86,7 @@ class Sensor:
self.isstitch = isstitch
self.cuda = cuda
self.verbose = verbose
self.debug = debug
self.config_name = config_name
self.cal_path = cal_path
self.mirror = mirror
@@ -130,7 +131,7 @@ class Sensor:
# Initialize components
self.stitcher = Stitcher(isstitch=isstitch, config_stitcher=self.__config_stitcher, verbose=self.verbose)
self.__tracker = Tracker(adaptive=True, cuda=cuda, verbose=self.verbose, dis_preset=self._config_dis_preset, config_tracker=self.__config_tracker)
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
self.poisson_backend = poisson_backend
@@ -252,7 +253,7 @@ class Sensor:
# Initialize HHD solver
if self.__hhd is None:
self.__hhd = nHHD(cuda=self.cuda, grid=flow.shape[:2], spacings=(18, 18), poisson_backend=self.poisson_backend)
self.__hhd = nHHD(cuda=self.cuda, grid=flow.shape[:2], spacings=(18, 18), poisson_backend=self.poisson_backend, debug=self.debug)
# Force computation
# When OpenCL backend is selected, use host force path to ensure