Skip to content

Source code ​

RodentFlow's code, its Core ML models, the model tutorials and this manual are all public on GitHub. The repositories that hold the Mac and pose-tracking code still carry the earlier project name, RodentStudio.

RepositoryWhat it containsLicence
seesaw-earth/RodentFlowRodentFlow for iPhone 1.x: centroid tracker, metrics, statistics, manual entry and table import. Also the source of this website, in docs/.MIT
seesaw-earth/RodentStudio-Support › sourceRodentFlow 2.1 for Mac and for iPhone & iPad; the released version is tagged v2.1. The two Xcode projects (source/macOS/RodentFlow-2.1, source/iOS/RodentFlow-2.1), the shared analysis engine in Shared/ (pose workflows, classic centroid tracking, multi-chamber tail suspension, statistics and exports), the Core ML models and the engine's tests. The earlier sources (RodentStudio 0.7.1 for Mac and RodentPose for iPhone & iPad) are kept beside them.AGPL-3.0 (a licence file in each project)
seesaw-earth/RodentFlow-WindowsRodentFlow for Windows: the RodentFlow analysis engine compiled for Windows, the C# host (FFmpeg video reading, ONNX Runtime, WinUI 3 window), a command-line tool, the model export notebook, and the privacy policy and third-party notices of the Windows app.AGPL-3.0
seesaw-earth/RodentStudio-CoreML-ModelsThe Core ML model packages, with weights in Git LFS.See Core ML models
seesaw-earth/RodentStudio-TutorialsThe original source of the model tutorials, references.bib and CITATION.cff.See the repository

Two licences

The iPhone 1.x code is MIT-licensed. The Mac and pose-tracking code is AGPL-3.0, and the Ultralytics YOLO models it runs carry AGPL-3.0 as well. Check the LICENSE, THIRD_PARTY_NOTICES and MODEL_PROVENANCE files of the code you reuse, and the licence summary for the models and their training data.

What open source means for you ​

  • See exactly how every number is computed. This manual describes the methods. The code is the final word, and anyone can read it.
  • Check the privacy promise. You can confirm in the code that the apps do not upload your data. You do not have to take our word for it.
  • Adapt it. You may modify the apps, for example to add an assay your lab uses, and share your version under the terms of the licence that applies.
  • Report and fix problems in the open. Issues and pull requests are welcome.

RodentFlow 2.1: where things are in the code ​

Paths are relative to source/macOS/RodentFlow-2.1/Shared/; the iPhone & iPad project holds an identical copy. RodentFlow for Windows compiles the same engine files, byte for byte, from engine/Sources/RodentFlowABI/Shared.

TopicSource file
One frame through the pose model: upright, arena crop, greyscale, letterboxVision/PoseVision.swift, Tracking/ArenaROI.swift
Decoding the model output into keypointsPoseEngine/PoseDecoding.swift
Which model a run usesPoseEngine/PoseModels.swift
Cleaning keypoint tracks: confidence, jumps, gaps, smoothingPoseEngine/Kinematics.swift
Two-animal identity: online tracker and whole-video resolverPoseEngine/IdentityTracking.swift
Groups of 3–10 mice: pose suppression and the fixed-number trackerPoseEngine/GroupTracking.swift
Group measures and dominance hierarchyPoseEngine/AnalyzersGroup.swift, PoseEngine/GroupHierarchy.swift
Resident–intruder rulesPoseEngine/AnalyzersAggression.swift
Statistical tests and group comparisonGroups/StatsEngine.swift, Groups/GroupAnalysis.swift, Groups/Survival.swift

The engine's tests are in tools/tests/; tools/run_shared_tests.sh compiles the engine with each test and runs it, on macOS or Linux, with only swiftc.

RodentFlow for iPhone 1.x: where things are in the code ​

TopicManual pageSource file
Background, threshold, candidate scoring, centroid, motion indexTrackingNativeMouseTracker.swift
Reading the whole video at 10 Hz, checkpointsAnalyzing a videoFullVideoAnalyzer.swift
Zones, entries, distance, freezing and all video metricsFrom positions to metricsAssayEngine.swift
Assays, metric definitions, phasesAssaysAssayCatalog.swift
Default zones and thresholdsAssaysResultModels.swift (ZoneConfig)
Manual entry, two-armed bandit and Q-learningManual entry & importManualAssays.swift
Statistical testsStatisticsStatsEngine.swift
Which test for which designGroup analysisGroupAnalysis.swift
Table import and column matchingManual entry & importDataImport.swift
English and Chinese text—Localizable.xcstrings

Build RodentFlow for iPhone 1.x ​

You need a Mac with Xcode 15 or later and an iPhone with iOS 17 or later. There are no third-party dependencies.

bash
git clone https://github.com/seesaw-earth/RodentFlow.git
cd RodentFlow
open RodentFlow.xcodeproj

In Xcode:

  1. Select the RodentFlow target › Signing & Capabilities, and choose your own Team. A free Apple ID is enough to run the app on your own iPhone.
  2. Change the Bundle Identifier to one of your own, e.g. com.yourname.rodentflow. The identifier in the project belongs to the published app.
  3. Connect your iPhone, choose it as the run destination and press Run (⌘R).

Build the Mac and iPhone & iPad pose editions ​

The source code for both editions is public under AGPL-3.0. You need a Mac with Xcode and Git LFS (the Core ML weights are stored with LFS).

bash
git clone https://github.com/seesaw-earth/RodentStudio-Support.git
cd RodentStudio-Support
git lfs install
git lfs pull                       # fetch the real model weights

git checkout v2.1                   # the released version (optional)

# Mac edition
open source/macOS/RodentFlow-2.1/macOS/RodentFlow-macOS/RodentFlow.xcodeproj
# iPhone / iPad edition
open source/iOS/RodentFlow-2.1/iOS/RodentFlow-iOS/RodentFlow.xcodeproj

Both projects compile the shared engine from ../../Shared, so keep the folder layout as it is. The earlier projects (source/macOS/RodentStudio-0.7.1, source/iOS/RodentStudio-Mobile-iOS) remain in the repository for reference.

  1. In Xcode, select the target → Signing & Capabilities → choose your own team (change the bundle identifier if needed).
  2. Mac: choose My Mac, then Product › Build (⌘B) and Run (⌘R). iPhone/iPad: choose your device (iOS 17+) — see Apple: Running your app on a device.
  3. If the build complains about a model, check that the .mlpackage folders contain real weight.bin files (not small LFS pointer files). The Core ML models repository is a developer resource; app users never need it.

A source checkout is not a signed release and has not necessarily passed final testing. Please test with your own videos before relying on it.

Build RodentFlow for Windows ​

The RodentFlow-Windows README lists what you need (Swift for Windows, Visual Studio's C++ tools, the .NET 8 SDK and FFmpeg) and the build commands for the engine, the window and the command-line tool. The ONNX model files are not in the repository; the export notebook makes them from the model checkpoints. A source build is not the signed Microsoft Store release; test it with your own videos before relying on it.

Contribute ​

  • Problems and questions: open an issue, or for the Windows app in RodentFlow-Windows. See Support for what to include.
  • Code: read CONTRIBUTING.md and open a pull request.
  • This manual: every page has an Edit this page on GitHub link at the bottom. The manual's source is in the docs/ folder, with an English and a Chinese version of each page.

Cite ​

If RodentFlow contributes to published work, please cite the software and the version you used:

bibtex
@software{shi2026rodentflow,
  author  = {Shi, Ziqing},
  title   = {RodentFlow: On-device pose tracking and behavior analysis for rodents},
  version = {2.1},
  year    = {2026},
  url     = {https://seesaw-earth.github.io/RodentFlow/}
}

For RodentFlow for iPhone 1.x, the repository has a CITATION.cff file, so GitHub's Cite this repository button gives APA and BibTeX entries. If you used a pose model, also cite the model's data and software; How to cite lists what to cite for each model.

The exact parameters of each result are listed under Methods on its result screen, and the test statement is on the statistics card. Both belong in a methods section.

Licences ​

  • RodentFlow for iPhone 1.x (RodentFlow): MIT License, © 2026 Ziqing Shi. You may use, copy, modify and distribute the software, including commercially, provided the copyright and licence notice are kept. The full text is in LICENSE.
  • Mac and pose-tracking code (RodentStudio-Support › source): AGPL-3.0. Each Xcode project contains its own licence text.
  • RodentFlow for Windows (RodentFlow-Windows): AGPL-3.0-only, © 2026 Ziqing Shi. Its third-party components (FFmpeg, ONNX Runtime with DirectML, Windows App SDK, Win2D) are listed in THIRD_PARTY_NOTICES.md.
  • Models and training data have their own terms; see Core ML models.

The software is provided without warranty. See also Legal & notices.