diff --git a/BabbleApp/babble_model_loader.py b/BabbleApp/babble_model_loader.py index d926872..c23df9c 100644 --- a/BabbleApp/babble_model_loader.py +++ b/BabbleApp/babble_model_loader.py @@ -15,17 +15,6 @@ from one_euro_filter import OneEuroFilter def run_model(self): - - - min_cutoff = float(self.settings.gui_min_cutoff) #15.5004 - beta = float(self.settings.gui_speed_coefficient) #0.62 - noisy_point = np.array([45]) - filter = OneEuroFilter( - noisy_point, - min_cutoff=min_cutoff, - beta=beta - ) - frame = cv2.resize(self.current_image_gray, (256, 256)) # make it pil frame = Image.fromarray(frame) @@ -42,7 +31,8 @@ def run_model(self): #end = time.time() output = out[0] output = output[0] - output = filter(output) + output = self.one_euro_filter(output) for i in range(len(output)): # Clip values between 0 - 1 output[i] = max(min(output[i], 1), 0) + print(output) self.output = output \ No newline at end of file diff --git a/BabbleApp/babble_processor.py b/BabbleApp/babble_processor.py index 6339c12..9df9c70 100644 --- a/BabbleApp/babble_processor.py +++ b/BabbleApp/babble_processor.py @@ -19,6 +19,8 @@ from tab import CamInfo, CamInfoOrigin from babble_model_loader import * import os os.environ["OMP_NUM_THREADS"] = "1" +import onnxruntime as ort + def run_once(f): def wrapper(*args, **kwargs): if not wrapper.has_run: @@ -95,13 +97,13 @@ class BabbleProcessor: try: - min_cutoff = float(self.settings.gui_min_cutoff) # 0.0004 - beta = float(self.settings.gui_speed_coefficient) # 0.9 + min_cutoff = float(self.settings.gui_min_cutoff) # 15.5004 + beta = float(self.settings.gui_speed_coefficient) # 0.62 except: print('\033[93m[WARN] OneEuroFilter values must be a legal number.\033[0m') - min_cutoff = 0.0004 - beta = 0.9 - noisy_point = np.array([1, 1]) + min_cutoff = 15.0004 + beta = 0.62 + noisy_point = np.array([45]) self.one_euro_filter = OneEuroFilter( noisy_point, min_cutoff=min_cutoff,