Compare commits

..

3 Commits

Author SHA1 Message Date
7223120348 Update .gitignore 2026-04-08 18:03:44 +08:00
bbe3f6d125 Fix didn't import kp. 2026-04-08 18:02:49 +08:00
9765c094ac remove unuse file inference. 2026-04-08 18:00:49 +08:00
6 changed files with 35 additions and 30 deletions

4
.gitignore vendored
View File

@ -45,3 +45,7 @@ win_driver/
claude.md claude.md
src/services/__pycache__/device_service.cpython-312.pyc src/services/__pycache__/device_service.cpython-312.pyc
src/__pycache__/config.cpython-312.pyc src/__pycache__/config.cpython-312.pyc
# Autoflow Agent由 autoflow-agent init 自動產生)
.claude/
.autoflow/CLAUDE.md.backup.*

52
env.txt
View File

@ -2,16 +2,16 @@ absl-py==2.2.2
altgraph==0.17.4 altgraph==0.17.4
astunparse==1.6.3 astunparse==1.6.3
audioread==3.0.1 audioread==3.0.1
Brotli @ file:///C:/b/abs_3d36mno480/croot/brotli-split_1714483178642/work Brotli
certifi @ file:///C:/b/abs_1fw_exq1si/croot/certifi_1725551736618/work/certifi certifi
cffi==1.17.1 cffi==1.17.1
charset-normalizer @ file:///croot/charset-normalizer_1721748349566/work charset-normalizer
colorama==0.4.6 colorama==0.4.6
coloredlogs==15.0.1 coloredlogs==15.0.1
contourpy==1.3.0 contourpy==1.3.0
cycler==0.12.1 cycler==0.12.1
decorator==5.1.1 decorator==5.1.1
filelock @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/filelock_1701807523603/work filelock
flatbuffers==24.3.25 flatbuffers==24.3.25
fonttools==4.54.1 fonttools==4.54.1
fsspec==2025.3.2 fsspec==2025.3.2
@ -20,12 +20,12 @@ google-pasta==0.2.0
grpcio==1.71.0 grpcio==1.71.0
h5py==3.13.0 h5py==3.13.0
humanfriendly==10.0 humanfriendly==10.0
idna @ file:///C:/b/abs_aad84bnnw5/croot/idna_1714398896795/work idna
Jinja2 @ file:///C:/b/abs_92fccttino/croot/jinja2_1716993447201/work Jinja2
joblib==1.4.2 joblib==1.4.2
keras==3.9.2 keras
kiwisolver==1.4.7 kiwisolver
KneronPLUS @ file:///C:/Users/mason/Downloads/kneron_plus_v3.1.1/kneron_plus/python/package/windows/KneronPLUS-3.1.1-py3-none-any.whl#sha256=d31be87c9e565cab5590859c8a1ae6fabf96e7e153ad464442d1f613c29c1235 KneronPLUS @ file:///C:/Users/sungs/Downloads/kneron_plus_v3.1.2/kneron_plus/python/package/windows/KneronPLUS-3.1.2-py3-none-any.whl#sha256=826c6765c4b05080ddb39a6a3144021364fb19a12fbe160c4a31141de30063a8
lazy_loader==0.4 lazy_loader==0.4
libclang==18.1.1 libclang==18.1.1
librosa==0.10.2.post1 librosa==0.10.2.post1
@ -33,21 +33,21 @@ llvmlite==0.43.0
lz4==4.4.4 lz4==4.4.4
Markdown==3.8 Markdown==3.8
markdown-it-py==3.0.0 markdown-it-py==3.0.0
MarkupSafe @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/markupsafe_1707425732791/work MarkupSafe
matplotlib==3.9.2 matplotlib
mdurl==0.1.2 mdurl==0.1.2
mkl-service==2.4.0 mkl-service
mkl_fft @ file:///C:/b/abs_f55mv94vyg/croot/mkl_fft_1725370278455/work mkl_fft
mkl_random @ file:///C:/b/abs_21ydbzdu8d/croot/mkl_random_1725370276095/work mkl_random
ml_dtypes==0.5.1 ml_dtypes==0.5.1
mpmath @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/mpmath_1699484863771/work mpmath
msgpack==1.1.0 msgpack==1.1.0
mtcnn==1.0.0 mtcnn==1.0.0
namex==0.0.9 namex==0.0.9
networkx @ file:///C:/b/abs_3bxnu56g9d/croot/networkx_1717597507456/work networkx
Nuitka==2.6.7 Nuitka==2.6.7
numba==0.60.0 numba==0.60.0
numpy==2.1.3 numpy
onnx==1.17.0 onnx==1.17.0
onnxruntime==1.19.2 onnxruntime==1.19.2
opencv-python==4.10.0.84 opencv-python==4.10.0.84
@ -56,7 +56,7 @@ optree==0.15.0
ordered-set==4.1.0 ordered-set==4.1.0
packaging==24.1 packaging==24.1
pefile==2023.2.7 pefile==2023.2.7
pillow @ file:///C:/b/abs_32o8er3uqp/croot/pillow_1721059447598/work pillow
platformdirs==4.3.6 platformdirs==4.3.6
pooch==1.8.2 pooch==1.8.2
protobuf==5.28.2 protobuf==5.28.2
@ -72,11 +72,11 @@ PyQt5==5.15.11
PyQt5-Qt5==5.15.2 PyQt5-Qt5==5.15.2
PyQt5_sip==12.15.0 PyQt5_sip==12.15.0
pyreadline3==3.5.4 pyreadline3==3.5.4
PySocks @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/pysocks_1699473336188/work PySocks
python-dateutil==2.9.0.post0 python-dateutil==2.9.0.post0
pywin32-ctypes==0.2.3 pywin32-ctypes==0.2.3
PyYAML @ file:///C:/b/abs_14xkfs39bx/croot/pyyaml_1728657968772/work PyYAML
requests @ file:///C:/b/abs_9frifg92q2/croot/requests_1721410901096/work requests
rich==14.0.0 rich==14.0.0
scikit-learn==1.5.2 scikit-learn==1.5.2
scipy==1.14.1 scipy==1.14.1
@ -88,18 +88,18 @@ soxr==0.5.0.post1
sympy==1.13.1 sympy==1.13.1
tensorboard==2.19.0 tensorboard==2.19.0
tensorboard-data-server==0.7.2 tensorboard-data-server==0.7.2
tensorflow==2.19.0 tensorflow
termcolor==3.1.0 termcolor==3.1.0
threadpoolctl==3.5.0 threadpoolctl==3.5.0
torch==2.5.0 torch
torchaudio==2.5.0 torchaudio==2.5.0
torchvision==0.20.0 torchvision==0.20.0
tqdm==4.66.5 tqdm==4.66.5
typing_extensions @ file:///C:/b/abs_0as9mdbkfl/croot/typing_extensions_1715268906610/work typing_extensions
urllib3 @ file:///C:/b/abs_9a_f8h_bn2/croot/urllib3_1727769836930/work urllib3
utils==1.0.2 utils==1.0.2
Werkzeug==3.1.3 Werkzeug==3.1.3
wheel==0.44.0 wheel==0.44.0
win-inet-pton @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/win_inet_pton_1699472992992/work win-inet-pton
wrapt==1.17.2 wrapt==1.17.2
zstandard==0.23.0 zstandard==0.23.0

