Docs: Update README and remove update diary

- Update project structure to reflect current codebase
- Add Custom Model feature description
- Remove update_diary.md
This commit is contained in:
HuangMason320 2025-12-30 16:52:34 +08:00
parent 17deba3bdb
commit 7075d341cf
2 changed files with 57 additions and 90 deletions

115
README.md
View File

@ -31,66 +31,64 @@ python main.py
## 專案架構 ## 專案架構
``` ```
project/ project/
|- main.py ├── main.py # Application entry point
|- src/ ├── src/
|- config.py │ ├── config.py # Global configuration and constants
|- controllers/ │ ├── controllers/
|- device_controllers.py │ │ ├── device_controller.py # Device connection management
|- model_controllers.py │ │ ├── inference_controller.py # AI inference control
|- views/ │ │ └── media_controller.py # Camera and media operations
|- mainwindow.py # 主視窗邏輯 │ ├── models/
|- utils/ │ │ ├── inference_worker.py # Standard inference worker thread
|- file_utils.py # 文件工具 │ │ ├── custom_inference_worker.py # Custom model inference worker
|- image_utils.py # 圖像工具 │ │ └── video_thread.py # Video capture thread
|- services/ │ ├── views/
|- device_service.py # 設備服務 │ │ ├── mainWindows.py # Main application window
|- model_service.py # 模型服務 │ │ ├── selection_screen.py # App selection screen
|- models/ │ │ ├── login_screen.py # Login screen
|- uxui/ │ │ ├── utilities_screen.py # Device utilities screen
|- tests/ │ │ └── components/
|- unit/ │ │ ├── canvas_area.py # Video display canvas
|- integration/ │ │ ├── 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/ upload/ # Uploaded photos, videos, or audio files
└── photos, videos, or mp3 files
utils/ utils/
├── config.json ├── config.json # Global plugin configuration
├── REAMDE.md └── {mode}/
│── mode1/ └── {model}/
│ ├── model1/ ├── script.py # Inference script
│ │ ├── script.py ├── config.json # Model configuration
│ │ ├── model_file(s) └── *.nef # Model file(s)
│ │ └── config.json firmware/
│ └── model2/ └── {device}/
│ ├── 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/
├── fw_scpu.bin ├── fw_scpu.bin
├── fw_ncpu.bin ├── fw_ncpu.bin
├── VERSION └── VERSION
└── other files
``` ```
## 功能概述 ## 功能概述
- **Video 模式**:啟動相機持續捕捉影像,並將每一幀以 NumPy 陣列格式傳入推論模組進行即時推論。 - **Video 模式**:啟動相機持續捕捉影像,並將每一幀以 NumPy 陣列格式傳入推論模組進行即時推論。
- **Image 模式**:使用者上傳圖片後,讀取圖片並將其以 NumPy 陣列格式放入推論佇列,僅進行一次推論。 - **Image 模式**:使用者上傳圖片後,讀取圖片並將其以 NumPy 陣列格式放入推論佇列,僅進行一次推論。
- **Custom Model**:使用者可上傳自己的 .nef 模型和 firmware 檔案進行推論。
--- ---
@ -135,6 +133,7 @@ firmware\
"model": "src\\utils\\models\\fire_detection_520.nef" "model": "src\\utils\\models\\fire_detection_520.nef"
} }
``` ```
## APP 打包 ## APP 打包
目前是使用 Pyinstaller 來進行打包的動作 可以根據以下的指令進行打包 目前是使用 Pyinstaller 來進行打包的動作 可以根據以下的指令進行打包
#### 下方的add-data需要根據你要包入的資料設定最後一個則是需要把 kp 包進 exe 檔中,需要去 conda 的 env 資料夾中找對應的 kp\lib 資料夾 #### 下方的add-data需要根據你要包入的資料設定最後一個則是需要把 kp 包進 exe 檔中,需要去 conda 的 env 資料夾中找對應的 kp\lib 資料夾
@ -211,11 +210,11 @@ global config 範例如下
} }
``` ```
## bounding boxes 格式 ## Bounding Boxes 格式
``` ```json
{ {
"num_boxes": 2, "num_boxes": 2,
"bounding boxes": [[x1, y1, x2, y2], [x3, y3, x4, y4]], "bounding boxes": [[x1, y1, x2, y2], [x3, y3, x4, y4]],
"results": ["label1", "label2"] "results": ["label1", "label2"]
} }
``` ```

View File

@ -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