Repository navigation
Conversation
Adds an optional image lane beside the keypoint features: a causal crop around the animal, a YOLO segmentation mask, mask-shape descriptors, masked DINOv2 ViT-S/14 and the mmv2 pose-model neck, reduced by a PCA fitted on the training sessions only and windowed past-only (value, mean, std, diff). - image_lane.py: config, crop tracker, encoder, per-session raw cache, PCA artifact stored in the model bundle, one window function shared by training, offline scoring and the live stream. - Wired into training, cross-validation, batch scoring and the live pipeline (image_lane=True); lane columns are NaN-tolerant, so a missed mask leaves the keypoint features usable. - Live display now draws its overlay on a copy of the frame, so stages that read pixels downstream no longer see it. Reproduces the research pipeline: PyMouse leave-one-mouse-out 0.776 centred / 0.768 live (research 0.778 / 0.768); Blast leave-one-session-out 0.834 -> 0.842 with the lane.
Flow timing part B. With timing.flow_loop_thread on (or GLIDER_FLOW_THREAD=1), FlowEngine, HardwareManager and every board and device coroutine run on one daemon thread with its own asyncio loop, so paint, frames and widget work stop delaying flow steps. Off by default until it is proven on every board. - core/flow_loop.py: the thread, @on_flow_loop (hops a coroutine there and awaits it; straight through when off or already there), call_on_gui, post_to_loop, and estop_entry, which pings the flow loop and runs the stop on the caller's loop if it does not answer in 250 ms. - BaseBoard/BaseDevice wrap every public coroutine method, plugins included, since the GUI awaits device methods directly in many places. - Risk sites: Telemetrix is_connected posts its link-loss repair to the board's loop; zone/behavior nodes post outputs from the vision thread; VideoPlayback builds its window on the GUI thread; session-change reaches the GUI through a queued signal. Benchmark (GUI busy 12 ms of every 16, 20 ms flow-clock waits): p95 lateness 12.6 ms -> 0.15 ms when the GUI work is native; no gain when it is pure Python, which holds the GIL.
… current The board-drop dialog ran dialog.exec() inside an asyncio task step, so asyncio refused to step every other task (flow, pause, recorder) and the app froze. Open it with open() instead. The link supervisor now polls boards too and starts on every connect, so an unplugged Arduino reads Disconnected on an idle rig. Board state changes repaint device rows, including the run panel. GenericSerialDevice owns its link and notices its USB port disappearing.
…e-persistence-156bdf fix(hardware): survive Arduino unplug mid-run; accurate device link status
The engine reports (node_id, active) from when execution reaches a node until it fires an exec output or returns; the canvas lights that node's border green, lingering 400 ms so instant nodes still visibly flash.
# Conflicts: # src/glider/core/hardware_manager.py
…ht-0ba7b7 Highlight the active node while a flow runs
…-app training - Add Images / Videos: copy image files in as they are (grouped by folder, original file name kept in FrameRecord.source) alongside video extraction - Grid: search box (file, video, frame number); split shown as a coloured dot; stat tiles no longer draw dark label backgrounds - Drop the one-video leak notice (nothing to act on); keep the per-video one - Tool rail: each tool named under its glyph, with a TOOL heading - Train Model: exports, then trains YOLO in a child QProcess with a live log, epoch progress and Stop; runs land in <project>/runs/ - Fix: Add dialog OK stayed disabled after picking files
Right-click a tile (Open, Move to split, Skip/Unskip, Delete), the selection bar's Delete button, or the Delete/Backspace key. Confirms first, naming how many are annotated; removes the image and label files and clears undo. StudioProject.remove_frames forgets an image folder left empty.
…tabs Numbered badge (tick when done), title, blue underline on the current step, full-width bar. Replaces the rounded StepChip look so every step-by-step tool reads the same.
…ose subtitle macOS drew Behavior Analysis's tab bar base natively (grey bar, raised selected tab), so it never matched Batch Pose's step strip. Turn the base off and paint the bar from tools.qss with the strip's colour and bottom line. Batch Pose's header loses its subtitle, like Behavior Analysis's.
The identity assigner now takes the frame timestamp and allows max_travel_px per elapsed camera frame (at fps), so a CV pipeline that drops frames no longer loses a fast-moving animal's name. The relabel window spans camera frames by time too. Without timestamps each update still counts as one frame.
…on clear An appearance-mode slot never observed was reported at (0,0) and could occupy a zone; ZoneTracker now skips hidden objects with age 0. clear_identity also resets attached per-animal behaviour classifiers.
The export indexed rows by the logger's frame counter, which drifts from the video when the logger starts first or frames go unlogged. Each row now lands on video frame round((timestamp - t0) * fps), with t0 the recorder's first written frame and fps its measured rate (new public first_frame_timestamp / fps properties). With identity on, frames the CV queue supersedes still get an empty log row. The export runs in a worker thread at Stop.
The camera settings dialog now warns and saves nothing when two animals share a name or Name at start has no animals. CVSettings.from_dict drops animals with no name.
… time A mid-run Pause leaves a gap in the raw video that t0 + i/fps cannot see, so every row after it was shifted (or dropped past the end). The recorder now keeps each written frame's capture timestamp; rows go to the nearest frame within half a frame interval, and rows logged while paused are dropped.
Firing an exec output cleared the source's highlight, but a Loop keeps running after it fires body. Nodes list such outputs in STAYS_ACTIVE_ON and clear when execute returns instead. Fixes LL-37.
Resolve conflicts with the Train tab's Options sections and the live pipeline's frame consumers: the Image lane checkbox joins main's Extra features row and summary, and the pipeline keeps both the lane worker and the frame consumers.
test_radius_scale accepts a scale token, a line marked geometric, or a bare 0; 0px is none of those, so the suite failed on tools.qss:671.
test_radius_scale accepts a scale token, a line marked geometric, or a bare 0; 0px is none of those, so the suite failed on tools.qss:671.
Keep a running Loop lit through its body and waits
…er-680163 feat(behavior): image-embedding lane for the behaviour classifier
Live multi-animal identity for closed-loop flows
PySide6 is LGPL where PyQt6 is GPL, which keeps a closed-source GLIDER possible. Imports move to PySide6, pyqtSignal/pyqtSlot become Signal/Slot, sip.isdeleted becomes shiboken6.isValid, and QWIDGETSIZE_MAX (not exported by PySide6) is defined locally. glider/__init__ sets QT_API and PYQTGRAPH_QT_LIB so pyqtgraph, matplotlib and qasync cannot pick up a leftover PyQt6. The pc and rpi extras depend on PySide6-Essentials>=6.8.0.2, the newest with a wheel for Raspberry Pi OS Bookworm; the Pi installer, image and update script install the rpi extra and libxcb-cursor0 instead of apt's python3-pyqt6. pytest-qt runs with qt_api = pyside6.
Commit the file (it was gitignored) so cloud sessions, which clone fresh, follow the rule too.
PyQt6 accepted drawPolygon/drawPolyline with the points as separate arguments; PySide6 takes a single polygon and raised mid-paint, which left the canvas half-drawn and later crashed pyqtgraph during garbage collection.
PySide6 ignores QMenu.exec patched onto the class (exec has static and instance overloads, and an instance call bypasses the class attribute), so the real modal menu opened and the hardware-panel test hung. The new capture_menu_exec fixture swaps the module's QMenu for a subclass whose exec does the capturing.
- QPen takes no cap=/join= keywords: build round pens with setters. - The camera panel's status message goes to the window's own status bar; findChild returned a replaced bar not yet deleted. - Tests: QTest's modifier is positional (PySide6 calls it stateKey), QAction.disconnect() needs a signal, QImage.bits() is a sized memoryview, font().family() is the requested face (use fontInfo), and waitSignal on a worker's signal returns before the main-thread slot runs.
Under PySide6 a lambda, closure or partial connected to a signal emitted on a worker thread runs on that thread, even with QueuedConnection; only a bound method of a GUI-thread QObject is queued to the GUI thread. PyQt6 queued lambdas too, so these were safe before and are not now: - Behavior Analysis Apply: finished/failed tore the thread down, updated widgets and started the next video from the worker thread. - Behavior Analysis cohort speed: progress bar, message box and buttons. - The annotator's speed-worker bookkeeping raced its stop path. - retire_thread's release runs on the finishing thread; guard its list. - The flow engine's node-active callback goes through a signal, since it fires on the flow loop thread when that setting is on. Also corrects the flow_loop docstring, and makes a qthreads test wait for its worker to start and not time out while the GUI thread is busy.
Switch the Qt binding from PyQt6 to PySide6
gbradham
marked this pull request as ready for review
November 29, 2026 19:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings
devup tomain, following CONTRIBUTING's rule thatdevmerges intomainat release time.mainhas no commits thatdevlacks.What lands on main
devas well asmain.Testing
After merging
Existing installs need to re-run the installer, or
uv sync --extra pc; on the Pi, re-runinstall.shor the update script, because Qt now comes from pip.