View File

@ -9,7 +9,6 @@ from PyQt5.QtWidgets import QWidget, QListWidgetItem
from PyQt5.QtGui import QPixmap, QIcon from PyQt5.QtGui import QPixmap, QIcon
from PyQt5.QtCore import Qt from PyQt5.QtCore import Qt
import os import os
import kp
from src.services.device_service import check_available_device from src.services.device_service import check_available_device
from src.config import UXUI_ASSETS, DongleModelMap, DongleIconMap, FW_DIR from src.config import UXUI_ASSETS, DongleModelMap, DongleIconMap, FW_DIR
@ -245,6 +244,7 @@ class DeviceController:
return False return False
# Connect to device # Connect to device
import kp
print('[Connecting device]') print('[Connecting device]')
self.device_group = kp.core.connect_devices(usb_port_ids=[usb_port_id]) self.device_group = kp.core.connect_devices(usb_port_ids=[usb_port_id])
print(' - Connection successful') print(' - Connection successful')
@ -279,6 +279,7 @@ class DeviceController:
""" """
if self.device_group: if self.device_group:
try: try:
import kp
print('[Disconnecting device]') print('[Disconnecting device]')
kp.core.disconnect_devices(device_group=self.device_group) kp.core.disconnect_devices(device_group=self.device_group)
print(' - Disconnected') print(' - Disconnected')

View File

@ -5,7 +5,6 @@ This module provides device scanning functionality with timeout mechanism
for detecting connected Kneron devices. for detecting connected Kneron devices.
""" """
import kp
import threading import threading
@ -22,12 +21,12 @@ class EmptyDescriptor:
self.device_descriptor_list = [] self.device_descriptor_list = []
def check_available_device(timeout=0.5): def check_available_device(timeout=5.0):
""" """
Scan for available Kneron devices with timeout mechanism. Scan for available Kneron devices with timeout mechanism.
Args: Args:
timeout (float): Timeout in seconds (default 0.5). timeout (float): Timeout in seconds (default 5.0).
Returns: Returns:
Device descriptor object containing found devices, Device descriptor object containing found devices,
@ -38,6 +37,7 @@ def check_available_device(timeout=0.5):
def scan_devices(): def scan_devices():
try: try:
import kp
result[0] = kp.core.scan_devices() result[0] = kp.core.scan_devices()
except Exception as e: except Exception as e:
error[0] = e error[0] = e