Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
7b5c26b
Adding pyproject.toml and src structure outline
bergsalex May 30, 2025
a850417
applying ruff formatting
bergsalex May 30, 2025
f5144b1
Adding tests for new CLI interface
bergsalex May 30, 2025
17ca46a
Cleanup of cli implementation from testing
bergsalex May 30, 2025
46131a4
Adding pytest and uv lock
bergsalex May 30, 2025
679a316
Removing tests directory from gitignore
bergsalex May 30, 2025
04ebb2f
Adding new CLI definitions for all inference commands
bergsalex Jun 2, 2025
4a9472c
Merge pull request #36 from KumarLabJax/YODA-128-build-new-cli-module…
bergsalex Jun 2, 2025
b9cb119
Automatic formatting
bergsalex Jun 2, 2025
1e7de81
Code comment cleanup
bergsalex Jun 2, 2025
77f7da3
Cleanup tests
bergsalex Jun 2, 2025
9e204f8
Merge pull request #37 from KumarLabJax/YODA-128-build-new-cli-module…
bergsalex Jun 30, 2025
1272649
Merge remote-tracking branch 'origin' into repository-reorganization
bergsalex Jun 30, 2025
99a1cb4
Renaming root package to
bergsalex Jun 30, 2025
45bcfd3
Updating root __version__ and pyproject.toml package references
bergsalex Jun 30, 2025
f05887c
Merge pull request #41 from KumarLabJax/shorten-package-name
bergsalex Jul 1, 2025
e00152b
Refactoring pose utilities and adding tests
bergsalex Jul 1, 2025
aa5fa6d
Adding two missed test files
bergsalex Jul 1, 2025
50b331c
Moving all non top-level code files into the src directory and fixing…
bergsalex Jul 1, 2025
be32b3f
Adding typing to array utils
bergsalex Jul 1, 2025
39318e6
Merge pull request #42 from KumarLabJax/refactor-pose-utils
bergsalex Jul 1, 2025
182b331
Merge pull request #43 from KumarLabJax/move-non-top-level-files
bergsalex Jul 1, 2025
3d9090d
Adding tests for pose inspect, and adding to CLI
bergsalex Jul 1, 2025
3f32045
Fixing imports for CLI modules
bergsalex Jul 1, 2025
b020b86
Adding inspect functions to pose.inspect module
bergsalex Jul 2, 2025
b34500c
Switch pose inspect functions to use dict literal syntax
bergsalex Jul 7, 2025
26e1217
Specifying tf torch and jax related dependencies and updating lock file
bergsalex Jul 7, 2025
a524c07
Merge remote-tracking branch 'origin/fix-tf-pytorch-jax-dependencies'…
bergsalex Jul 7, 2025
9d178de
Merge pull request #44 from KumarLabJax/implement-single-pose-qa
bergsalex Jul 7, 2025
2fff3f5
Adding pose converter functions with tests
bergsalex Jul 7, 2025
b7d9b3e
Adding fecal_boli related code and associated tests
bergsalex Jul 7, 2025
5995ee0
Adding remaining tests for utils.static_objects module
bergsalex Jul 7, 2025
0228f49
Remove jax dependency
bergsalex Jul 7, 2025
30c956d
Merge pull request #45 from KumarLabJax/fix-tf-pytorch-jax-dependencies
bergsalex Jul 7, 2025
07b6098
Merge remote-tracking branch 'origin/repository-reorganization' into …
bergsalex Jul 7, 2025
b216cc1
Adding tests for the utils.writers module
bergsalex Jul 8, 2025
912f4ca
Migrate fecal_boli CLI definition
bergsalex Jul 8, 2025
37b4e63
Finishing up initial utils CLI comands
bergsalex Jul 8, 2025
e2e4160
Addressing PR comments
bergsalex Jul 10, 2025
6cc4bf9
Merge pull request #46 from KumarLabJax/migrate-remaining-commands
bergsalex Jul 10, 2025
bbed089
Rewriting VideoObservations.stitch_greedy_tracklets method and adding…
bergsalex Jul 10, 2025
f808fb1
Update pyproject toml and lock file dependencies based on reconciliat…
bergsalex Jul 10, 2025
fe6a98e
Adding dockerfile definition to extend colab image with mouse_trackin…
bergsalex Jul 10, 2025
2df043b
Dockerfile should end with a newline
bergsalex Jul 10, 2025
07075db
First pass at segmentation utils unit tests
bergsalex Jul 11, 2025
b34757c
Better docstrings in new segmentation utils tests
bergsalex Jul 11, 2025
e5ceb4f
Update CLI tests for Utils commands
bergsalex Jul 11, 2025
d31f0dd
Adding additional tests for merge_multiple_seg_instances when no data…
bergsalex Jul 11, 2025
127a247
Merge remote-tracking branch 'origin/main' into migrate-inference-com…
bergsalex Jul 11, 2025
e510c76
Fill out implementation of inference cli commands
bergsalex Jul 11, 2025
5553b8d
Updating tests for inference CLI
bergsalex Jul 11, 2025
158ce02
Fix pytorch_inference models import
bergsalex Jul 11, 2025
e82b2db
Merge remote-tracking branch 'origin/main' into repository-reorganiza…
bergsalex Jul 11, 2025
91a3b60
Updating nextflow command calls to use new Typer CLI
bergsalex Jul 11, 2025
20db522
Merge pull request #49 from KumarLabJax/reconcile-dependencies-with-c…
bergsalex Jul 15, 2025
ca1a33d
Merge pull request #48 from KumarLabJax/improve-stich-tracklets-perfo…
bergsalex Jul 15, 2025
3de3ab6
Merge pull request #51 from KumarLabJax/update-cli-utils-tests
bergsalex Jul 15, 2025
c1f74bd
Add missing newline
bergsalex Jul 15, 2025
b718657
Add unit tests for generate_greedy_tracklets and _calculate_costs
bergsalex Jul 15, 2025
8863a01
Early implementation of vectorized calculate_costs
bergsalex Jul 16, 2025
b190fd5
Merge pull request #50 from KumarLabJax/tests-for-segmentation-utils
bergsalex Jul 17, 2025
69eb091
Merge pull request #52 from KumarLabJax/migrate-inference-commands
bergsalex Jul 17, 2025
68246c4
Merge pull request #53 from KumarLabJax/migrate-nextflow-command-calls
bergsalex Jul 23, 2025
f02a41c
Vectorizing greedy matching and adding associated tests
bergsalex Jul 23, 2025
65312e5
Update comments
bergsalex Jul 23, 2025
581b68b
Cleanup of test organization and removing old utils.matching file
bergsalex Jul 24, 2025
bc3ec73
Merge pull request #55 from KumarLabJax/improve-generate-tracklets-pe…
bergsalex Aug 4, 2025
9ec24e1
Apply formatting fixes to matching code and tests
bergsalex Aug 5, 2025
8f08d80
Merge remote-tracking branch 'origin/repository-reorganization' into …
bergsalex Aug 5, 2025
1957ec5
Removing commented out class definition
bergsalex Aug 5, 2025
3283eeb
Merge pull request #57 from KumarLabJax/improve-generate-tracklets-pe…
bergsalex Aug 7, 2025
c99ccd8
Merge remote-tracking branch 'origin/main' into repository-reorganiza…
bergsalex Aug 14, 2025
988f9eb
Adding PR verification action
bergsalex Aug 14, 2025
d4ba198
Testing docker image build
bergsalex Aug 14, 2025
15f78a8
Testing node cleanup
bergsalex Aug 14, 2025
34aaff3
Debug image size
bergsalex Aug 14, 2025
11ae9b6
Testing GCP Cloud Build
bergsalex Aug 14, 2025
abf0670
Docker build in github with custom base image
bergsalex Aug 15, 2025
14791c4
Fix uv python location in Dockerfile
bergsalex Aug 15, 2025
1113b3c
Refactor github actions and split test and lint dev dependencies
bergsalex Aug 15, 2025
b753929
Fix optional workflow call inputs
bergsalex Aug 15, 2025
a7b096e
Limit dependency install to lint only on format-lint action
bergsalex Aug 15, 2025
a45ddd2
Update singularity and docker images to remove Google Colab dependency
bergsalex Aug 19, 2025
8b4d774
Apply automated ruff check fixes
bergsalex Aug 19, 2025
db4aa5b
Apply ruff auto-formatting
bergsalex Aug 19, 2025
b0cd05f
Merge pull request #66 from KumarLabJax/YODA-220-fix-mouse-tracking-r…
bergsalex Aug 19, 2025
45c3133
Manual fixes for ruff linting errors
bergsalex Aug 19, 2025
e71c501
Merge remote-tracking branch 'origin/repository-reorganization' into …
bergsalex Aug 19, 2025
a749f69
Fix description of CLI per-file lint ignore
bergsalex Aug 19, 2025
e40b935
Adding auto-formatting for manually changed files
bergsalex Aug 19, 2025
6dbd9f0
Merge pull request #67 from KumarLabJax/YODA-220-fix-mouse-tracking-r…
bergsalex Aug 19, 2025
6eab176
Adding newline at end of Dockerfile
bergsalex Aug 19, 2025
f0b8141
Merge remote-tracking branch 'origin/repository-reorganization' into …
bergsalex Aug 19, 2025
3f01a97
Revise vm/README language, update base image CUDE to match pyproject.…
bergsalex Aug 19, 2025
36c90ca
Merge remote-tracking branch 'origin/YODA-217-update-mouse-tracking-r…
bergsalex Aug 19, 2025
d096b61
Temporarily enable PR action on merges to repository-reorganizatiom b…
bergsalex Aug 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/_build-docker-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: 'Build Docker Image'
on:
workflow_call:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:

- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
33 changes: 33 additions & 0 deletions .github/workflows/_format-lint-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'Lint Code Definition'
on:
workflow_call:
inputs:
python-version:
description: 'Python version to set up'
required: false
default: '3.10'
type: string
jobs:
format-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Install dependencies with uv
run: uv sync --only-group lint

- name: Run Ruff Linter
run: uv run --only-group lint ruff check src/ tests/

- name: Run Ruff Formatter
run: uv run --only-group lint ruff format --check src/ tests/
35 changes: 35 additions & 0 deletions .github/workflows/_run-tests-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Python Tests Definition'
on:
workflow_call:
inputs:
python-version:
description: Python version to set up'
required: false
default: '3.10'
type: string
runner-os:
description: 'Runner OS'
required: false
default: 'ubuntu-latest'
type: string
jobs:
run-tests:
runs-on: ${{ inputs.runner-os }}
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Install dependencies with uv
run: uv sync

- name: Test with pytest
run: uv run pytest tests
20 changes: 20 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Pull Request Checks

on:
pull_request:
branches: [ main, repository-reorganization ]

jobs:
format-lint:
name: "Format and Lint"
uses: ./.github/workflows/_format-lint-action.yml

test:
name: "Run Tests"
needs: format-lint
uses: ./.github/workflows/_run-tests-action.yml

