docs: 添加 Places365 安裝指南和測試腳本

新增:
- docs_v1.0/IMPLEMENTATION/PLACES365_INSTALLATION.md
- scripts/test_places365_scene.py

功能:
-  Places365 380 個場景類別載入
-  場景分類器測試
-  影片場景分類測試

目前狀態:
-  基礎場景識別功能正常
- ⏳ Places365 模型可選手動安裝
- 📊 準確率 37% → 預期 85-90%
This commit is contained in:
Warren
2026-04-01 02:39:13 +08:00
parent 6d5d121d0f
commit 363d6913f9
2 changed files with 207 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
# Places365 模型安裝指南
## 概述
Places365 是一個專門用於場景識別的深度學習模型,包含 365 種場景類別。
## 目前狀態
### 已安裝 ✅
- ResNet18 ImageNet 預訓練模型 (`models/resnet18_imagenet.pth`, 44.7MB)
- Places365 類別映射 (`scripts/places365_categories.json`, 380 類)
- ImageNet 到場景映射 (`models/imagenet_to_scene.json`)
### 功能正常 ✅
- 基礎場景識別功能
- 380 個 Places365 類別支援
- PyTorch MPS 加速M4 Mac Mini 優化)
### 效能指標
| 指標 | 目前 | 預期 (Places365) |
|------|------|-----------------|
| 準確率 | 37% | 85-90% |
| 場景名稱 | scene_XXX | 實際名稱 |
| 處理速度 | ~60 FPS | ~60 FPS |
## 使用現有模型
即使沒有專門的 Places365 模型,系統仍可運作:
```bash
# 基本使用
python3 scripts/scene_classifier.py video.mp4 output.json
# 測試功能
python3 scripts/test_places365_scene.py
# 測試影片
python3 scripts/test_places365_scene.py /path/to/video.mp4
```
## 手動安裝 Places365 模型(可選)
如需提升準確率,可手動下載專門的 Places365 模型:
### 步驟 1: 下載模型
```bash
cd /Users/accusys/momentry/models
# 從 GitHub 下載
curl -L -o resnet18_places365.pth.tar \
"https://github.com/CSAILVision/places365/raw/master/resnet18_places365.pth.tar"
```
### 步驟 2: 驗證
```bash
ls -lh resnet18_places365.pth.tar
# 應該約 45MB
```
### 步驟 3: 測試
```bash
python3 scripts/test_places365_scene.py /path/to/video.mp4
```
## 參考資料
- [Places365 官方網站](http://places2.csail.mit.edu/)
- [GitHub Repository](https://github.com/CSAILVision/Places365)
## 故障排除
查看測試報告:
- `docs_v1.0/TESTING/SCENE_CLASSIFICATION_TEST_REPORT_2026_04_01.md`
- `docs_v1.0/IMPLEMENTATION/SCENE_CLASSIFICATION_MODULE.md`