organize exampels according to products

This commit is contained in:
ykcheungab
2026-08-03 15:52:15 +08:00
parent 8b2f76c76f
commit 3117ddd5b9
21 changed files with 657 additions and 365 deletions
+52 -38
View File
@@ -1,54 +1,66 @@
# Examples
Top-level demo scripts under `examples/`. Run them from the repository root.
Product-facing demos live under `examples/products/`. Shared helpers stay in
`pipeline/`, `viz/`, and `gui/`. Run commands from the repository root.
## Top-Level Files
## Product Entry Points
- `README.md` — this overview of the root-level example entry points
- `basic_pipeline.py` — basic single-sensor OpenCV demo for the compound-eye pipeline
- `plot_data.py` — single-sensor demo with OpenCV views plus PyQtGraph force charts
- `two_sensor_pipeline.py` — two-sensor multiprocessing demo for parallel acquisition / display
- `finger_pipeline.py` — minimal finger UV-unroll pipeline with optional profiling
- `finger_pipeline_3dview.py` — main finger dashboard entry point with the unified Qt UI
| Product | Entry | Default config |
|---------|-------|----------------|
| ORY-BOX | `products/ory_box/basic_pipeline.py` | `ddjx01` |
| ORY-MINI | `products/ory_mini/basic_pipeline.py` | `mini` |
| ORY-FINGER (2D) | `products/ory_finger/finger_pipeline.py` | `dd02` |
| ORY-FINGER (3D Qt) | `products/ory_finger/finger_pipeline_3dview.py` | `dd02` |
`dd02` is the stable ORY-FINGER alias and currently resolves to `dd02-ov`.
Compatibility wrappers still exist at the `examples/` root
(`basic_pipeline.py`, `finger_pipeline.py`, `finger_pipeline_3dview.py`) and
forward to the product entries above.
## Typical Usage
For the Qt dashboard:
ORY-BOX:
```bash
python examples/products/ory_box/basic_pipeline.py -v 0 -c ddjx01
```
ORY-MINI:
```bash
python examples/products/ory_mini/basic_pipeline.py -v 0 -c mini
```
ORY-FINGER 2D:
```bash
python examples/products/ory_finger/finger_pipeline.py --camera_id 0 --config dd02
```
ORY-FINGER video file:
```bash
python examples/products/ory_finger/finger_pipeline.py --video ./data/sample.mp4 --config dd02
```
ORY-FINGER 3D Qt dashboard:
```bash
pip install -e ".[gui]"
python examples/finger_pipeline_3dview.py --video 0 --config ./config/dd02-ov.json
python examples/products/ory_finger/finger_pipeline_3dview.py --video 0 --config dd02
```
For the minimal finger pipeline:
## Other Root Examples
```bash
python examples/finger_pipeline.py --camera_id 0 --config ./config/dd02-ov.json
```
For the minimal finger pipeline with profiling:
```bash
python examples/finger_pipeline.py --camera_id 0 --config ./config/dd02-ov.json --profile --profile-every 30
```
For a video-file finger run:
```bash
python examples/finger_pipeline.py --video ./data/sample.mp4 --config ./config/dd02-ov.json
```
For the basic compound-eye pipeline:
```bash
python examples/basic_pipeline.py -v 0 -c ./config/ddjx01.json
```
- `plot_data.py` — single-sensor OpenCV views plus PyQtGraph force charts
- `two_sensor_pipeline.py` — two-sensor multiprocessing demo
## Requirements
- SDK installed from the repository root, for example `pip install -e .`
- camera index or test video path
- matching config files under `./config/`
- matching config names under `./config/` (or packaged `orisys/configs/`)
Qt / PyQtGraph examples additionally require:
@@ -58,8 +70,10 @@ pip install -e ".[gui]"
## Notes
- `finger_pipeline_3dview.py` is the main interactive demo. It uses `gui/app_paths.py` so the same entry point works in editable and packaged runs.
- Dashboard controls: click **启动** to start acquisition; use **Record CSV / Stop CSV** and the CSV save-directory browser to log contact/force data; `Q` quits, `R` resets, `S` starts video recording, `E` stops video recording, and `Esc` toggles fullscreen.
- `finger_pipeline.py` is the leanest finger example if you want to validate UV unroll + force/contact processing without the full dashboard.
- `finger_pipeline.py` uses `orisys.finger.FingerRuntime` as the high-level entry point, then runs tactile analysis through `runtime.tactile`.
- In `--profile` mode, the example splits the loop into capture, UV unroll, deformation, contact, and display stages so you can measure each step separately.
- `products/ory_finger/finger_pipeline_3dview.py` is the main interactive finger demo.
It uses `gui/app_paths.py` so the same entry works in editable and packaged runs.
- Dashboard controls: click **启动** to start acquisition; use **Record CSV / Stop CSV**
and the CSV save-directory browser to log contact/force data; `Q` quits, `R` resets,
`S` starts video recording, `E` stops video recording, and `Esc` toggles fullscreen.
- `products/ory_finger/finger_pipeline.py` is the leanest finger example if you want to
validate UV unroll + force/contact processing without the full dashboard.