Skip to content

Releases: MarkSant/PyZebArdYolo

PyZebArdYolo 1.3.2

Choose a tag to compare

@MarkSant MarkSant released this 16 Oct 04:08

Corrects the imaging scale used to express localization errors in millimetres.
No change to the acquisition software, firmware, data or any result reported in pixels.

Fixed

  • Imaging scale corrected from 1.24 to 2.39 px/mm (1 px ≈ 0.42 mm). The previous value
    assumed a 560-mm arena; the internal length of the arena is 350 mm (hardware/arena/).
    Only the millimetre equivalents change (median radial error of PyZebArdYolo ≈ 4.2 mm).
    Updated in validation/analysis/03_agreement_summary.py, validation/README.md and
    validation/analysis/results/localization_summary.csv.

Changed

  • validation/analysis/02_mixed_model.R also reports the variance components of the
    method-comparison model (results/mixed_model.txt).
  • Version metadata (CITATION.cff, pyproject.toml) set to 1.3.2.

PyZebArdYolo 1.3.1

Choose a tag to compare

@MarkSant MarkSant released this 02 Oct 20:19

Adds the script that produces the supplementary values reported in the paper. No change to the acquisition software, firmware, data or previously published results.

Added

  • validation/analysis/05_sensitivity_checks.py: pairing-offset sensitivity analysis (pairs at most 4 frames apart vs. 5-15 frames apart), decision cadence of the live-recorded validation tracks (336 ms), expected boundary-to-cue latency for that cadence (estimate, ~260 ms) and manual-annotation times. Outputs results/pairing_sensitivity.csv and results/sensitivity_report.txt.

Changed

  • validation/README.md documents the new script and the provenance of the PyZebArdYolo tracks.
  • Version metadata (CITATION.cff, pyproject.toml) set to 1.3.1.

PyZebArdYolo 1.3.0

Choose a tag to compare

@MarkSant MarkSant released this 02 Oct 00:14

Release accompanying the submission of the PyZebArdYolo paper (Journal of
Neuroscience Methods). No change to the acquisition software or firmware.