build:
name: "Build Docker Image"
needs: [format-lint, test]
uses: ./.github/workflows/_build-docker-action.yml
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
__pycache__
models
work
tests
!mouse-tracking-runtime/models
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM aberger4/mouse-tracking-base:python3.10-slim

# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

ENV UV_SYSTEM_PYTHON=1 \
UV_PYTHON=/usr/local/bin/python \
PYTHONUNBUFFERED=1

# Copy metadata first for layer caching
COPY pyproject.toml uv.lock* README.md ./

# Only install runtime dependencies
RUN uv sync --frozen --no-group dev --no-group test --no-group lint --no-install-project

# Now add source and install the project itself
COPY src ./src

RUN uv pip install --system .

CMD ["mouse-tracking-runtime", "--help"]
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,32 @@ This repository uses both Pytorch and Tensorflow Serving (TFS).

# Installation

Both Google Colab and singularity environments are supported. This environment is used because it is a convenient method to have both pytorch and tensorflow present.
## Runtime Environments

## Singularity Containers
This repository supports both Docker and Singularity environments.

See the [container definition file](vm/deployment-runtime-RHEL9.def) in the vm folder. This container is based off a google colab public docker.
The dockerfile is provided at the root of the repository ([Dockerfile](Dockerfile)), and the singularity
definition file is in the `vm` folder ([singularity.def](vm/singularity.def)).

To learn more about how we support this, please read [vm/README.md](vm/README.md).

## Development
This repository uses [uv](https://uv.run/) to manage multiple python environments.
To install uv, see the [uv installation instructions](https://uv.run/docs/installation).

To create the development environment, run:
```
uv sync --group cpu
```

# Available Models

See [model docs](docs/models.md) for information about available models.

# Running a pipeline

Pipelines are run using nextflow. For a list of all available parameters, see [nextflow parameters](nextflow.config). Not all parameters will affect all pipeline workflows.
Pipelines are run using nextflow. For a list of all available parameters, see
[nextflow parameters](nextflow.config). Not all parameters will affect all pipeline workflows.

You will need a batch file that lists the input files to process.

Expand Down
71 changes: 0 additions & 71 deletions mouse-tracking-runtime/aggregate_fecal_boli.py

This file was deleted.

111 changes: 0 additions & 111 deletions mouse-tracking-runtime/clip_video_to_start.py

This file was deleted.

Loading
Loading