From 7075d341cf7e21bc3556dbede3395a30796a38ab Mon Sep 17 00:00:00 2001 From: HuangMason320 Date: Tue, 30 Dec 2025 16:52:34 +0800 Subject: [PATCH] Docs: Update README and remove update diary - Update project structure to reflect current codebase - Add Custom Model feature description - Remove update_diary.md --- README.md | 115 ++++++++++++++++++++++++------------------------ update_diary.md | 32 -------------- 2 files changed, 57 insertions(+), 90 deletions(-) delete mode 100644 update_diary.md diff --git a/README.md b/README.md index 718ddaa..616a883 100644 --- a/README.md +++ b/README.md @@ -31,66 +31,64 @@ python main.py ## 專案架構 ``` project/ -|- main.py -|- src/ - |- config.py - |- controllers/ - |- device_controllers.py - |- model_controllers.py - |- views/ - |- mainwindow.py # 主視窗邏輯 - |- utils/ - |- file_utils.py # 文件工具 - |- image_utils.py # 圖像工具 - |- services/ - |- device_service.py # 設備服務 - |- model_service.py # 模型服務 -|- models/ -|- uxui/ -|- tests/ - |- unit/ - |- integration/ +├── main.py # Application entry point +├── src/ +│ ├── config.py # Global configuration and constants +│ ├── controllers/ +│ │ ├── device_controller.py # Device connection management +│ │ ├── inference_controller.py # AI inference control +│ │ └── media_controller.py # Camera and media operations +│ ├── models/ +│ │ ├── inference_worker.py # Standard inference worker thread +│ │ ├── custom_inference_worker.py # Custom model inference worker +│ │ └── video_thread.py # Video capture thread +│ ├── views/ +│ │ ├── mainWindows.py # Main application window +│ │ ├── selection_screen.py # App selection screen +│ │ ├── login_screen.py # Login screen +│ │ ├── utilities_screen.py # Device utilities screen +│ │ └── components/ +│ │ ├── canvas_area.py # Video display canvas +│ │ ├── custom_model_block.py # Custom model upload UI +│ │ ├── device_list.py # Device list component +│ │ ├── device_popup.py # Device connection popup +│ │ ├── media_panel.py # Media control buttons +│ │ └── toolbox.py # AI toolbox component +│ ├── services/ +│ │ ├── device_service.py # Device scanning service +│ │ ├── file_service.py # File upload service +│ │ └── script_service.py # Script execution service +│ └── utils/ +│ ├── config_utils.py # Configuration utilities +│ └── image_utils.py # Image conversion utilities +├── uxui/ # UI assets (icons, images) +└── tests/ + ├── unit/ + └── integration/ ``` + +### Data Directories (in %LOCALAPPDATA%/Kneron_Academy/) ``` -upload/ - └── photos, videos, or mp3 files +upload/ # Uploaded photos, videos, or audio files utils/ - ├── config.json - ├── REAMDE.md - │── mode1/ - │ ├── model1/ - │ │ ├── script.py - │ │ ├── model_file(s) - │ │ └── config.json - │ └── model2/ - │ ├── script.py - │ ├── model_file(s) - │ └── config.json - └── mode2/ - ├── model1/ - │ ├── script.py - │ ├── model_file(s) - │ └── config.json - └── model2/ - ├── script.py - ├── model_file(s) - └── config.json -firmware\ - ├── KLXXX/ - │ ├── fw_scpu.bin - │ ├── fw_ncpu.bin - │ ├── VERSION - │ └── other files - └── KLXXX/ + ├── config.json # Global plugin configuration + └── {mode}/ + └── {model}/ + ├── script.py # Inference script + ├── config.json # Model configuration + └── *.nef # Model file(s) +firmware/ + └── {device}/ ├── fw_scpu.bin ├── fw_ncpu.bin - ├── VERSION - └── other files + └── VERSION ``` + ## 功能概述 - **Video 模式**:啟動相機持續捕捉影像,並將每一幀以 NumPy 陣列格式傳入推論模組進行即時推論。 - **Image 模式**:使用者上傳圖片後,讀取圖片並將其以 NumPy 陣列格式放入推論佇列,僅進行一次推論。 +- **Custom Model**:使用者可上傳自己的 .nef 模型和 firmware 檔案進行推論。 --- @@ -135,6 +133,7 @@ firmware\ "model": "src\\utils\\models\\fire_detection_520.nef" } ``` + ## APP 打包 目前是使用 Pyinstaller 來進行打包的動作 可以根據以下的指令進行打包 #### 下方的add-data需要根據你要包入的資料設定,最後一個則是需要把 kp 包進 exe 檔中,需要去 conda 的 env 資料夾中找對應的 kp\lib 資料夾 @@ -211,11 +210,11 @@ global config 範例如下 } ``` -## bounding boxes 格式 - ``` - { - "num_boxes": 2, - "bounding boxes": [[x1, y1, x2, y2], [x3, y3, x4, y4]], - "results": ["label1", "label2"] - } - ``` \ No newline at end of file +## Bounding Boxes 格式 +```json +{ + "num_boxes": 2, + "bounding boxes": [[x1, y1, x2, y2], [x3, y3, x4, y4]], + "results": ["label1", "label2"] +} +``` diff --git a/update_diary.md b/update_diary.md deleted file mode 100644 index 30ce266..0000000 --- a/update_diary.md +++ /dev/null @@ -1,32 +0,0 @@ -### 0410 -1. 修改 repo 中的資料, 添加 .gitignore -> 0.5 hrs -2. 準備資料 + 開會 meeting -> 2 hrs -#### total: 2 hrs ---- -### 0411 -1. 解決 yolov5s 報錯: 將 input image 調整成 1500 * 1500 之後再把結果 mapping 回原先影像大小 - ``` - Error code: 22. Description: ApiReturnCode KP_ERROR_IMAGE_RESOLUTION_TOO_SMALL_22 - ``` - -2. 修正 yolov5s 的回傳資料以符合 bounding box 顯示的格式 -3. 添加 yolov5s classname mapping 機制 -4. 添加 mutiple bounding boxes 顯示 - ``` - { - "num_boxes": 2, - "bounding boxes": [[x1, y1, x2, y2], [x3, y3, x4, y4]], - "results": ["label1", "label2"] - } - ``` -5. 更新 README.md: 添加 bounding boxes 的 return value -#### total: 3.5 hrs - -### 0415 -1. 尋找 Face detection and Face recognition's pretrained model -#### total: 1 hrs - -### 0416 -1. 將 arcface's pth model 轉換成 onnx -2. 修正 video inference return none 導致的 crash -#### total: 3 hrs \ No newline at end of file