mirror of
https://github.com/Project-Babble/ProjectBabble.git
synced 2026-11-20 00:51:16 -08:00
fix filter/ model output
This commit is contained in:
1 parent
eaadd07a6c
commit
cbc2daee8a
2 files changed
+9
-17
No files matched your search
@@ -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
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user