docs: describe live protocol and evaluation limits
This commit is contained in:
parent
934615b593
commit
1794640f9d
2 changed files with 13 additions and 17 deletions
|
|
@ -101,19 +101,17 @@ Bất kỳ client nào gửi được ảnh JPEG đều dùng được: điện
|
||||||
|
|
||||||
## 🛠️ Kiểm tra hệ thống (Tests)
|
## 🛠️ Kiểm tra hệ thống (Tests)
|
||||||
|
|
||||||
|
From `recognization/`, after `pip install -r requirements.lock` (or `pip install -r requirements-dev.txt`):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd code
|
YOLO_OFFLINE=1 YOLO_AUTOINSTALL=false python -m unittest discover -s code -p 'test_*.py' -v
|
||||||
YOLO_OFFLINE=1 ../.venv/bin/python -m unittest test_observe test_engine test_tracking test_live test_api -v
|
|
||||||
|
|
||||||
# Test với model thật (tải trọng số, chạy ~15s)
|
|
||||||
DORAYAKI_REAL_MODEL=1 YOLO_OFFLINE=1 ../.venv/bin/python -m unittest test_real_model -v
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
YOLO_OFFLINE=1 .venv/bin/python code/test_suite.py # bộ test gốc
|
|
||||||
.venv/bin/python code/bench_engine.py # đo tốc độ detect/classify
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Lưu ý: chạy test bằng danh sách module cụ thể, **không dùng** `unittest discover` vì sẽ import `test.py`/`fast_test.py` (script scratch với đường dẫn máy khác và cửa sổ OpenCV chặn).
|
That discovers every `code/test_*.py` module. `test_real_model` is included and skipped unless `DORAYAKI_REAL_MODEL=1` (it loads the YOLO weights). CI runs the same command from `.github/workflows/test.yml`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
YOLO_OFFLINE=1 python code/bench_engine.py # speed measurement, not part of the suite
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -145,6 +143,7 @@ code/
|
||||||
empty_shelf_detector.py, inventory.py, pipeline.py, observe.py
|
empty_shelf_detector.py, inventory.py, pipeline.py, observe.py
|
||||||
stream_client.py # client mẫu (camera / video / pan ảnh tĩnh)
|
stream_client.py # client mẫu (camera / video / pan ảnh tĩnh)
|
||||||
bench_engine.py # đo tốc độ
|
bench_engine.py # đo tốc độ
|
||||||
|
test_*.py # unittest modules (discover -s code -p 'test_*.py')
|
||||||
web/ # web client (index.html, styles.css, app.js)
|
web/ # web client (index.html, styles.css, app.js)
|
||||||
docs/API.md # tài liệu API đầy đủ
|
docs/API.md # tài liệu API đầy đủ
|
||||||
docs/design-price-tags-and-compliance.md # thiết kế OCR giá, đối chiếu, compliance, mobile
|
docs/design-price-tags-and-compliance.md # thiết kế OCR giá, đối chiếu, compliance, mobile
|
||||||
|
|
|
||||||
|
|
@ -377,12 +377,9 @@ The protocol is capture-source agnostic; an iPad/phone client needs no server ch
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd recognization/code
|
cd recognization
|
||||||
YOLO_OFFLINE=1 ../.venv/bin/python -m unittest test_observe test_engine test_tracking test_live test_api -v
|
YOLO_OFFLINE=1 YOLO_AUTOINSTALL=false python -m unittest discover -s code -p 'test_*.py' -v
|
||||||
DORAYAKI_REAL_MODEL=1 YOLO_OFFLINE=1 ../.venv/bin/python -m unittest test_real_model -v
|
|
||||||
cd .. && YOLO_OFFLINE=1 .venv/bin/python code/test_suite.py # the original CLI suite
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Run tests with an explicit module list: `unittest discover` would import
|
`test_real_model` is discovered and skipped unless `DORAYAKI_REAL_MODEL=1`.
|
||||||
`test.py`/`fast_test.py`, which are scratch scripts with hardcoded paths from another
|
CI installs `requirements.lock` and runs the same command.
|
||||||
machine and a blocking OpenCV window.
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue