From 7bedaaec0d64800f5c13f2a484e977ec154ad010 Mon Sep 17 00:00:00 2001 From: SnuffSocket <82658601+SnuffSocket@users.noreply.github.com> Date: Mon, 14 Apr 2025 01:36:28 +0300 Subject: [PATCH 01/16] Fix: "Import statement position to prevent errors on non windows machines" By RedHawk989: https://github.com/EyeTrackVR/EyeTrackVR/commit/f595fb53c6e47dae1e1af21ec41852548ea83bce --- BabbleApp/babbleapp.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/BabbleApp/babbleapp.py b/BabbleApp/babbleapp.py index f1a3263..2fa7c12 100644 --- a/BabbleApp/babbleapp.py +++ b/BabbleApp/babbleapp.py @@ -23,7 +23,6 @@ import threading import asyncio import logging -from ctypes import c_int from babble_model_loader import * from camera_widget import CameraWidget from config import BabbleConfig @@ -41,8 +40,7 @@ if os_type == "Windows": try: - from ctypes import windll - + from ctypes import windll, c_int winmm = windll.winmm except OSError: print( From ad61f14f5a06c0ceb10e6cbd1716bbd11ea92e32 Mon Sep 17 00:00:00 2001 From: SnuffSocket <82658601+SnuffSocket@users.noreply.github.com> Date: Mon, 14 Apr 2025 01:48:39 +0300 Subject: [PATCH 02/16] Fix: Missing serial port after list refresh 'n "SteamVR dashboard reload": https://github.com/Project-Babble/ProjectBabble/issues/63 --- BabbleApp/utils/misc_utils.py | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/BabbleApp/utils/misc_utils.py b/BabbleApp/utils/misc_utils.py index e4a663f..83cc5e6 100644 --- a/BabbleApp/utils/misc_utils.py +++ b/BabbleApp/utils/misc_utils.py @@ -1,5 +1,6 @@ import typing import serial +import serial.tools.list_ports import sys import glob import os @@ -124,25 +125,16 @@ def list_serial_ports(): :returns: A list of the serial ports available on the system """ - if sys.platform.startswith("win"): - ports = ["COM%s" % (i + 1) for i in range(256)] - elif sys.platform.startswith("linux") or sys.platform.startswith("cygwin"): - # this excludes your current terminal "/dev/tty" - ports = glob.glob("/dev/tty[A-Za-z]*") - elif sys.platform.startswith("darwin"): - ports = glob.glob("/dev/tty.*") - else: + if not sys.platform.startswith(("win", "linux", "cygwin", "darwin")): raise EnvironmentError("Unsupported platform") - result = [] - for port in ports: - try: - s = serial.Serial(port) - s.close() - result.append(port) - except (OSError, serial.SerialException): - pass - return result + ports = [] + try: + for s in serial.tools.list_ports.comports(): + ports.append(s.device) + except (AttributeError, OSError, serial.SerialException): + pass + return sorted(ports) def get_camera_index_by_name(name): From b5443d34c681d8d1fd81c80c6d4f5addc12232d7 Mon Sep 17 00:00:00 2001 From: SnuffSocket <82658601+SnuffSocket@users.noreply.github.com> Date: Mon, 14 Apr 2025 02:01:40 +0300 Subject: [PATCH 03/16] Fix: Clean notifier's remains --- BabbleApp/Locale/Afrikaans/locale.json | 4 ---- BabbleApp/Locale/Dansk/locale.json | 4 ---- BabbleApp/Locale/Deutsch/locale.json | 4 ---- BabbleApp/Locale/English/locale.json | 4 ---- "BabbleApp/Locale/Espa\303\261ol/locale.json" | 4 ---- "BabbleApp/Locale/Fran\303\247aise/locale.json" | 4 ---- BabbleApp/Locale/Indonesian/locale.json | 4 ---- BabbleApp/Locale/Italiano/locale.json | 4 ---- BabbleApp/Locale/Nederlands/locale.json | 4 ---- BabbleApp/Locale/OwO/locale.json | 4 ---- BabbleApp/Locale/Pirate Speak/locale.json | 4 ---- BabbleApp/Locale/Polski/locale.json | 4 ---- .../locale.json" | 4 ---- BabbleApp/Locale/Svenska/locale.json | 4 ---- .../locale.json" | 4 ---- .../locale.json" | 4 ---- BabbleApp/requirements.txt | 1 - 17 files changed, 65 deletions(-) diff --git a/BabbleApp/Locale/Afrikaans/locale.json b/BabbleApp/Locale/Afrikaans/locale.json index 578ab31..a1587a8 100644 --- a/BabbleApp/Locale/Afrikaans/locale.json +++ b/BabbleApp/Locale/Afrikaans/locale.json @@ -120,10 +120,6 @@ "babble.needUpdateTwo": "installed. Please update to", "babble.needUpdateThree": "for the newest features", "babble.name": "Babble App", - "babble.updatePresent": "New Update Available", - "babble.updateTo": "Please update to", - "babble.downloadPage": "Download Page", - "babble.noToast": "Toast notifications not supported", "babble.noInternet": "Internet connection failed, no update check occured", "babble.camPage": "Cam", "babble.settingsPage": "Settings", diff --git a/BabbleApp/Locale/Dansk/locale.json b/BabbleApp/Locale/Dansk/locale.json index 42ae38a..f17b662 100644 --- a/BabbleApp/Locale/Dansk/locale.json +++ b/BabbleApp/Locale/Dansk/locale.json @@ -120,10 +120,6 @@ "babble.needUpdateTwo": "installed. Please update to", "babble.needUpdateThree": "for the newest features", "babble.name": "Babble App", - "babble.updatePresent": "New Update Available", - "babble.updateTo": "Please update to", - "babble.downloadPage": "Download Page", - "babble.noToast": "Toast notifications not supported", "babble.noInternet": "Internet connection failed, no update check occured", "babble.camPage": "Cam", "babble.settingsPage": "Settings", diff --git a/BabbleApp/Locale/Deutsch/locale.json b/BabbleApp/Locale/Deutsch/locale.json index 82db9c6..335a7c0 100644 --- a/BabbleApp/Locale/Deutsch/locale.json +++ b/BabbleApp/Locale/Deutsch/locale.json @@ -120,10 +120,6 @@ "babble.needUpdateTwo": "installiert. Bitte aktualisieren Sie auf", "babble.needUpdateThree": "für die neuesten Funktionen", "babble.name": "Babble App", - "babble.updatePresent": "Neues Update verfügbar", - "babble.updateTo": "Bitte aktualisieren Sie auf", - "babble.downloadPage": "Download-Seite", - "babble.noToast": "Toast-Benachrichtigungen werden nicht unterstützt", "babble.noInternet": "Konnte keine Verbindung zum Internet herstellen, Update-Suche übersprungen", "babble.camPage": "Kamera", "babble.settingsPage": "Einstellungen", diff --git a/BabbleApp/Locale/English/locale.json b/BabbleApp/Locale/English/locale.json index d1f452c..7a68484 100644 --- a/BabbleApp/Locale/English/locale.json +++ b/BabbleApp/Locale/English/locale.json @@ -120,10 +120,6 @@ "babble.needUpdateTwo": "Installed. Please update to", "babble.needUpdateThree": "For the newest features", "babble.name": "Babble App", - "babble.updatePresent": "New Update Available", - "babble.updateTo": "Please update to", - "babble.downloadPage": "Download Page", - "babble.noToast": "Toast notifications not supported", "babble.noInternet": "Internet connection failed, no update check occurred", "babble.camPage": "Cam", "babble.settingsPage": "Settings", diff --git "a/BabbleApp/Locale/Espa\303\261ol/locale.json" "b/BabbleApp/Locale/Espa\303\261ol/locale.json" index a8eb782..754b6e9 100644 --- "a/BabbleApp/Locale/Espa\303\261ol/locale.json" +++ "b/BabbleApp/Locale/Espa\303\261ol/locale.json" @@ -120,10 +120,6 @@ "babble.needUpdateTwo": "instalada. Por favor actualiza a", "babble.needUpdateThree": "para tener las últimas funciones", "babble.name": "App Babble", - "babble.updatePresent": "Nueva Actualización Disponible", - "babble.updateTo": "Por favor actualiza a", - "babble.downloadPage": "Página de Descarga", - "babble.noToast": "Notificaciones Toast no soportadas", "babble.noInternet": "Error de conexión a Internet, no se buscaron actualizaciones", "babble.camPage": "Cámara", "babble.settingsPage": "Ajustes", diff --git "a/BabbleApp/Locale/Fran\303\247aise/locale.json" "b/BabbleApp/Locale/Fran\303\247aise/locale.json" index c2a4744..c560b74 100644 --- "a/BabbleApp/Locale/Fran\303\247aise/locale.json" +++ "b/BabbleApp/Locale/Fran\303\247aise/locale.json" @@ -120,10 +120,6 @@ "babble.needUpdateTwo": "installé. Mettez à jour vers", "babble.needUpdateThree": "pour les nouvelles fonctions", "babble.name": "Application Babble", - "babble.updatePresent": "Nouvelle mise à jour disponible", - "babble.updateTo": "Mettez à jour vers", - "babble.downloadPage": "Page de téléchargement", - "babble.noToast": "Les notifications flottantes ne sont pas supportées", "babble.noInternet": "Échec de la connexion à internet, aucune vérification effectuée", "babble.camPage": "Caméra", "babble.settingsPage": "Options", diff --git a/BabbleApp/Locale/Indonesian/locale.json b/BabbleApp/Locale/Indonesian/locale.json index 7db87a5..a680d2c 100644 --- a/BabbleApp/Locale/Indonesian/locale.json +++ b/BabbleApp/Locale/Indonesian/locale.json @@ -120,10 +120,6 @@ "babble.needUpdateTwo": "terinstall. Silakan Perbarui ke", "babble.needUpdateThree": "untuk fitur terbaru", "babble.name": "Aplikasi Babble", - "babble.updatePresent": "Pembaruaan Tersedia", - "babble.updateTo": "Silakan perbarui ke", - "babble.downloadPage": "Halaman Unduh", - "babble.noToast": "Toast notifikasi tidak mendukung", "babble.noInternet": "Koneksi internet gagal, tidak ada perbaruan yang terjadi", "babble.camPage": "Kamera", "babble.settingsPage": "Pengaturan", diff --git a/BabbleApp/Locale/Italiano/locale.json b/BabbleApp/Locale/Italiano/locale.json index 0299a18..2f209a8 100644 --- a/BabbleApp/Locale/Italiano/locale.json +++ b/BabbleApp/Locale/Italiano/locale.json @@ -120,10 +120,6 @@ "babble.needUpdateTwo": "installata. Si prega di aggiornare a", "babble.needUpdateThree": "per le funzioni più recenti", "babble.name": "App Babble", - "babble.updatePresent": "Nuovo Aggiornamento Disponibile", - "babble.updateTo": "Si prega di aggiornare a", - "babble.downloadPage": "Pagina Di Download", - "babble.noToast": "Notifiche toast non supportate", "babble.noInternet": "Connessione a Internet non riuscita, non è stato possibile verificare la presenza di nuovi aggiornamenti", "babble.camPage": "Cam", "babble.settingsPage": "Impostazioni", diff --git a/BabbleApp/Locale/Nederlands/locale.json b/BabbleApp/Locale/Nederlands/locale.json index 7a75833..3948dbe 100644 --- a/BabbleApp/Locale/Nederlands/locale.json +++ b/BabbleApp/Locale/Nederlands/locale.json @@ -120,10 +120,6 @@ "babble.needUpdateTwo": "geïnstalleerd. Update A.U.B naar", "babble.needUpdateThree": "voor de nieuwste functies", "babble.name": "Babble App", - "babble.updatePresent": "Nieuwe Update Beschikbaar", - "babble.updateTo": "Update A.U.B naar", - "babble.downloadPage": "Download Pagina", - "babble.noToast": "Toast notificaties niet ondersteund", "babble.noInternet": "Internetverbinding mislukt, er heeft geen updatecontrole plaatsgevonden", "babble.camPage": "Cam", "babble.settingsPage": "Instellingen", diff --git a/BabbleApp/Locale/OwO/locale.json b/BabbleApp/Locale/OwO/locale.json index 109c698..7496a73 100644 --- a/BabbleApp/Locale/OwO/locale.json +++ b/BabbleApp/Locale/OwO/locale.json @@ -120,10 +120,6 @@ "babble.needUpdateTwo": "instawwed. Please update to", "babble.needUpdateThree": "fow the newest featuwes", "babble.name": "babbwe app UwU", - "babble.updatePresent": "new update avaiwabwe >w<", - "babble.updateTo": "pwease update to nya~", - "babble.downloadPage": "downwoad page :3", - "babble.noToast": "toast notifications not suppowted OwO", "babble.noInternet": "intewnet connection faiwed, no update check occuwwed UwU", "babble.camPage": "cam >w<", "babble.settingsPage": "settings nya~", diff --git a/BabbleApp/Locale/Pirate Speak/locale.json b/BabbleApp/Locale/Pirate Speak/locale.json index 5db64c3..154a13a 100644 --- a/BabbleApp/Locale/Pirate Speak/locale.json +++ b/BabbleApp/Locale/Pirate Speak/locale.json @@ -120,10 +120,6 @@ "babble.needUpdateTwo": "installed. Please update to", "babble.needUpdateThree": "for the newest features", "babble.name": "Babble Ship", - "babble.updatePresent": "New Booty Available", - "babble.updateTo": "Please update to", - "babble.downloadPage": "Plunder Page", - "babble.noToast": "Toast notifications not supported, ye scurvy dog", "babble.noInternet": "Internet connection failed, no update check occurred", "babble.camPage": "Spyglass", "babble.settingsPage": "Ship's Riggin's", diff --git a/BabbleApp/Locale/Polski/locale.json b/BabbleApp/Locale/Polski/locale.json index 2ad6644..96c81d3 100644 --- a/BabbleApp/Locale/Polski/locale.json +++ b/BabbleApp/Locale/Polski/locale.json @@ -120,10 +120,6 @@ "babble.needUpdateTwo": "zainstalowano. Proszę zaktualizować do", "babble.needUpdateThree": "po najnowsze funkcje", "babble.name": "Apka Babble", - "babble.updatePresent": "Nowa aktualizacja dostępna", - "babble.updateTo": "Proszę zaktualizuj do", - "babble.downloadPage": "Strona pobierania", - "babble.noToast": "Powiadomienia Toast nie są obsługiwane", "babble.noInternet": "Brak dostępu do internetu, sprawdzenie nowej aktualizacji nieudane", "babble.camPage": "Ustawienia kamery", "babble.settingsPage": "Ustawienia", diff --git "a/BabbleApp/Locale/P\321\203\321\201\321\201\320\272\320\270\320\271/locale.json" "b/BabbleApp/Locale/P\321\203\321\201\321\201\320\272\320\270\320\271/locale.json" index f51248c..c89a5c4 100644 --- "a/BabbleApp/Locale/P\321\203\321\201\321\201\320\272\320\270\320\271/locale.json" +++ "b/BabbleApp/Locale/P\321\203\321\201\321\201\320\272\320\270\320\271/locale.json" @@ -120,10 +120,6 @@ "babble.needUpdateTwo": ". Пожалуйста, обновитесь до версии", "babble.needUpdateThree": ", чтобы получить новые функции", "babble.name": "Приложение Babble", - "babble.updatePresent": "Доступно новое обновление", - "babble.updateTo": "Пожалуйста, обновитесь до", - "babble.downloadPage": "Страница загрузок", - "babble.noToast": "Тост-уведомления не поддерживаются", "babble.noInternet": "Сбой подключения к Интернету, проверка обновлений не выполнена", "babble.camPage": "Камера", "babble.settingsPage": "Настройки", diff --git a/BabbleApp/Locale/Svenska/locale.json b/BabbleApp/Locale/Svenska/locale.json index f922f57..e84ba92 100644 --- a/BabbleApp/Locale/Svenska/locale.json +++ b/BabbleApp/Locale/Svenska/locale.json @@ -120,10 +120,6 @@ "babble.needUpdateTwo": "installerad. Vänligen uppdatera till", "babble.needUpdateThree": "den senaste funktionerna", "babble.name": "Babble Appen", - "babble.updatePresent": "Uppdatering Tillgänglig", - "babble.updateTo": "Vänlig uppdatera till", - "babble.downloadPage": "Nedladdningssida", - "babble.noToast": "Toast notifieringsstöd saknas", "babble.noInternet": "Internetuppkoppling saknas, uppdateringssökning misslyckades", "babble.camPage": "Kamera", "babble.settingsPage": "Inställningar", diff --git "a/BabbleApp/Locale/\347\256\200\344\275\223\344\270\255\346\226\207/locale.json" "b/BabbleApp/Locale/\347\256\200\344\275\223\344\270\255\346\226\207/locale.json" index 3731e3b..7b228c3 100644 --- "a/BabbleApp/Locale/\347\256\200\344\275\223\344\270\255\346\226\207/locale.json" +++ "b/BabbleApp/Locale/\347\256\200\344\275\223\344\270\255\346\226\207/locale.json" @@ -120,10 +120,6 @@ "babble.needUpdateTwo": "已被安装,请升级到", "babble.needUpdateThree": "为了最新的特色", "babble.name": "Babble应用", - "babble.updatePresent": "新的升级可用", - "babble.updateTo": "请升级到", - "babble.downloadPage": "下载页面", - "babble.noToast": "不支持Toast通知", "babble.noInternet": "网络连接失败,未进行更新检查", "babble.camPage": "相机", "babble.settingsPage": "设定", diff --git "a/BabbleApp/Locale/\347\271\201\351\253\224\344\270\255\346\226\207/locale.json" "b/BabbleApp/Locale/\347\271\201\351\253\224\344\270\255\346\226\207/locale.json" index c15db25..94b4eb8 100644 --- "a/BabbleApp/Locale/\347\271\201\351\253\224\344\270\255\346\226\207/locale.json" +++ "b/BabbleApp/Locale/\347\271\201\351\253\224\344\270\255\346\226\207/locale.json" @@ -120,10 +120,6 @@ "babble.needUpdateTwo": "請更新至", "babble.needUpdateThree": "以使用最新功能", "babble.name": "Babble App", - "babble.updatePresent": "有新版本可用", - "babble.updateTo": "請更新至", - "babble.downloadPage": "下載頁面", - "babble.noToast": "不支援快顯通知", "babble.noInternet": "網路連線失敗,無法檢查更新", "babble.camPage": "攝影機", "babble.settingsPage": "設定", diff --git a/BabbleApp/requirements.txt b/BabbleApp/requirements.txt index 514038f..e30de0f 100644 --- a/BabbleApp/requirements.txt +++ b/BabbleApp/requirements.txt @@ -10,7 +10,6 @@ python_osc==1.9.0; pydantic==2.10.6; pyserial==3.5; colorama==0.4.6; -desktop-notifier==6.0.0; comtypes==1.4.8; pygrabber==0.2; psutil==7.0.0; From cd272e72acb7a7aef62577628f65c05265982eb4 Mon Sep 17 00:00:00 2001 From: SnuffSocket <82658601+SnuffSocket@users.noreply.github.com> Date: Mon, 14 Apr 2025 02:06:08 +0300 Subject: [PATCH 04/16] Fix: "AttributeError: NoneType" exception when closing --- BabbleApp/logger.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/BabbleApp/logger.py b/BabbleApp/logger.py index d94f1e5..a87631a 100644 --- a/BabbleApp/logger.py +++ b/BabbleApp/logger.py @@ -64,14 +64,22 @@ def __init__(self, stream, log_level): self.log_level = log_level def write(self, message): - message = strip_ansi_codes(message) - if message.strip(): - logger.log(self.log_level, message.strip()) - self.stream.write(message) - self.stream.flush() + if self.stream: + message = strip_ansi_codes(message) + if message.strip(): + logger.log(self.log_level, message.strip()) + try: + self.stream.write(message) + self.stream.flush() + except AttributeError: + pass def flush(self): - self.stream.flush() + if self.stream: + try: + self.stream.flush() + except AttributeError: + pass sys.stdout = StreamToLogger(sys.stdout, logging.INFO) sys.stderr = StreamToLogger(sys.stderr, logging.ERROR) From e9c0a1ba26e6d1a08a45e667b9045dd27d8e3b29 Mon Sep 17 00:00:00 2001 From: SnuffSocket <82658601+SnuffSocket@users.noreply.github.com> Date: Mon, 14 Apr 2025 02:09:09 +0300 Subject: [PATCH 05/16] Fix: Use rotating log file w/2MB limit, changed file name 'n removed "./Logs/ProjectBabble" folder --- BabbleApp/logger.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/BabbleApp/logger.py b/BabbleApp/logger.py index d94f1e5..f069155 100644 --- a/BabbleApp/logger.py +++ b/BabbleApp/logger.py @@ -4,6 +4,7 @@ import sys import platform import psutil +from logging.handlers import RotatingFileHandler def strip_ansi_codes(text): """Remove ANSI color codes from a string.""" @@ -39,18 +40,16 @@ def log_system_info(logger): def setup_logging(): - # Determine the user's Documents directory - #documents_dir = os.path.join(os.path.expanduser("~"), "Documents") - documents_dir = "./Logs" - log_dir = os.path.join(documents_dir, "ProjectBabble") + # Log to program directory + log_dir = "./Logs" os.makedirs(log_dir, exist_ok=True) - log_file = os.path.join(log_dir, "latest.log") + log_file = os.path.join(log_dir, "ProjectBabble.log") # Set up logging logger = logging.getLogger("debug_logger") logger.setLevel(logging.DEBUG) - file_handler = logging.FileHandler(log_file, mode='w', encoding='utf-8') + file_handler = RotatingFileHandler(log_file, mode='w', maxBytes=2000000, backupCount=1, encoding='utf-8') file_handler.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S') file_handler.setFormatter(formatter) From 91f8924628eeaadd43b742cde35e8e34350084c8 Mon Sep 17 00:00:00 2001 From: SnuffSocket <82658601+SnuffSocket@users.noreply.github.com> Date: Mon, 14 Apr 2025 02:11:51 +0300 Subject: [PATCH 06/16] Feat: Optional logging --- BabbleApp/Locale/Afrikaans/locale.json | 2 ++ BabbleApp/Locale/Dansk/locale.json | 2 ++ BabbleApp/Locale/Deutsch/locale.json | 2 ++ BabbleApp/Locale/English/locale.json | 2 ++ "BabbleApp/Locale/Espa\303\261ol/locale.json" | 2 ++ "BabbleApp/Locale/Fran\303\247aise/locale.json" | 2 ++ BabbleApp/Locale/Indonesian/locale.json | 2 ++ BabbleApp/Locale/Italiano/locale.json | 2 ++ BabbleApp/Locale/Nederlands/locale.json | 2 ++ BabbleApp/Locale/OwO/locale.json | 2 ++ BabbleApp/Locale/Pirate Speak/locale.json | 2 ++ BabbleApp/Locale/Polski/locale.json | 2 ++ .../locale.json" | 2 ++ BabbleApp/Locale/Svenska/locale.json | 2 ++ .../locale.json" | 2 ++ .../locale.json" | 2 ++ BabbleApp/babbleapp.py | 5 ++++- BabbleApp/config.py | 1 + BabbleApp/general_settings_widget.py | 13 +++++++++++++ 19 files changed, 50 insertions(+), 1 deletion(-) diff --git a/BabbleApp/Locale/Afrikaans/locale.json b/BabbleApp/Locale/Afrikaans/locale.json index 578ab31..496202c 100644 --- a/BabbleApp/Locale/Afrikaans/locale.json +++ b/BabbleApp/Locale/Afrikaans/locale.json @@ -2,6 +2,8 @@ "general.header": "General Settings", "general.checkForUpdates": "Check For Updates", "general.toolTip": "Toggle update check on launch", + "general.logging": "Enable Logging", + "general.loggingTooltip": "Save log file for debugging. (Restart needed)", "general.oscSettings": "OSC Settings", "general.locationPrefix": "Location Prefix", "general.locationTooltip": "Prefix for OSC address", diff --git a/BabbleApp/Locale/Dansk/locale.json b/BabbleApp/Locale/Dansk/locale.json index 42ae38a..49af632 100644 --- a/BabbleApp/Locale/Dansk/locale.json +++ b/BabbleApp/Locale/Dansk/locale.json @@ -2,6 +2,8 @@ "general.header": "Generelle Indstillinger", "general.checkForUpdates": "Tjek For Opdateringer", "general.toolTip": "Slå opdateringstjek ved start til eller fra", + "general.logging": "Aktiver logning", + "general.loggingTooltip": "Gem logfil til fejlfinding. (Genstart nødvendig)", "general.oscSettings": "OSC Indstillinger", "general.locationPrefix": "Stedpræfiks", "general.locationTooltip": "Præfiks for OSC adresse", diff --git a/BabbleApp/Locale/Deutsch/locale.json b/BabbleApp/Locale/Deutsch/locale.json index 82db9c6..ddce158 100644 --- a/BabbleApp/Locale/Deutsch/locale.json +++ b/BabbleApp/Locale/Deutsch/locale.json @@ -2,6 +2,8 @@ "general.header": "Allgemeine Einstellungen", "general.checkForUpdates": "Nach Updates suchen", "general.toolTip": "Beim Start nach Updates suchen", + "general.logging": "Protokollierung aktivieren", + "general.loggingTooltip": "Protokolldatei zum debuggen speichern. (Neustart erforderlich)", "general.oscSettings": "OSC Einstellungen", "general.locationPrefix": "Sprache Präfix", "general.locationTooltip": "OSC Adressen-Präfix", diff --git a/BabbleApp/Locale/English/locale.json b/BabbleApp/Locale/English/locale.json index d1f452c..78dac07 100644 --- a/BabbleApp/Locale/English/locale.json +++ b/BabbleApp/Locale/English/locale.json @@ -2,6 +2,8 @@ "general.header": "General Settings", "general.checkForUpdates": "Check For Updates", "general.toolTip": "Toggle update check on launch", + "general.logging": "Enable Logging", + "general.loggingTooltip": "Save log file for debugging. (Restart needed)", "general.oscSettings": "OSC Settings", "general.locationPrefix": "Location Prefix", "general.locationTooltip": "Prefix for OSC address", diff --git "a/BabbleApp/Locale/Espa\303\261ol/locale.json" "b/BabbleApp/Locale/Espa\303\261ol/locale.json" index a8eb782..2b90ec2 100644 --- "a/BabbleApp/Locale/Espa\303\261ol/locale.json" +++ "b/BabbleApp/Locale/Espa\303\261ol/locale.json" @@ -2,6 +2,8 @@ "general.header": "Ajustes Generales", "general.checkForUpdates": "Buscar actualizaciones", "general.toolTip": "Elige buscar actualizaciones al arrancar", + "general.logging": "Habilitar registro", + "general.loggingTooltip": "Guardar archivo de registro para depuración. (Reinicio necesario)", "general.oscSettings": "Ajustes de OSC", "general.locationPrefix": "Prefijo de dirección", "general.locationTooltip": "Prefijo para la dirección OSC", diff --git "a/BabbleApp/Locale/Fran\303\247aise/locale.json" "b/BabbleApp/Locale/Fran\303\247aise/locale.json" index c2a4744..d6c6ca6 100644 --- "a/BabbleApp/Locale/Fran\303\247aise/locale.json" +++ "b/BabbleApp/Locale/Fran\303\247aise/locale.json" @@ -2,6 +2,8 @@ "general.header": "Paramètres généraux", "general.checkForUpdates": "Vérifier les mises à jour", "general.toolTip": "Activer la vérification des mises à jour au démarrage", + "general.logging": "Activer l'enregistrement", + "general.loggingTooltip": "Enregistrer le fichier journal pour le débogage. (Redémarrage nécessaire)", "general.oscSettings": "Paramètres OSC", "general.locationPrefix": "Préfixe de localisation", "general.locationTooltip": "Préfixe de l'adresse OSC", diff --git a/BabbleApp/Locale/Indonesian/locale.json b/BabbleApp/Locale/Indonesian/locale.json index 7db87a5..9fec796 100644 --- a/BabbleApp/Locale/Indonesian/locale.json +++ b/BabbleApp/Locale/Indonesian/locale.json @@ -2,6 +2,8 @@ "general.header": "Pengaturan Umum", "general.checkForUpdates": "Periksa Pembaruan", "general.toolTip": "Aktifkan Memeriksa perbaruan saat buka aplikasi", + "general.logging": "Aktifkan Pencatatan", + "general.loggingTooltip": "Simpan berkas log untuk debugging. (Memulai ulang diperlukan)", "general.oscSettings": "Pengaturan OSC", "general.locationPrefix": "Awalan Lokasi", "general.locationTooltip": "Awalan untuk OSC address", diff --git a/BabbleApp/Locale/Italiano/locale.json b/BabbleApp/Locale/Italiano/locale.json index 0299a18..de8dd16 100644 --- a/BabbleApp/Locale/Italiano/locale.json +++ b/BabbleApp/Locale/Italiano/locale.json @@ -2,6 +2,8 @@ "general.header": "Impostazioni Generali", "general.checkForUpdates": "Verifica Disponibilità Aggiornamenti", "general.toolTip": "Attiva/Disattiva Controllo Aggiornamenti all'Avvio", + "general.logging": "Attiva logging", + "general.loggingTooltip": "Salva il file di log per il debug. (Riavvio necessario)", "general.oscSettings": "Impostazioni OSC", "general.locationPrefix": "Prefisso Posizione", "general.locationTooltip": "Prefisso per l'indirizzo OSC", diff --git a/BabbleApp/Locale/Nederlands/locale.json b/BabbleApp/Locale/Nederlands/locale.json index 7a75833..e99856a 100644 --- a/BabbleApp/Locale/Nederlands/locale.json +++ b/BabbleApp/Locale/Nederlands/locale.json @@ -2,6 +2,8 @@ "general.header": "Algemene Instellingen", "general.checkForUpdates": "Checken Voor Updates", "general.toolTip": "Update check bij opstarten inschakelen", + "general.logging": "Logging inschakelen", + "general.loggingTooltip": "Logbestand opslaan voor debugging. (Herstart nodig)", "general.oscSettings": "OSC Instellingen", "general.locationPrefix": "Voorvoegsel voor locatie", "general.locationTooltip": "Voorvoegsel voor OSC-adres", diff --git a/BabbleApp/Locale/OwO/locale.json b/BabbleApp/Locale/OwO/locale.json index 109c698..fffac75 100644 --- a/BabbleApp/Locale/OwO/locale.json +++ b/BabbleApp/Locale/OwO/locale.json @@ -2,6 +2,8 @@ "general.header": "genewaw settings OwO", "general.checkForUpdates": "check fow updates UwU", "general.toolTip": "toggwe update check on waunch >w<", + "general.logging": "Enabwe Wogging", + "general.loggingTooltip": "Save wog fiwe fow debugging. (Westawt needed)", "general.oscSettings": "OSC sewtings nya~", "general.locationPrefix": "wocation pwefix", "general.locationTooltip": "pwefix fow OSC addwess OwO", diff --git a/BabbleApp/Locale/Pirate Speak/locale.json b/BabbleApp/Locale/Pirate Speak/locale.json index 5db64c3..78cb252 100644 --- a/BabbleApp/Locale/Pirate Speak/locale.json +++ b/BabbleApp/Locale/Pirate Speak/locale.json @@ -2,6 +2,8 @@ "general.header": "Cap'n's Quarters", "general.checkForUpdates": "Scour fer Booty Updates", "general.toolTip": "Toggle update check when ye set sail", + "general.logging": "Commence Loggin'", + "general.loggingTooltip": "Stow log file fer fixin! (Needin' restart)", "general.oscSettings": "OSC Riggin's", "general.locationPrefix": "Treasure Map Prefix", "general.locationTooltip": "Prefix fer yer OSC coordinates", diff --git a/BabbleApp/Locale/Polski/locale.json b/BabbleApp/Locale/Polski/locale.json index 2ad6644..53f1e80 100644 --- a/BabbleApp/Locale/Polski/locale.json +++ b/BabbleApp/Locale/Polski/locale.json @@ -2,6 +2,8 @@ "general.header": "Ustawienia główne", "general.checkForUpdates": "Sprawdź aktualizacje", "general.toolTip": "Automatyczne sprawdzanie aktualizacji przy włączeniu", + "general.logging": "Włącz logowanie", + "general.loggingTooltip": "Zapisz plik dziennika do debugowania. (Wymagany restart)", "general.oscSettings": "Ustawienia OSC", "general.locationPrefix": "Location Prefix", "general.locationTooltip": "Prefix for OSC address", diff --git "a/BabbleApp/Locale/P\321\203\321\201\321\201\320\272\320\270\320\271/locale.json" "b/BabbleApp/Locale/P\321\203\321\201\321\201\320\272\320\270\320\271/locale.json" index f51248c..cbd049b 100644 --- "a/BabbleApp/Locale/P\321\203\321\201\321\201\320\272\320\270\320\271/locale.json" +++ "b/BabbleApp/Locale/P\321\203\321\201\321\201\320\272\320\270\320\271/locale.json" @@ -2,6 +2,8 @@ "general.header": "Общие настройки", "general.checkForUpdates": "Проверить обновления", "general.toolTip": "Включить проверку обновлений при запуске", + "general.logging": "Включить ведение журнала", + "general.loggingTooltip": "Сохранить файл журнала для отладки. (Необходим перезапуск)", "general.oscSettings": "Настройки OSC", "general.locationPrefix": "Префикс местоположения", "general.locationTooltip": "Префикс для адреса OSC", diff --git a/BabbleApp/Locale/Svenska/locale.json b/BabbleApp/Locale/Svenska/locale.json index f922f57..e0a08d4 100644 --- a/BabbleApp/Locale/Svenska/locale.json +++ b/BabbleApp/Locale/Svenska/locale.json @@ -2,6 +2,8 @@ "general.header": "Allmänna Inställningar", "general.checkForUpdates": "Sök Efter Uppdateringar", "general.toolTip": "Sök efter uppdateringar vid uppstart", + "general.logging": "Aktivera loggning", + "general.loggingTooltip": "Spara loggfil för felsökning. (Omstart behövs)", "general.oscSettings": "OSC Inställningar", "general.locationPrefix": "Plats Prefix", "general.locationTooltip": "Prefix för OSC adress", diff --git "a/BabbleApp/Locale/\347\256\200\344\275\223\344\270\255\346\226\207/locale.json" "b/BabbleApp/Locale/\347\256\200\344\275\223\344\270\255\346\226\207/locale.json" index 3731e3b..3f14864 100644 --- "a/BabbleApp/Locale/\347\256\200\344\275\223\344\270\255\346\226\207/locale.json" +++ "b/BabbleApp/Locale/\347\256\200\344\275\223\344\270\255\346\226\207/locale.json" @@ -2,6 +2,8 @@ "general.header": "常规设置", "general.checkForUpdates": "检查更新", "general.toolTip": "启动时检查更新", + "general.logging": "启用日志记录", + "general.loggingTooltip": "保存日志文件以进行调试。(需要重启)", "general.oscSettings": "OSC设置", "general.locationPrefix": "位置前缀", "general.locationTooltip": "OSC地址前缀", diff --git "a/BabbleApp/Locale/\347\271\201\351\253\224\344\270\255\346\226\207/locale.json" "b/BabbleApp/Locale/\347\271\201\351\253\224\344\270\255\346\226\207/locale.json" index c15db25..d3a3d16 100644 --- "a/BabbleApp/Locale/\347\271\201\351\253\224\344\270\255\346\226\207/locale.json" +++ "b/BabbleApp/Locale/\347\271\201\351\253\224\344\270\255\346\226\207/locale.json" @@ -2,6 +2,8 @@ "general.header": "一般設定", "general.checkForUpdates": "檢查更新", "general.toolTip": "開啟時檢查更新", + "general.logging": "啟用日誌記錄", + "general.loggingTooltip": "保存日誌文件以進行除錯。(需要重啟)", "general.oscSettings": "OSC 設定", "general.locationPrefix": "位置前綴", "general.locationTooltip": "OSC 位址的前綴", diff --git a/BabbleApp/babbleapp.py b/BabbleApp/babbleapp.py index f1a3263..6edc8d9 100644 --- a/BabbleApp/babbleapp.py +++ b/BabbleApp/babbleapp.py @@ -171,10 +171,13 @@ def shutdown_all(self, timeout=5.0): async def async_main(): ensurePath() - setup_logging() # Get Configuration config: BabbleConfig = BabbleConfig.load() + + # Init logging. TODO: Initiate before "BabbleConfig.load()"? + if config.settings.gui_logging: + setup_logging() # Init locale manager lang("Locale", config.settings.gui_language) diff --git a/BabbleApp/config.py b/BabbleApp/config.py index 1211ff6..0d913fc 100644 --- a/BabbleApp/config.py +++ b/BabbleApp/config.py @@ -35,6 +35,7 @@ class BabbleSettingsConfig(BaseModel): gui_osc_delay_enable: bool = False gui_osc_delay_seconds: float = 0.01 gui_update_check: bool = True + gui_logging: bool = True #Prefer "False" for stable release? gui_ROSC: bool = False gui_osc_location: str = "" gui_multiply: float = 1 diff --git a/BabbleApp/general_settings_widget.py b/BabbleApp/general_settings_widget.py index 67a6dec..fa08800 100644 --- a/BabbleApp/general_settings_widget.py +++ b/BabbleApp/general_settings_widget.py @@ -22,6 +22,7 @@ def __init__( self.gui_min_cutoff = f"-MINCUTOFF{widget_id}-" self.gui_ROSC = f"-ROSC{widget_id}-" self.gui_update_check = f"-UPDATECHECK{widget_id}-" + self.gui_logging = f"-LOGGING{widget_id}-" self.gui_osc_location = f"-OSCLOCATION{widget_id}-" self.gui_cam_resolution_x = f"-CAMRESX{widget_id}-" self.gui_cam_resolution_y = f"-CAMRESY{widget_id}-" @@ -45,6 +46,13 @@ def __init__( background_color=bg_color_highlight, tooltip=lang._instance.get_string("general.toolTip"), ), + sg.Checkbox( + lang._instance.get_string("general.logging"), + default=self.config.gui_logging, + key=self.gui_logging, + background_color=bg_color_highlight, + tooltip=lang._instance.get_string("general.loggingTooltip"), + ), ], [ sg.Text( @@ -332,6 +340,11 @@ def render(self, window, event, values): if self.config.gui_update_check != values[self.gui_update_check]: self.config.gui_update_check = values[self.gui_update_check] changed = True + + # Logging option + if self.config.gui_logging != values[self.gui_logging]: + self.config.gui_logging = values[self.gui_logging] + changed = True # Update disable camera preview option value = values[self.gui_disable_camera_preview] From 26f06fc9dac1e764fddea7277b9dde5585fb0fdd Mon Sep 17 00:00:00 2001 From: SnuffSocket <82658601+SnuffSocket@users.noreply.github.com> Date: Mon, 14 Apr 2025 02:13:59 +0300 Subject: [PATCH 07/16] Fix: "Serial camera doesn't work from drop-down", capture source not changing: https://github.com/Project-Babble/ProjectBabble/issues/99 --- BabbleApp/camera.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/BabbleApp/camera.py b/BabbleApp/camera.py index 1c425e1..f1be9b3 100644 --- a/BabbleApp/camera.py +++ b/BabbleApp/camera.py @@ -92,13 +92,8 @@ def run(self): should_push = True # If things aren't open, retry until they are. Don't let read requests come in any earlier # than this, otherwise we can deadlock (valve reference) ourselves. - if ( - self.config.capture_source is not None - and self.config.capture_source != "" - ): - self.current_capture_source = self.config.capture_source + if self.config.capture_source not in (None, ""): isSerial = any(x in str(self.config.capture_source) for x in PORTS) - if isSerial: if self.cv2_camera is not None: self.cv2_camera.release() From 08b610214b16a45c94ad065af59f057df8d50359 Mon Sep 17 00:00:00 2001 From: SnuffSocket <82658601+SnuffSocket@users.noreply.github.com> Date: Mon, 14 Apr 2025 02:17:35 +0300 Subject: [PATCH 08/16] Fix: Throttle serial connection retries --- BabbleApp/camera.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/BabbleApp/camera.py b/BabbleApp/camera.py index 1c425e1..fe51449 100644 --- a/BabbleApp/camera.py +++ b/BabbleApp/camera.py @@ -113,7 +113,9 @@ def run(self): ): port = self.config.capture_source self.current_capture_source = port - self.start_serial_connection(port) + if self.start_serial_connection(port): + time.sleep(0.3) + continue elif ViveTracker.is_device_vive_tracker(self.config.capture_source): if self.cv2_camera is not None: self.cv2_camera.release() @@ -312,13 +314,13 @@ def start_serial_connection(self, port): if self.serial_connection is not None and self.serial_connection.is_open: # Do nothing. The connection is already open on this port. if self.serial_connection.port == port: - return + return False # Otherwise, close the connection before trying to reopen. self.serial_connection.close() com_ports = [tuple(p) for p in list(serial.tools.list_ports.comports())] # Do not try connecting if no such port i.e. device was unplugged. if not any(p for p in com_ports if port in p): - return + return True try: rate = 115200 if sys.platform == "darwin" else 3000000 # Higher baud rate not working on macOS conn = serial.Serial(baudrate=rate, port=port, xonxoff=False, dsrdtr=False, rtscts=False) @@ -326,17 +328,15 @@ def start_serial_connection(self, port): if os_type == 'Windows': conn.set_buffer_size(rx_size=BUFFER_SIZE, tx_size=BUFFER_SIZE) - print( - f'{Fore.CYAN}[{lang._instance.get_string("log.info")}] {lang._instance.get_string("info.ETVRConnected")} {port}{Fore.RESET}' - ) + print(f'{Fore.CYAN}[{lang._instance.get_string("log.info")}] {lang._instance.get_string("info.ETVRConnected")} {port}{Fore.RESET}') self.serial_connection = conn self.camera_status = CameraState.CONNECTED + return False except Exception as e: - print( - f'{Fore.CYAN}[{lang._instance.get_string("log.info")}] {lang._instance.get_string("info.ETVRFailiure")} {port}{Fore.RESET}' - ) + print(f'{Fore.CYAN}[{lang._instance.get_string("log.info")}] {lang._instance.get_string("info.ETVRFailiure")} {port}{Fore.RESET}') print(e) self.camera_status = CameraState.DISCONNECTED + return True def clamp_max_res(self, image: MatLike) -> MatLike: shape = image.shape From 5c4d77ba0715632da0e62fef7b3a3d74e69ffdb1 Mon Sep 17 00:00:00 2001 From: SnuffSocket <82658601+SnuffSocket@users.noreply.github.com> Date: Mon, 14 Apr 2025 01:18:26 +0300 Subject: [PATCH 09/16] Fix: Bad indentation --- BabbleApp/babble_model_loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BabbleApp/babble_model_loader.py b/BabbleApp/babble_model_loader.py index e4d85af..388b71f 100644 --- a/BabbleApp/babble_model_loader.py +++ b/BabbleApp/babble_model_loader.py @@ -28,4 +28,4 @@ def run_model(self): # output[i] = max(min(output[i], 1), 0) ## Clip values between 0 - 1 output = np.clip(output, 0, 1) - self.output = output + self.output = output From 1de567081edaad7d49ed32b09bc516f7255aab98 Mon Sep 17 00:00:00 2001 From: SnuffSocket <82658601+SnuffSocket@users.noreply.github.com> Date: Mon, 14 Apr 2025 03:26:57 +0300 Subject: [PATCH 10/16] Fix: "One euro filter return none" by Fracas42: https://github.com/EyeTrackVR/EyeTrackVR/commit/5797fb342f8bdb33baece547f48f91e154092899 --- BabbleApp/one_euro_filter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BabbleApp/one_euro_filter.py b/BabbleApp/one_euro_filter.py index 30fa923..2c2421d 100644 --- a/BabbleApp/one_euro_filter.py +++ b/BabbleApp/one_euro_filter.py @@ -50,3 +50,6 @@ def __call__(self, x): self.t_prev = t return x_hat + else: + self.x_prev = x + return x From 72b3ef4b5d128a104c654b313c5ab470e73c856d Mon Sep 17 00:00:00 2001 From: dfgHiatus <51272212+dfgHiatus@users.noreply.github.com> Date: Mon, 12 May 2025 16:45:12 -0400 Subject: [PATCH 11/16] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c856f3..3cd7a84 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ By defualt Project Babble is under a non-commerical license! Please contact us a Head to the releases section and [download the latest installer](https://github.com/Project-Babble/ProjectBabble/releases/latest). ### MacOS and Linux -Install `git`, `curl` and a version of `python` (between `3.8` and `3.12`) for your distro. +Install `git`, `curl` and a version of `python` (between `3.10` and `3.12`) for your distro. Then, copy paste and run the following script into the terminal of your choice: From d669502f5969e9178edbc91605f4c9cd12e2a2ed Mon Sep 17 00:00:00 2001 From: SnuffSocket <82658601+SnuffSocket@users.noreply.github.com> Date: Tue, 13 May 2025 04:45:04 +0300 Subject: [PATCH 12/16] Fix: Include system info after log rollover --- BabbleApp/logger.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BabbleApp/logger.py b/BabbleApp/logger.py index f069155..193efbb 100644 --- a/BabbleApp/logger.py +++ b/BabbleApp/logger.py @@ -38,6 +38,11 @@ def log_system_info(logger): except Exception as e: logger.error(f"Failed to log system information: {e}") +class _RotatingFileHandler(RotatingFileHandler): + def doRollover(self): + super().doRollover() + # Include system info after rollover + log_system_info(logging.getLogger("debug_logger")) def setup_logging(): # Log to program directory @@ -49,7 +54,7 @@ def setup_logging(): logger = logging.getLogger("debug_logger") logger.setLevel(logging.DEBUG) - file_handler = RotatingFileHandler(log_file, mode='w', maxBytes=2000000, backupCount=1, encoding='utf-8') + file_handler = _RotatingFileHandler(log_file, mode='w', maxBytes=2000000, backupCount=1, encoding='utf-8') file_handler.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S') file_handler.setFormatter(formatter) From 4505bd66e5a03bd5bc7fce295b4691cfffff2c56 Mon Sep 17 00:00:00 2001 From: Quadrinex <153446328+quadrinex@users.noreply.github.com> Date: Tue, 13 May 2025 12:23:52 +0200 Subject: [PATCH 13/16] Corrected typo in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c856f3..00c3b19 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Project Babble is a source first mouth tracking project designed to work with an ## Interested in selling babble hardware? -By defualt Project Babble is under a non-commerical license! Please contact us at projectbabblevr@gmail.com to obtain a commercial license! +By default Project Babble is under a non-commerical license! Please contact us at projectbabblevr@gmail.com to obtain a commercial license! ## Table of Contents - [Features](#features) From f7391dc39185b30fc68087dc0ef9e8d3c195b1f9 Mon Sep 17 00:00:00 2001 From: dfgHiatus <51272212+dfgHiatus@users.noreply.github.com> Date: Tue, 13 May 2025 17:25:19 -0500 Subject: [PATCH 14/16] Update files for Post-PR merger --- BabbleApp/camera.py | 9 ++++----- BabbleApp/camera_widget.py | 8 ++++---- BabbleApp/utils/misc_utils.py | 37 +++++++++++++++++++++++------------ 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/BabbleApp/camera.py b/BabbleApp/camera.py index 7dfe1f9..0f02fdc 100644 --- a/BabbleApp/camera.py +++ b/BabbleApp/camera.py @@ -143,13 +143,12 @@ def run(self): self.cv2_camera is None or not self.cv2_camera.isOpened() or self.camera_status == CameraState.DISCONNECTED - #or get_camera_index_by_name(self.config.capture_source) != self.current_capture_source - or self.config.capture_source != self.current_capture_source + or get_camera_index_by_name(self.config.capture_source) != self.current_capture_source ): if self.vft_camera is not None: self.vft_camera.close() self.device_is_vft = False - + print(self.error_message.format(self.config.capture_source)) # This requires a wait, otherwise we can error and possible screw up the camera # firmware. Fickle things. @@ -221,7 +220,7 @@ def get_camera_picture(self, should_push): return self.frame_number = self.frame_number + 1 elif self.cv2_camera is not None and self.cv2_camera.isOpened(): - ret, image = self.cv2_camera.read() # MJPEG Stream reconnects are currently limited by the hard coded 30 second timeout time on VideoCapture.read(). We can get around this by recompiling OpenCV or using a custom MJPEG stream imp. + ret, image = self.cv2_camera.read() # MJPEG Stream reconnects are currently limited by the hard coded 30 second timeout time on VideoCapture.read(). We can get around this by recompiling OpenCV or using a custom MJPEG stream imp. if ret and image is not None: if not ret: if not self.http: @@ -366,4 +365,4 @@ def push_image_to_queue(self, image, frame_number, fps): f'{Fore.YELLOW}[{lang._instance.get_string("log.warn")}] {lang._instance.get_string("warn.backpressure1")} {qsize}. {lang._instance.get_string("warn.backpressure2")}{Fore.RESET}' ) self.camera_output_outgoing.put((self.clamp_max_res(image), frame_number, fps)) - self.capture_event.clear() \ No newline at end of file + self.capture_event.clear() diff --git a/BabbleApp/camera_widget.py b/BabbleApp/camera_widget.py index 1d8f833..ae59781 100644 --- a/BabbleApp/camera_widget.py +++ b/BabbleApp/camera_widget.py @@ -62,7 +62,7 @@ def __init__(self, widget_id: Tab, main_config: BabbleConfig, osc_queue: Queue): self.capture_event = Event() self.capture_queue = Queue(maxsize=2) self.roi_queue = Queue(maxsize=2) - self.image_queue = Queue(maxsize=500) # This is needed to prevent the UI from freezing during widget changes. + self.image_queue = Queue(maxsize=500) # This is needed to prevent the UI from freezing during widget changes. self.babble_cnn = BabbleProcessor( self.config, @@ -285,7 +285,7 @@ def start(self): # self.babble_landmark_thread.start() self.camera_thread = Thread(target=self.camera.run) self.camera_thread.start() - + def stop(self): # If we're not running yet, bail @@ -322,7 +322,7 @@ def render(self, window, event, values): if any(x in str(value) for x in ports): self.config.capture_source = value else: - if is_valid_int_input(value): + if is_valid_int_input(value): self.config.capture_source = int(value) else: self.config.capture_source = value @@ -422,7 +422,7 @@ def render(self, window, event, values): if self.maybe_image is None: # Skip rendering or use a default/placeholder image return # Or handle appropriately - + output = self.maybe_image[0].shape self.config.roi_window_x = 0 self.config.roi_window_y = 0 diff --git a/BabbleApp/utils/misc_utils.py b/BabbleApp/utils/misc_utils.py index 83cc5e6..a9d9189 100644 --- a/BabbleApp/utils/misc_utils.py +++ b/BabbleApp/utils/misc_utils.py @@ -1,4 +1,3 @@ -import typing import serial import serial.tools.list_ports import sys @@ -10,6 +9,7 @@ import subprocess import sounddevice as sd import soundfile as sf +import contextlib bg_color_highlight = "#424042" bg_color_clear = "#242224" @@ -17,6 +17,7 @@ onnx_providers = [ "DmlExecutionProvider", "CUDAExecutionProvider", + "CoreMLExecutionProvider", "CPUExecutionProvider", ] @@ -34,7 +35,7 @@ def is_valid_float_input(value): def is_valid_int_input(value): # Allow empty string, negative sign, or an integer number return bool(re.match(r"^-?\d*$", value)) - + def list_camera_names(): cam_list = graph.get_input_devices() cam_names = [] @@ -43,21 +44,34 @@ def list_camera_names(): cam_names = cam_names + list_serial_ports() return cam_names +@contextlib.contextmanager +def suppress_stderr(): + """Context manager to suppress stderr (used for OpenCV warnings).""" + with open(os.devnull, 'w') as devnull: + old_stderr_fd = os.dup(2) + os.dup2(devnull.fileno(), 2) + try: + yield + finally: + os.dup2(old_stderr_fd, 2) + os.close(old_stderr_fd) + def list_cameras_opencv(): """Use OpenCV to check available cameras by index (fallback for Linux/macOS)""" index = 0 arr = [] - while True: - cap = cv2.VideoCapture(index) - if not cap.read()[0]: - break - else: - arr.append(f"/dev/video{index}") - cap.release() - index += 1 + with suppress_stderr(): # tell OpenCV not to throw "cannot find camera" while we probe for cameras + while True: + cap = cv2.VideoCapture(index) + if not cap.read()[0]: + cap.release() + break + else: + arr.append(f"/dev/video{index}") + cap.release() + index += 1 return arr - def is_uvc_device(device): """Check if the device is a UVC video device (not metadata)""" try: @@ -174,4 +188,3 @@ def playSound(file): def ensurePath(): if os.path.exists(os.path.join(os.getcwd(), "BabbleApp")): os.chdir(os.path.join(os.getcwd(), "BabbleApp")) - From f79a1ad45815bc858b1813d277b79a6ed8ac4ecb Mon Sep 17 00:00:00 2001 From: Rames The Generic Date: Sat, 17 May 2025 19:48:08 -0400 Subject: [PATCH 15/16] Add Missing Locale Entries --- BabbleApp/Locale/Afrikaans/locale.json | 319 +++++++++--------- BabbleApp/Locale/Dansk/locale.json | 1 + BabbleApp/Locale/Deutsch/locale.json | 1 + BabbleApp/Locale/English/locale.json | 1 + "BabbleApp/Locale/Espa\303\261ol/locale.json" | 1 + .../Locale/Fran\303\247aise/locale.json" | 3 +- BabbleApp/Locale/Indonesian/locale.json | 1 + BabbleApp/Locale/Italiano/locale.json | 1 + BabbleApp/Locale/Nederlands/locale.json | 1 + BabbleApp/Locale/OwO/locale.json | 1 + BabbleApp/Locale/Pirate Speak/locale.json | 1 + BabbleApp/Locale/Polski/locale.json | 1 + .../locale.json" | 1 + BabbleApp/Locale/Svenska/locale.json | 1 + .../locale.json" | 1 + .../locale.json" | 1 + 16 files changed, 176 insertions(+), 160 deletions(-) diff --git a/BabbleApp/Locale/Afrikaans/locale.json b/BabbleApp/Locale/Afrikaans/locale.json index 93dcac2..f31e752 100644 --- a/BabbleApp/Locale/Afrikaans/locale.json +++ b/BabbleApp/Locale/Afrikaans/locale.json @@ -1,161 +1,162 @@ { - "general.header": "General Settings", - "general.checkForUpdates": "Check For Updates", - "general.toolTip": "Toggle update check on launch", - "general.logging": "Enable Logging", - "general.loggingTooltip": "Save log file for debugging. (Restart needed)", - "general.oscSettings": "OSC Settings", - "general.locationPrefix": "Location Prefix", - "general.locationTooltip": "Prefix for OSC address", - "general.address": "Address", - "general.addressTooltip": "IP address we send OSC data to", - "general.port": "Port", - "general.portTooltip": "OSC port we send data to", - "general.receiver": "Receive functions", - "general.receiverTooltip": "Toggle OSC receive functions", - "general.receiverPort": "Receiver Port", - "general.receiverPortTooltip": "Port we receive OSC data from (used to recalibrate from within VRChat", - "general.recalibrate": "Recalibrate Address", - "general.recalibrateTooltip": "OSC address we use for recalibrating", - "general.uvcCameraSettings": "UVC Camera Settings", - "general.useRedChannel": "Use Red Channel", - "general.useRedChannelTooltip": "Uses only the red channel for Omnicept capture", - "general.xResolution": "X Resolution", - "general.xResolutionTooltip": "X capture resolution. Default = 0", - "general.yResolution": "Y Resolution", - "general.yResolutionTooltip": "Y capture resolution. Default = 0", - "general.framerate": "Framerate", - "general.framerateTooltip": "Capture framerate. Default = 0", - "general.language": "Language Settings", - "general.languageInstructions": "Restart the Babble App to see your changes", - "general.languageTooltip": "Change the language", - "error.oscPort": "OSC port value must be an integer 0-65535", - "error.oscValue": "OSC port value cannot be empty and must be an integer 0-65535", - "error.notAnInt": "Not an Int", - "error.notAFloat": "Not a Float", - "error.improperTabValue": "Improper tab value", - "error.frame": "Problem while getting frame", - "error.size": "Size of frames to display are of unequal sizes", - "error.capture": "Frame capture issue detected", - "warn.frameDrop": "Frame drop. Corrupted JPEG", - "warn.captureProblem": "Capture source problem, assuming camera disconnected, waiting for reconnect", - "warn.serialCapture": "Serial capture source problem, assuming camera disconnected, waiting for reconnect", - "warn.backpressure1": "CAPTURE QUEUE BACKPRESSURE OF", - "warn.backpressure2": "CHECK FOR CRASH OR TIMING ISSUES IN ALGORITHM", - "warn.oneEuroValues": "OneEuroFilter values must be a legal number", - "info.moveToTrackingMode": "Moving to tracking mode", - "info.moveToROIMode": "Moving to ROI mode", - "info.setROI": "Set ROI", - "info.enabled": "Enabled", - "info.disabled": "Disabled", - "info.newValue": "New value", - "info.discardingSerial": "Discarding the serial buffer", - "info.refreshedCameraList": "Refreshed Camera List", - "info.ETVRConnected": "ETVR Serial Tracker device connected on", - "info.ETVRFailiure": "Failed to connect on", - "info.enterCaptureOne": "Capture source", - "info.enterCaptureTwo": "not found, retrying...", - "info.exitCaptureThread": "Exiting capture thread", - "info.exitTrackingThread": "Exiting tracking thread", - "info.serialCapture": "Failed to get serial picture", - "log.info": "INFO", - "log.warn": "WARN", - "log.error": "ERROR", - "algorithm.header": "Model Settings", - "algorithm.modelFile": "Model file", - "algorithm.modelFileTooptip": "Name of the model file", - "algorithm.inferenceThreads": "Inference Threads", - "algorithm.inferenceThreadsTooltip": "How many threads to use for processing the model", - "algorithm.runtime": "Runtime", - "algorithm.runtimeTooltip": "", - "algorithm.GPUIndex": "GPU Index", - "algorithm.GPUIndexTooltip": "Select which device to run inference", - "algorithm.useGPU": "Use GPU", - "algorithm.useGPUTooltip": "Toggle GPU execution", - "algorithm.modelOutputMultiplier": "Model output multiplier", - "algorithm.modelOutputMultiplierTooltip": "Model output modifier", - "algorithm.calibrationDeadzone": "Calibration Deadzone", - "algorithm.calibrationDeadzoneTooltip": "Offset the minimum calibrated values", - "algorithm.oneEuroFilterParameters": "One Euro Filter Parameters", - "algorithm.minFrequencyCutoff": "Min Frequency Cutoff", - "algorithm.minFrequencyCutoffTooltip": "", - "algorithm.speedCoefficient": "Speed Coefficient", - "algorithm.speedCoefficientTooltip": "", - "camera.selectEntireFrame": "Select Entire Frame", - "camera.selectEntireFrameTooltip": "Automatically set ROI", - "camera.rotation": "Rotation", - "camera.rotationTooltip": "Adjust the rotation of your cameras, make them level", - "camera.startCalibration": "Start Calibration", - "camera.startCalibrationTooltip": "Neutural Calibration: Hold a relaxed face, press [Start Calibration] and then press [Stop Calibraion]. \nFull Calibration: Press [Start Calibration] and make as many face movements as you can until it switches back to tracking mode or press [Stop Calibration]", - "camera.stopCalibration": "Stop Calibration", - "camera.stopCalibrationTooltip": "Stop calibration manually", - "camera.enableCalibration": "Enable Calibration", - "camera.enableCalibrationTooltip": "Checked = Calibrated model output. Unchecked = Raw model output", - "camera.mode": "Mode", - "camera.calibrating": "Calibration", - "camera.verticalFlip": "Vertical Flip", - "camera.verticalFlipTooltip": "Vertically flip camera feed", - "camera.horizontalFlip": "Horizontal Flip", - "camera.horizontalFlipTooltip": "Horizontally flip camera feed", - "camera.crop": "Please set a Crop", - "camera.cameraAddress": "Camera Address", - "camera.cameraAddressTooltip": "Enter the IP address or UVC port of your camera. (Include the 'http://')", - "camera.refreshCameraList": "Refresh List", - "camera.saveAndRestartTracking": "Save and Restart Tracking", - "camera.trackingMode": "Tracking Mode", - "camera.trackingModeTooltip": "Go here to track your mouth", - "camera.croppingMode": "Cropping Mode", - "camera.croppingModeToolTip": "Go here to crop out your mouth", - "camera.waiting": "Waiting for camera address", - "camera.connecting": "Camera Connecting", - "camera.reconnecting": "Camera Reconnecting", - "camera.waitingOnMouthCrop": "Awating Mouth Crop", - "camera.calibration": "Calibration", - "camera.tracking": "Tracking", - "config.noSettingsFile": "No settings file, using base settings", - "config.failedToLoadSettings": "Failed to load settings file", - "config.usingBackupSettings": "Using backup settings", - "config.usingBaseSettings": "Using base settings", - "config.saved": "Config saved successfully", - "babble.latestVersion": "App is the latest version", - "babble.needUpdateOne": "You have app version", - "babble.needUpdateTwo": "installed. Please update to", - "babble.needUpdateThree": "for the newest features", - "babble.name": "Babble App", - "babble.noInternet": "Internet connection failed, no update check occured", - "babble.camPage": "Cam", - "babble.settingsPage": "Settings", - "babble.algoSettingsPage": "Algo Settings", - "babble.calibrationPage": "Calibration", - "babble.exit": "Exiting Babble App", - "babble.invalidVersionFormat": "Invalid version format received from GitHub API.", - "babble.updateTimeout": "Timeout occurred while checking for updates.", - "babble.updateHttpError": "HTTP error occurred while checking for updates.", - "babble.updateCheckFailed": "Failed to check for updates due to an unexpected error.", - "calibration.header": "Calibration Settings", - "calibration.mode": "Calibration Mode", - "calibration.modeTooltip": "Neutral = Only Min values are set when starting and stopping calibration. Full = Min and Max values are set based on recorded values when starting calibration.", - "calibration.left": "Left", - "calibration.shape": "Shape", - "calibration.right": "Right", - "calibration.center": "Center", - "calibration.min": "Min", - "calibration.max": "Max", - "calibration.resetMin": "Reset Min", - "calibration.resetMinTooltip": "Reset minimum values", - "calibration.resetMax": "Reset Max", - "calibration.resetMaxTooltip": "Reset maximum values", - "calibration.minLeftValue": "Min Left Value", - "calibration.maxLeftValue": "Max Left Value", - "calibration.minRightValue": "Min Right Value", - "calibration.maxRightValue": "Max Right Value", - "general.theme": "Theme", - "general.theme.system": "System", - "general.theme.light": "Light", - "general.theme.dark": "Dark", - "general.useOSCQuery": "Use OSCQuery", - "general.windowFocus": "Window Focused", - "general.disableCameraPreview": "Disable camera preview (everywhere)", - "general.oscDelayEnable": "Enable OSC delay", - "general.oscDelaySeconds": "OSC delay in seconds" + "general.header": "Algemene Instellings", + "general.checkForUpdates": "Kyk Vir Opdaterings", + "general.toolTip": "Wissel opdateringkontrole by opstart", + "general.logging": "Aktiveer Logboek", + "general.loggingTooltip": "Stoor logboeklêer vir ontfouting. (Herbegin nodig)", + "general.oscSettings": "OSC Instellings", + "general.locationPrefix": "Lokasie Voorvoegsel", + "general.locationTooltip": "Voorvoegsel vir OSC-adres", + "general.address": "Adres", + "general.addressTooltip": "IP-adres waarna ons OSC-data stuur", + "general.port": "Poort", + "general.portTooltip": "OSC-poort waarna ons data stuur", + "general.receiver": "Ontvang funksies", + "general.receiverTooltip": "Wissel OSC-ontvangfunksies", + "general.receiverPort": "Ontvanger Poort", + "general.receiverPortTooltip": "Poort waarvandaan ons OSC-data ontvang (word gebruik om binne VRChat te herkalibreer)", + "general.recalibrate": "Herkalibreer Adres", + "general.recalibrateTooltip": "OSC-adres wat ons gebruik vir herkalibrering", + "general.uvcCameraSettings": "UVC Kamera Instellings", + "general.useRedChannel": "Gebruik Rooi Kanaal", + "general.useRedChannelTooltip": "Gebruik slegs die rooi kanaal vir Omnicept-opname", + "general.xResolution": "X Resolusie", + "general.xResolutionTooltip": "X opname resolusie. Verstek = 0", + "general.yResolution": "Y Resolusie", + "general.yResolutionTooltip": "Y opname resolusie. Verstek = 0", + "general.framerate": "Raamtempo", + "general.framerateTooltip": "Opname raamtempo. Verstek = 0", + "general.language": "Taalinstellings", + "general.languageInstructions": "Herbegin die Babble-toepassing om jou veranderinge te sien", + "general.languageTooltip": "Verander die taal", + "error.oscPort": "OSC-poortwaarde moet 'n heelgetal 0-65535 wees", + "error.oscValue": "OSC-poortwaarde mag nie leeg wees nie en moet 'n heelgetal 0-65535 wees", + "error.notAnInt": "Nie 'n Heelgetal nie", + "error.notAFloat": "Nie 'n Kommagetal nie", + "error.improperTabValue": "Verkeerde tab-waarde", + "error.frame": "Probleem tydens die verkryging van raam", + "error.size": "Grootte van rame om te vertoon is van ongelyke groottes", + "error.capture": "Raamopname probleem opgespoor", + "error.modelLoad": "Kon nie laai nie", + "warn.frameDrop": "Raam laat val. Beskadigde JPEG", + "warn.captureProblem": "Opnamebron probleem, aanvaar kamera is ontkoppel, wag vir herkoppeling", + "warn.serialCapture": "Seriële opnamebron probleem, aanvaar kamera is ontkoppel, wag vir herkoppeling", + "warn.backpressure1": "OPNAME WAGLYN TERUGDRUK VAN", + "warn.backpressure2": "KONTROLEER VIR INEENSTORTING OF TYDSBEREKINGSPROBLEME IN ALGORITME", + "warn.oneEuroValues": "OneEuroFilter-waardes moet 'n wettige getal wees", + "info.moveToTrackingMode": "Beweeg na nasporingsmodus", + "info.moveToROIMode": "Beweeg na ROI-modus", + "info.setROI": "Stel ROI", + "info.enabled": "Geaktiveer", + "info.disabled": "Gedeaktiveer", + "info.newValue": "Nuwe waarde", + "info.discardingSerial": "Weggooi van die seriële buffer", + "info.refreshedCameraList": "Kamera Lys Herlaai", + "info.ETVRConnected": "ETVR Seriële Volger toestel gekoppel op", + "info.ETVRFailiure": "Kon nie koppel op nie", + "info.enterCaptureOne": "Opnamebron", + "info.enterCaptureTwo": "nie gevind nie, probeer weer...", + "info.exitCaptureThread": "Verlaat opnamethread", + "info.exitTrackingThread": "Verlaat nasporingsthread", + "info.serialCapture": "Kon nie seriële prent kry nie", + "log.info": "INFO", + "log.warn": "WAARSKUWING", + "log.error": "FOUT", + "algorithm.header": "Model Instellings", + "algorithm.modelFile": "Modellêer", + "algorithm.modelFileTooptip": "Naam van die modellêer", + "algorithm.inferenceThreads": "Inferensie Drade", + "algorithm.inferenceThreadsTooltip": "Hoeveel drade om te gebruik vir die verwerking van die model", + "algorithm.runtime": "Runtime", + "algorithm.runtimeTooltip": "", + "algorithm.GPUIndex": "GPU Indeks", + "algorithm.GPUIndexTooltip": "Kies watter toestel om inferensie op te laat loop", + "algorithm.useGPU": "Gebruik GPU", + "algorithm.useGPUTooltip": "Wissel GPU-uitvoering", + "algorithm.modelOutputMultiplier": "Modeluitvoer vermenigvuldiger", + "algorithm.modelOutputMultiplierTooltip": "Modeluitvoer wysiger", + "algorithm.calibrationDeadzone": "Kalibrasie Dooie Sone", + "algorithm.calibrationDeadzoneTooltip": "Verreken die minimum gekalibreerde waardes", + "algorithm.oneEuroFilterParameters": "Een Euro Filter Parameters", + "algorithm.minFrequencyCutoff": "Min Frekwensie Afsny", + "algorithm.minFrequencyCutoffTooltip": "", + "algorithm.speedCoefficient": "Spoedkoëffisiënt", + "algorithm.speedCoefficientTooltip": "", + "camera.selectEntireFrame": "Selekteer Hele Raam", + "camera.selectEntireFrameTooltip": "Stel ROI outomaties", + "camera.rotation": "Rotasie", + "camera.rotationTooltip": "Verstel die rotasie van jou kameras, maak hulle gelyk", + "camera.startCalibration": "Begin Kalibrasie", + "camera.startCalibrationTooltip": "Neutrale Kalibrasie: Hou 'n ontspanne gesig, druk [Begin Kalibrasie] en druk dan [Stop Kalibrasie].\nVolle Kalibrasie: Druk [Begin Kalibrasie] en maak soveel gesigbewegings as wat jy kan totdat dit terugskakel na nasporingsmodus of druk [Stop Kalibrasie]", + "camera.stopCalibration": "Stop Kalibrasie", + "camera.stopCalibrationTooltip": "Stop kalibrasie met die hand", + "camera.enableCalibration": "Aktiveer Kalibrasie", + "camera.enableCalibrationTooltip": "Gemerk = Gekalibreerde modeluitvoer. Ongemerk = Rou modeluitvoer", + "camera.mode": "Modus", + "camera.calibrating": "Kalibrasie", + "camera.verticalFlip": "Vertikale Omkeer", + "camera.verticalFlipTooltip": "Draai kamera-voer vertikaal om", + "camera.horizontalFlip": "Horisontale Omkeer", + "camera.horizontalFlipTooltip": "Draai kamera-voer horisontaal om", + "camera.crop": "Stel asseblief 'n Sny", + "camera.cameraAddress": "Kamera Adres", + "camera.cameraAddressTooltip": "Voer die IP-adres of UVC-poort van jou kamera in. (Sluit die 'http://' in)", + "camera.refreshCameraList": "Herlaai Lys", + "camera.saveAndRestartTracking": "Stoor en Herbegin Nasporing", + "camera.trackingMode": "Nasporingsmodus", + "camera.trackingModeTooltip": "Gaan hierheen om jou mond na te spoor", + "camera.croppingMode": "Sny Modus", + "camera.croppingModeToolTip": "Gaan hierheen om jou mond uit te sny", + "camera.waiting": "Wag vir kamera-adres", + "camera.connecting": "Kamera Besig om te Koppel", + "camera.reconnecting": "Kamera Herkoppel", + "camera.waitingOnMouthCrop": "Wag op Mond Sny", + "camera.calibration": "Kalibrasie", + "camera.tracking": "Nasporing", + "config.noSettingsFile": "Geen instellingslêer nie, gebruik basisinstellings", + "config.failedToLoadSettings": "Kon nie instellingslêer laai nie", + "config.usingBackupSettings": "Gebruik rugsteuninstellings", + "config.usingBaseSettings": "Gebruik basisinstellings", + "config.saved": "Konfigurasie suksesvol gestoor", + "babble.latestVersion": "Toepassing is die nuutste weergawe", + "babble.needUpdateOne": "Jy het toepassingsweergawe", + "babble.needUpdateTwo": "geïnstalleer. Opdateer asseblief na", + "babble.needUpdateThree": "vir die nuutste funksies", + "babble.name": "Babble Toepassing", + "babble.noInternet": "Internetverbinding het misluk, geen opdateringkontrole het plaasgevind nie", + "babble.camPage": "Kamera", + "babble.settingsPage": "Instellings", + "babble.algoSettingsPage": "Algo Instellings", + "babble.calibrationPage": "Kalibrasie", + "babble.exit": "Verlaat Babble Toepassing", + "babble.invalidVersionFormat": "Ongeldige weergaweformaat ontvang vanaf GitHub API.", + "babble.updateTimeout": "Tyduitvloei het plaasgevind tydens die nagaan vir opdaterings.", + "babble.updateHttpError": "HTTP-fout het plaasgevind tydens die nagaan vir opdaterings.", + "babble.updateCheckFailed": "Kon nie vir opdaterings nagaan nie as gevolg van 'n onverwagte fout.", + "calibration.header": "Kalibrasie Instellings", + "calibration.mode": "Kalibrasie Modus", + "calibration.modeTooltip": "Neutraal = Slegs Minimum waardes word gestel wanneer kalibrasie begin en stop. Vol = Minimum en Maksimum waardes word gestel gebaseer op opgeneemde waardes wanneer kalibrasie begin.", + "calibration.left": "Links", + "calibration.shape": "Vorm", + "calibration.right": "Regs", + "calibration.center": "Middel", + "calibration.min": "Min", + "calibration.max": "Maks", + "calibration.resetMin": "Herstel Min", + "calibration.resetMinTooltip": "Herstel minimum waardes", + "calibration.resetMax": "Herstel Maks", + "calibration.resetMaxTooltip": "Herstel maksimum waardes", + "calibration.minLeftValue": "Min Linker Waarde", + "calibration.maxLeftValue": "Maks Linker Waarde", + "calibration.minRightValue": "Min Regter Waarde", + "calibration.maxRightValue": "Maks Regter Waarde", + "general.theme": "Tema", + "general.theme.system": "Stelsel", + "general.theme.light": "Lig", + "general.theme.dark": "Donker", + "general.useOSCQuery": "Gebruik OSCQuery", + "general.windowFocus": "Venster Gefokus", + "general.disableCameraPreview": "Deaktiveer kamera voorskou (oral)", + "general.oscDelayEnable": "Aktiveer OSC-vertraging", + "general.oscDelaySeconds": "OSC-vertraging in sekondes" } \ No newline at end of file diff --git a/BabbleApp/Locale/Dansk/locale.json b/BabbleApp/Locale/Dansk/locale.json index cf40baf..81008a6 100644 --- a/BabbleApp/Locale/Dansk/locale.json +++ b/BabbleApp/Locale/Dansk/locale.json @@ -37,6 +37,7 @@ "error.frame": "Problem while getting frame", "error.size": "Size of frames to display are of unequal sizes", "error.capture": "Frame capture issue detected", + "error.modelLoad": "Kunne ikke indlæse", "warn.frameDrop": "Frame drop. Corrupted JPEG", "warn.captureProblem": "Capture source problem, assuming camera disconnected, waiting for reconnect", "warn.serialCapture": "Serial capture source problem, assuming camera disconnected, waiting for reconnect", diff --git a/BabbleApp/Locale/Deutsch/locale.json b/BabbleApp/Locale/Deutsch/locale.json index 4cd6734..09f9388 100644 --- a/BabbleApp/Locale/Deutsch/locale.json +++ b/BabbleApp/Locale/Deutsch/locale.json @@ -37,6 +37,7 @@ "error.frame": "Problem beim Abrufen des Bildes", "error.size": "Die Größe der anzuzeigenden Frames ist ungleich", "error.capture": "Problem bei der Bilderfassung erkannt", + "error.modelLoad": "Fehler beim Laden", "warn.frameDrop": "Frame-Drop. Beschädigtes JPEG", "warn.captureProblem": "Problem mit der Aufnahmequelle. Kamera wurde getrennt, warte auf erneute Verbindung", "warn.serialCapture": "Problem mit der seriellen Aufnahmequelle. Kamera wurde getrennt, warte auf erneute Verbindung", diff --git a/BabbleApp/Locale/English/locale.json b/BabbleApp/Locale/English/locale.json index fae9d91..a42f117 100644 --- a/BabbleApp/Locale/English/locale.json +++ b/BabbleApp/Locale/English/locale.json @@ -37,6 +37,7 @@ "error.frame": "Problem while getting frame", "error.size": "Size of frames to display are of unequal sizes", "error.capture": "Frame capture issue detected", + "error.modelLoad": "Failed to load", "warn.frameDrop": "Frame drop. Corrupted JPEG", "warn.captureProblem": "Capture source problem, assuming camera disconnected, waiting to reconnect", "warn.serialCapture": "Serial capture source problem, assuming camera disconnected, waiting to reconnect", diff --git "a/BabbleApp/Locale/Espa\303\261ol/locale.json" "b/BabbleApp/Locale/Espa\303\261ol/locale.json" index d7d3df2..dc335f4 100644 --- "a/BabbleApp/Locale/Espa\303\261ol/locale.json" +++ "b/BabbleApp/Locale/Espa\303\261ol/locale.json" @@ -37,6 +37,7 @@ "error.frame": "Problema al obtener fotogramas", "error.size": "Los tamaños de los fotogramas para mostrar son de dimensiones desiguales", "error.capture": "Detectado problema en la captura de fotogramas", + "error.modelLoad": "Error al cargar", "warn.frameDrop": "Pérdida de fotogramas. JPEG dañado", "warn.captureProblem": "Problema con la fuente de captura, se asume que la cámara está desconectada, esperando reconexión", "warn.serialCapture": "Problema con la fuente de captura en serie, se asume que la cámara está desconectada, esperando reconexión", diff --git "a/BabbleApp/Locale/Fran\303\247aise/locale.json" "b/BabbleApp/Locale/Fran\303\247aise/locale.json" index 9ea8667..55edbf8 100644 --- "a/BabbleApp/Locale/Fran\303\247aise/locale.json" +++ "b/BabbleApp/Locale/Fran\303\247aise/locale.json" @@ -36,7 +36,8 @@ "error.improperTabValue": "", "error.frame": "Problème lors de récupération des images", "error.size": "La taille des images à afficher est inégale", - "error.capture": "", + "error.capture": "Problème de capture d'image détecté", + "error.modelLoad": "Échec du chargement", "warn.frameDrop": "Perte d'image. JPEG corrompu", "warn.captureProblem": "Problème de source de capture, la caméra doit être déconnectée ou en attente de reconnexion", "warn.serialCapture": "", diff --git a/BabbleApp/Locale/Indonesian/locale.json b/BabbleApp/Locale/Indonesian/locale.json index bd0e2c9..6c81d9d 100644 --- a/BabbleApp/Locale/Indonesian/locale.json +++ b/BabbleApp/Locale/Indonesian/locale.json @@ -37,6 +37,7 @@ "error.frame": "Masalah saat mendapatkan frame", "error.size": "Ukuran bingkai untuk menampilkan gambar tidak setara", "error.capture": "Terdeteksi masalah pada frame capture", + "error.modelLoad": "Gagal memuat", "warn.frameDrop": "Frame drop. JPEG korup", "warn.captureProblem": "Masalah sumber rekaman, perkiraan koneksi kamera terputus, menunggu koneksi ulang", "warn.serialCapture": "Masalah sumber serial rekaman, perkiraan koneksi kamera terputus, menunggu koneksi ulang", diff --git a/BabbleApp/Locale/Italiano/locale.json b/BabbleApp/Locale/Italiano/locale.json index e3b4c70..05911b1 100644 --- a/BabbleApp/Locale/Italiano/locale.json +++ b/BabbleApp/Locale/Italiano/locale.json @@ -37,6 +37,7 @@ "error.frame": "Problema durante l'acquisizione del fotogramma", "error.size": "Le dimensioni dei fotogrammi da visualizzare sono di dimensioni diverse", "error.capture": "Rilevato problema nella cattura del fotogramma", + "error.modelLoad": "Caricamento fallito", "warn.frameDrop": "Fotogramma perso. JPEG corrotto", "warn.captureProblem": "Problema di acquisizione sorgente, supponendo che la telecamera sia disconnessa, in attesa di riconnessione", "warn.serialCapture": "Problema di acquisizione da sorgente seriale, supponendo che la telecamera sia disconnessa, in attesa di riconnessione", diff --git a/BabbleApp/Locale/Nederlands/locale.json b/BabbleApp/Locale/Nederlands/locale.json index 2248847..2da8284 100644 --- a/BabbleApp/Locale/Nederlands/locale.json +++ b/BabbleApp/Locale/Nederlands/locale.json @@ -37,6 +37,7 @@ "error.frame": "Probleem bij het verkrijgen van beeld", "error.size": "Formaat van de frames voor weergave zijn ongelijk", "error.capture": "Probleem met frame opname gedetecteerd", + "error.modelLoad": "Laden mislukt", "warn.frameDrop": "Framedaling. Corrupte JPEG", "warn.captureProblem": "Probleem met opnamebron, verwacht losgekoppelde camera, wachten op nieuwe verbinding", "warn.serialCapture": "Probleem met serieel opname bron, verwacht losgekoppelde camera, wachten op nieuwe verbinding", diff --git a/BabbleApp/Locale/OwO/locale.json b/BabbleApp/Locale/OwO/locale.json index 5cddfd4..2263d55 100644 --- a/BabbleApp/Locale/OwO/locale.json +++ b/BabbleApp/Locale/OwO/locale.json @@ -37,6 +37,7 @@ "error.frame": "Pwobwem while getting fwame >3<", "error.size": "Size of fwames to dispway awe of uneqwuaw sizes", "error.capture": "Fwame captuwe issue detecwed ;n;", + "error.modelLoad": "Faiwed to woad", "warn.frameDrop": "Fwame dwop. Cowwupted JPEG >.<", "warn.captureProblem": "Captuwe souwce pwobwem, assuwming camewa disconnetwed, waiting fow weconnect", "warn.serialCapture": "sewiaw captuwe sawse pwoblem, asswuming camewa diwsconnected, waiting fow weconnect", diff --git a/BabbleApp/Locale/Pirate Speak/locale.json b/BabbleApp/Locale/Pirate Speak/locale.json index d04eccd..8916d54 100644 --- a/BabbleApp/Locale/Pirate Speak/locale.json +++ b/BabbleApp/Locale/Pirate Speak/locale.json @@ -37,6 +37,7 @@ "error.frame": "Problem while getting frame", "error.size": "Size of frames to display are of unequal sizes", "error.capture": "Frame capture issue detected", + "error.modelLoad": "Failed t' hoist", "warn.frameDrop": "Frame drop. Corrupted JPEG", "warn.captureProblem": "Capture source problem, assuming camera disconnected, waiting for reconnect", "warn.serialCapture": "Serial capture source problem, assuming camera disconnected, waiting for reconnect", diff --git a/BabbleApp/Locale/Polski/locale.json b/BabbleApp/Locale/Polski/locale.json index 6e1b4d7..077a718 100644 --- a/BabbleApp/Locale/Polski/locale.json +++ b/BabbleApp/Locale/Polski/locale.json @@ -37,6 +37,7 @@ "error.frame": "Problem while getting frame", "error.size": "Size of frames to display are of unequal sizes", "error.capture": "Frame capture issue detected", + "error.modelLoad": "Nie udało się załadować", "warn.frameDrop": "Frame drop. Corrupted JPEG", "warn.captureProblem": "Capture source problem, assuming camera disconnected, waiting for reconnect", "warn.serialCapture": "Serial capture source problem, assuming camera disconnected, waiting for reconnect", diff --git "a/BabbleApp/Locale/P\321\203\321\201\321\201\320\272\320\270\320\271/locale.json" "b/BabbleApp/Locale/P\321\203\321\201\321\201\320\272\320\270\320\271/locale.json" index 7c87e06..502a8a0 100644 --- "a/BabbleApp/Locale/P\321\203\321\201\321\201\320\272\320\270\320\271/locale.json" +++ "b/BabbleApp/Locale/P\321\203\321\201\321\201\320\272\320\270\320\271/locale.json" @@ -37,6 +37,7 @@ "error.frame": "Проблема при получении кадра", "error.size": "Размеры отображаемых кадров не равны", "error.capture": "Обнаружена проблема захвата кадров", + "error.modelLoad": "Ошибка загрузки", "warn.frameDrop": "Пропуск кадра. Поврежденный JPEG", "warn.captureProblem": "Проблема с источником захвата, предполагается отключение камеры, ожидается повторное подключение", "warn.serialCapture": "Проблема с последовательным источником захвата, предполагается отключение камеры, ожидается повторное подключение", diff --git a/BabbleApp/Locale/Svenska/locale.json b/BabbleApp/Locale/Svenska/locale.json index 7576d6b..5a4840a 100644 --- a/BabbleApp/Locale/Svenska/locale.json +++ b/BabbleApp/Locale/Svenska/locale.json @@ -37,6 +37,7 @@ "error.frame": "Problem vid avläsning", "error.size": "Bildrutornas storlek till displayen är ojämna", "error.capture": "Problem med bildrutsavläsningen har upptäckts", + "error.modelLoad": "Kunde inte läsa in", "warn.frameDrop": "Bildrutor tappas. Korrupt JPEG", "warn.captureProblem": "Problem med bildkälla, Antar att kameran är frånkopplad, Inväntar återkoppling", "warn.serialCapture": "Problem med serial avbildningskälla, Antar att kameran är frånkopplad, inväntar återkoppling", diff --git "a/BabbleApp/Locale/\347\256\200\344\275\223\344\270\255\346\226\207/locale.json" "b/BabbleApp/Locale/\347\256\200\344\275\223\344\270\255\346\226\207/locale.json" index 392273a..28819f6 100644 --- "a/BabbleApp/Locale/\347\256\200\344\275\223\344\270\255\346\226\207/locale.json" +++ "b/BabbleApp/Locale/\347\256\200\344\275\223\344\270\255\346\226\207/locale.json" @@ -37,6 +37,7 @@ "error.frame": "获取帧时出现问题", "error.size": "要显示的帧大小不相等", "error.capture": "检测到帧捕获问题", + "error.modelLoad": "加载失败", "warn.frameDrop": "丢弃帧:损坏的JPEG", "warn.captureProblem": "捕获源问题,假设相机已断开连接,正在等待重新连接", "warn.serialCapture": "串行捕获源问题,假设相机已断开连接,正在等待重新连接", diff --git "a/BabbleApp/Locale/\347\271\201\351\253\224\344\270\255\346\226\207/locale.json" "b/BabbleApp/Locale/\347\271\201\351\253\224\344\270\255\346\226\207/locale.json" index 9cbeb19..c650bc2 100644 --- "a/BabbleApp/Locale/\347\271\201\351\253\224\344\270\255\346\226\207/locale.json" +++ "b/BabbleApp/Locale/\347\271\201\351\253\224\344\270\255\346\226\207/locale.json" @@ -37,6 +37,7 @@ "error.frame": "取得畫面時發生問題", "error.size": "顯示畫面大小不一致", "error.capture": "偵測到畫面擷取問題", + "error.modelLoad": "載入失敗", "warn.frameDrop": "畫面遺失,JPEG 檔案損毀", "warn.captureProblem": "擷取來源問題,假設攝影機已斷線,等待重新連線", "warn.serialCapture": "序列埠擷取來源問題,假設攝影機已斷線,等待重新連線", From 35a1fe649fd4bd758bf24d89fda81e616e24af2c Mon Sep 17 00:00:00 2001 From: Rames The Generic Date: Sat, 17 May 2025 20:24:45 -0400 Subject: [PATCH 16/16] Add GPU EP options --- BabbleApp/babble_processor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BabbleApp/babble_processor.py b/BabbleApp/babble_processor.py index 6b3a595..98e957a 100644 --- a/BabbleApp/babble_processor.py +++ b/BabbleApp/babble_processor.py @@ -119,8 +119,8 @@ def __init__( self.sess = ort.InferenceSession( f"{self.default_model}/onnx/model.onnx", self.opts, - providers=[provider], - provider_options=[{"device_id": self.gpu_index}], + providers=provider, + provider_options=[{"device_id": self.gpu_index}, {"device_id": self.gpu_index}, {}], # We need a dict entry for each EP in our providers list ) self.input_name = self.sess.get_inputs()[0].name self.output_name = self.sess.get_outputs()[0].name