-
Notifications
You must be signed in to change notification settings - Fork 0
2_Full_Tutorial
github-actions[bot] edited this page Sep 7, 2026
·
1 revision
This tutorial walks through the complete DRerio LogAI workflow: creating a project with the wizard, configuring arenas/ROIs, running detections, and generating reports.
- Open a terminal in the project root and run
poetry run zebtrack. - Click "Create Project". The wizard opens automatically (step count varies by project type — see
docs/tutorials/first_tracking_run.mdfor the full walkthrough). - Follow the discovery step:
- Choose Experimental, Exploratory, or Live mode.
- Tell the wizard whether you want to reuse existing Parquet files (arena/ROIs/trajectory).
- In step 2, add videos or folders. The preview tree summarizes the detected structure.
- Step 3 analyses the folder structure and proposes groups/days/subjects. Adjust the regex live if something looks off.
- Step 4 (Import Configuration) lets you decide per video what to do:
-
SKIPwhen all Parquets are present. -
IMPORT_ZONESto reuse arena/ROIs but regenerate trajectories. -
PARTIALto reuse only the arena. -
FULLwhen nothing should be imported.
-
- Step 5 shows a consolidated summary (design detected, processing plan, expected run time). Click Create Project to persist it.
📘 Need extra details? See
docs/guides/developer/wizard.mdfor screenshots of every step.
- Go to the "Zone Configuration" tab.
- Use Detect Aquarium (Auto) or draw the main arena manually.
- Apply previously saved templates from the ROI Templates section using the Template: combobox. Use 📂 Import and Apply File... to load templates directly from JSON files.
- Draw or edit ROIs. The editor now clamps vertices to the arena boundary and highlights clamped points (orange handles with extra circles), ensuring valid polygons.
- Save the current layout as a template with 💾 Save Current Zones so that future projects can reuse them.
🛈 When editing ROIs, the cyan snapping indicator and the handles stay within the arena boundaries, preventing accidental drags outside the valid area.
- Open the Advanced Settings tab to review
config.local.yamlin-app. The editor validates values in real time using the Pydantic schema. - Configure detector thresholds (confidence/NMS), choose between YOLO and OpenVINO weights, and enable optional features like the UI event queue or Arduino integration.
- Switch back to the main tab and pick the detector plugin you want to run.
- In Main Control, click "Add Videos/Folders to the Project...".
- Confirm the wizard’s processing plan. DRerio LogAI handles detection → tracking → analysis automatically.
- The overlay view displays:
- Current frame with bounding boxes.
- Processing statistics (total frames, processed frames, detected frames, ETA).
- The active tracking mode (multi-animal vs. single subject). The track selector locks automatically when the controller forces single-subject mode (e.g., during calibration).
- Use the Experiment Progress grid to select the subject/day.
- Configure countdowns or fixed durations if desired.
- Start the session from Main Control. Video recording and analysis happen in one pass.
- Open the Processing and Reports tab once processing finishes.
- Select specific videos or use 📚 Unified Report (All) for an aggregated summary.
- Choose the export format:
- Excel (
.xlsx) tidy tables. - CSV (
.csv) for interoperability. - Parquet (
.parquet) for analysis in pandas/R. - Word (
.docx) document with plots, ROI maps, and an event appendix (enter/exit log).
- Excel (
- Each processed video also receives a
<video>_results/folder containing raw Parquets (1_,2_,3_), diagnostic MP4 (optional), and Excel/Word outputs.
Reports now include enhanced velocity and geotaxis metrics:
| Metric | Description |
|---|---|
| Mean Speed (cm/s) | Average swimming velocity |
| Max Speed (cm/s) | Maximum instantaneous velocity |
| Median Speed (cm/s) | Median velocity (robust to outliers) |
| Geotaxis Zone 1 - Bottom (%) | Time spent in bottom zone |
| Geotaxis Zone 2 (%) | Time spent in middle zone |
📝 Note: Column names in Word reports now display with proper units (e.g., "Max Speed (cm/s)" instead of "Max Speed Cm S").
The unified report has been robustly improved:
- Identification & Metadata: Uses the current project structure (Day/Group/Subject) to populate columns, automatically fixing "Unknown" or stale metadata from old files.
-
De-duplication: Duplicate "Group" columns (e.g.
groupvsgroup_id) are automatically resolved to a single standard 'Group'. - Readable Colors: ROI Colors are displayed as human-readable names (e.g. "Red", "Dark Blue") in Excel, replacing raw RGB tuples.
- Report Management: A new "🗑️ Delete Everything" button (next to the unified-report actions) allows you to safely clear old aggregated reports. The system now automatically handles OneDrive sync locks and read-only files during deletion.
- Run
poetry run pytest -qandpoetry run ruff check .before sharing results. - Run the
tests/test_wizard*.pysuite after changing wizard templates or translations. - Keep
config.local.yamlunder version control (if it contains shared lab defaults) or document overrides in your project README. - Consult
docs/reference/operational_reference.mdfor formulas, ROI metrics, Arduino integration, and troubleshooting checklists.
You’re now ready to perform end-to-end experiments with DRerio LogAI!