# Full Tutorial: From Video to Results This tutorial walks through the complete DRerio LogAI workflow: creating a project with the wizard, configuring arenas/ROIs, running detections, and generating reports. --- ## Step 1 · Launch the wizard 1. Open a terminal in the project root and run `poetry run zebtrack`. 2. Click **"Create Project"**. The wizard opens automatically (step count varies by project type — see [`docs/tutorials/first_tracking_run.md`](https://github.com/MarkSant/DRerio-LogAI/blob/main/docs/tutorials/first_tracking_run.md) for the full walkthrough). 3. Follow the discovery step: - Choose **Experimental**, **Exploratory**, or **Live** mode. - Tell the wizard whether you want to reuse existing Parquet files (arena/ROIs/trajectory). 4. In step 2, add videos or folders. The preview tree summarizes the detected structure. 5. Step 3 analyses the folder structure and proposes groups/days/subjects. Adjust the regex live if something looks off. 6. Step 4 (Import Configuration) lets you decide per video what to do: - `SKIP` when all Parquets are present. - `IMPORT_ZONES` to reuse arena/ROIs but regenerate trajectories. - `PARTIAL` to reuse only the arena. - `FULL` when nothing should be imported. 7. 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.md` for screenshots of every step. --- ## Step 2 · Configure arenas and ROIs 1. Go to the **"Zone Configuration"** tab. 2. Use **Detect Aquarium (Auto)** or draw the main arena manually. 3. 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. 4. 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. 5. 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. --- ## Step 3 · Tune detector settings 1. Open the **Advanced Settings** tab to review `config.local.yaml` in-app. The editor validates values in real time using the Pydantic schema. 2. Configure detector thresholds (confidence/NMS), choose between YOLO and OpenVINO weights, and enable optional features like the UI event queue or Arduino integration. 3. Switch back to the main tab and pick the detector plugin you want to run. --- ## Step 4 · Process videos (or record new ones) ### Pre-recorded projects 1. In **Main Control**, click **"Add Videos/Folders to the Project..."**. 2. Confirm the wizard’s processing plan. DRerio LogAI handles detection → tracking → analysis automatically. 3. 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). ### Live projects 1. Use the **Experiment Progress** grid to select the subject/day. 2. Configure countdowns or fixed durations if desired. 3. Start the session from **Main Control**. Video recording and analysis happen in one pass. --- ## Step 5 · Review results and export reports 1. Open the **Processing and Reports** tab once processing finishes. 2. Select specific videos or use **📚 Unified Report (All)** for an aggregated summary. 3. 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). 4. Each processed video also receives a `