Added

  • latency/: logs of the two closed-loop latency sessions (lat1_1, lat1_2), the
    optical read-out script, the summary script that produces every latency value of
    the paper, integrity checks and Figure 9 (vector PDF). The session videos are
    archived separately on Zenodo (https://doi.org/10.5281/zenodo.23092482).
  • validation/analysis/agreement_stats.py: single implementation of ICC(A,1) with
    the exact McGraw & Wong 95% CI, Bland–Altman and proportional-bias statistics.
  • validation/analysis/03_agreement_summary.py: pooled Table 1, Table 2 diagnostics
    (% within LoA, proportional-bias slope, Breusch–Pagan), % of frames within 20/30 px,
    metric conversion and recall summary.
  • validation/analysis/04_figures.py: Figures 6–8 as vector PDF and 600-dpi PNG.
  • LICENSES/: full texts of MIT, AGPL-3.0, CERN-OHL-S-2.0 and CC-BY-4.0.

Changed

  • 01_pairing_metrics.py uses agreement_stats.py (exact CIs at full precision
    instead of pingouin's two-decimal CIs); NaN rows no longer propagate into ICCs.
  • Results regenerated: summary_pooled.csv (exact CIs), metrics_per_video.csv
    (CEST_Dia5 no longer NaN), recall.csv, icc_per_video_*.csv, mixed_model.txt
    and the paired coordinates, all regenerated from the current annotation files
    (the previous paired files of CEST_Dia5 contained one empty pair from an empty
    manual row; N is now 4114 for PyZebArdYolo and 4200 for ZebTrack).
  • READMEs, CITATION.cff (new paper title, authors, journal, concept DOI) and
    version metadata updated.

Removed

  • Note about the unrelated DRerio LogAI software and its INPI registration
    (README, NOTICE §0): it does not concern this repository.

Session videos of the latency measurements: https://doi.org/10.5281/zenodo.23092482

1.2.0 — Trustworthy closed-loop latency measurement

Choose a tag to compare

@MarkSant MarkSant released this 08 Aug 21:33

Latency data recorded with earlier versions is not valid. The timing columns written before 1.2.0 were an instrumentation artefact, not a measurement. Optical validation showed the software log understating real physical latency by 2.8x (411 ms real vs 148 ms logged). Sessions recorded before this release should be re-measured, not reanalysed.

Why this release exists

A statistical audit of latency_log.csv showed the file could not be describing physical events:

  • 346 of 354 rows had a sub-millisecond serial round trip — impossible at 9600 baud
  • the end-to-end column was near-uniform over exactly one frame interval
  • the serial leg correlated negatively with the total

Every cause was confirmed in code and fixed. Two live-mode freezes surfaced while validating the result on the rig and are fixed here too.

Fixed — instrumentation

  • Acknowledgements read one command late. The serial input buffer was drained after the read instead of before the write, so from the second trigger onward readline returned the previous command's ACK, already buffered. Root cause of the 346 impossible rows.
  • End-to-end timestamp referred to the wrong frame. It came from a module-level global overwritten by the free-running camera reader on every cap.read(), including frames never consumed. The capture timestamp now travels with the frame.
  • Every command logged as a nack. The code required the reply "OK"; the firmware sends "Red LED 1 ON". Commands were recorded as failures despite the LED firing.
  • Videos stamped with the wrong frame rate. The configured 30 fps was written into a ~39 fps stream. The container now carries the measured rate.
  • Session teardown raced concurrent logging. Counters could be snapshotted mid-increment and a writer holding the session handle could write to a closed file, leaving the metadata sidecar disagreeing with the CSVs.

Fixed — live-mode freezes

  • Preview wedged the analysis thread. cv2.imshow/waitKey ran on a worker thread while Tk owned the main thread; the two Win32 message loops can attach and waitKey never returns. Preview now renders through Tk, throttled and downscaled, dropping frames rather than blocking.
  • A stalled serial write froze everything. The port was opened without write_timeout, which on Windows means an unbounded wait. One stalled write blocked detection, preview and recording for 60 s. write_timeout is now set, and serial I/O runs on its own thread, so a stalled port costs counted trigger drops instead of a frozen application.
  • Thread joins are bounded and name the offending thread; the live loops log exceptions instead of dying silently.

Added

  • Per-session latency files, written into the recording folder: 6_Latency_<base>.csv (one row per trigger, with capture/decision/send/ACK timestamps and the derived legs), 7_FrameLedger_<base>.csv (exact video-to-pipeline frame mapping), 8_LatencyMeta_<base>.json (measured fps, trigger and drop counts, detector and ROI configuration).
  • Queue drops and lost triggers are counted rather than silent, including those lost to a write timeout or a full dispatch queue.
  • Camera.get_frame_ts(), Camera.measured_fps(), Arduino.send_command_async().
  • Documentation for config.local.yaml (bench-local camera index and serial port, untracked) and for the session output files.

Not changed, deliberately

CAP_PROP_BUFFERSIZE and the free-running camera reader. This unit is expected to show much lower camera delay than the DRerio unit, whose reader sleeps between reads and measured 102.6 ms — almost exactly 4.0 frame intervals, the signature of a DirectShow buffer. That is a real architectural difference between two published systems and should be measured, not normalised away beforehand.

Full Changelog: 1.1.0...1.2.0

pub2-pub_ready

Choose a tag to compare

@MarkSant MarkSant released this 16 Jul 15:20

Full Changelog: 1.0.0...1.1.0

pub1

Choose a tag to compare

@MarkSant MarkSant released this 16 Jul 01:27

What's Changed

  • Modularized app by @MarkSant in #1
  • Fix shutdown error by @MarkSant in #3
  • Refactor: Improve code quality and implement review suggestions

This commit implements several improvements based on a code review to
enhance code quality, robustness, and adherence to best practices.

The changes include:

  1. Imports: In detector.py, imports for torch, glob, and os
    are moved to the top of the file.
  2. Caching: The model caching logic in project_manager.py is made
    more defensive against potential race conditions by using
    shutil.rmtree(ignore_errors=True) and a try-except block for
    the move operation.
  3. API Update: The OpenVINO inference call in detector.py is
    updated from the deprecated infer_new_request to the recommended
    infer method. by @MarkSant in #6

New Contributors

Full Changelog: https://github.com/MarkSant/PyZebArdYolo/commits/1.0.0