mirror of
https://github.com/Project-Babble/ProjectBabble.git
synced 2026-11-20 17:11:16 -08:00
Merge pull request #66 from RamesTheGeneric/main
Fix crash on model load and version increment
This commit is contained in:
8 files changed
+27
-8
No files matched your search
@@ -37,6 +37,7 @@
|
||||
"error.size": "Size of frames to display are of unequal sizes",
|
||||
"error.capture": "Frame capture issue detected",
|
||||
"error.winmm": "Failed to load winmm",
|
||||
"error.modelLoad": "Failed to load model:",
|
||||
"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",
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"error.size": "Los tamaños de los fotogramas para mostrar son de dimensiones desiguales",
|
||||
"error.capture": "Detectado problema en la captura de fotogramas",
|
||||
"error.winmm": "Error al cargar winmm",
|
||||
"error.modelLoad": "Error al cargar Modelo:",
|
||||
"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",
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"error.size": "Size of frames to display are of unequal sizes",
|
||||
"error.capture": "Frame capture issue detected",
|
||||
"error.winmmDll": "Failed to load winmm",
|
||||
"error.modelLoad": "Failed to load model:",
|
||||
"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",
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"error.size": "Size of frames to display are of unequal sizes",
|
||||
"error.capture": "Frame capture issue detected",
|
||||
"error.winmmDll": "Failed to load winmm",
|
||||
"error.modelLoad": "Failed to load mdoel:",
|
||||
"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",
|
||||
|
||||
@@ -41,6 +41,7 @@ class AlgoSettingsWidget:
|
||||
size=(32),
|
||||
tooltip=f'{lang._instance.get_string("algorithm.modelFileTooptip")}.',
|
||||
),
|
||||
sg.FolderBrowse(),
|
||||
sg.Text(
|
||||
f'{lang._instance.get_string("algorithm.inferenceThreads")}:',
|
||||
background_color=bg_color_highlight,
|
||||
|
||||
@@ -86,6 +86,8 @@ class BabbleProcessor:
|
||||
self.runtime = self.settings.gui_runtime
|
||||
self.use_gpu = self.settings.gui_use_gpu
|
||||
self.gpu_index = self.settings.gui_gpu_index
|
||||
config_default: BabbleConfig = BabbleConfig()
|
||||
self.default_model = config_default.settings.gui_model_file
|
||||
self.output = []
|
||||
self.val_list = []
|
||||
self.calibrate_config = np.empty((1, 45))
|
||||
@@ -103,12 +105,24 @@ class BabbleProcessor:
|
||||
provider = "DmlExecutionProvider"
|
||||
else:
|
||||
provider = "CPUExecutionProvider" # Build onnxruntime to get both DML and OpenVINO
|
||||
self.sess = ort.InferenceSession(
|
||||
f"{self.model}onnx/model.onnx",
|
||||
self.opts,
|
||||
providers=[provider],
|
||||
provider_options=[{"device_id": self.gpu_index}],
|
||||
)
|
||||
try:
|
||||
self.sess = ort.InferenceSession(
|
||||
f"{self.model}/onnx/model.onnx",
|
||||
self.opts,
|
||||
providers=[provider],
|
||||
provider_options=[{"device_id": self.gpu_index}],
|
||||
)
|
||||
except: # Load default model if we can't find the specified model
|
||||
print(
|
||||
f'\033[91m[{lang._instance.get_string("log.error")}] {lang._instance.get_string("error.modelLoad")} {self.model}\033[0m'
|
||||
)
|
||||
print(f'\033[91mLoading Default model: {self.default_model}.\033[0m')
|
||||
self.sess = ort.InferenceSession(
|
||||
f"{self.default_model}/onnx/model.onnx",
|
||||
self.opts,
|
||||
providers=[provider],
|
||||
provider_options=[{"device_id": self.gpu_index}],
|
||||
)
|
||||
self.input_name = self.sess.get_inputs()[0].name
|
||||
self.output_name = self.sess.get_outputs()[0].name
|
||||
try:
|
||||
|
||||
@@ -58,7 +58,7 @@ ALGO_SETTINGS_RADIO_NAME = "-ALGOSETTINGSRADIO-"
|
||||
CALIB_SETTINGS_RADIO_NAME = "-CALIBSETTINGSRADIO-"
|
||||
|
||||
page_url = "https://github.com/SummerSigh/ProjectBabble/releases/latest"
|
||||
appversion = "Babble v2.0.6 Alpha"
|
||||
appversion = "Babble v2.1.0 Beta"
|
||||
|
||||
def timerResolution(toggle):
|
||||
if winmm != None:
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ class BabbleSettingsConfig(BaseModel):
|
||||
gui_ROSC: bool = False
|
||||
gui_osc_location: str = ""
|
||||
gui_multiply: float = 1
|
||||
gui_model_file: str = "Models/3MEFFB0E7MSE/"
|
||||
gui_model_file: str = "Models/3MEFFB0E7MSE"
|
||||
gui_runtime: str = "ONNX"
|
||||
gui_use_gpu: bool = False
|
||||
gui_gpu_index: int = 0
|
||||
|
||||
Reference in new issue
Block a user