From 891cf2a84f36a12fe27abfd0a3a5c4c6edbcebc4 Mon Sep 17 00:00:00 2001 From: yv1ing Date: Fri, 28 Mar 2025 21:59:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gui/main.py | 3 ++- gui/predict.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gui/main.py b/gui/main.py index e1bd571..103717f 100644 --- a/gui/main.py +++ b/gui/main.py @@ -27,6 +27,7 @@ def shot(target, width, height): error_ptr = lib.GetScreen(target, ctypes.byref(data), ctypes.byref(length), width, height) if error_ptr: + lib.Free(data) return None, ctypes.string_at(error_ptr).decode() else: image_bytes = ctypes.string_at(data, length.value) @@ -171,7 +172,7 @@ class MainWindow(QWidget): def solve_result(self, result): self.log_output.append(f"[INFO] Operating system version: {result}") - self.log_output.append("-" * 40) + self.log_output.append("-" * 70) def show_error(self, error_msg): self.log_output.append(f"[WARN] {error_msg}") diff --git a/gui/predict.py b/gui/predict.py index f476246..e7e6033 100644 --- a/gui/predict.py +++ b/gui/predict.py @@ -30,7 +30,7 @@ def solve(image_bytes): _result = class_labels[_predicted.item()] - print(f"\nPredicted result: {_result}") + # print(f"\nPredicted result: {_result}") return _result