Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
83 changes: 83 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Code of Conduct

## Our Pledge

We pledge to make our community welcoming, safe, and equitable for all.

We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant.

## Encouraged Behaviors

While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language.

With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including:

1. Respecting the **purpose of our community**, our activities, and our ways of gathering.
2. Engaging **kindly and honestly** with others.
3. Respecting **different viewpoints** and experiences.
4. **Taking responsibility** for our actions and contributions.
5. Gracefully giving and accepting **constructive feedback**.
6. Committing to **repairing harm** when it occurs.
7. Behaving in other ways that promote and sustain the **well-being of our community**.

## Restricted Behaviors

We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct.

1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop.
2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people.
3. **Stereotyping or discrimination.** Characterizing anyone's personality or behavior on the basis of immutable identities or traits.
4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community.
5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission.
6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group.
7. Behaving in other ways that **threaten the well-being** of our community.

### Other Restrictions

1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions.
2. **Failing to credit sources.** Not properly crediting the sources of content you contribute.
3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community.
4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors.

## Reporting an Issue

Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm.

When an incident does occur, it is important to report it promptly. To report a possible violation, contact hello@neuroinformatics.dev.

Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution.

## Addressing and Repairing Harm

If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped.

1. Warning
1. Event: A violation involving a single incident or series of incidents.
2. Consequence: A private, written warning from the Community Moderators.
3. Repair: Examples of repair include a private written apology, acknowledgement of responsibility, and seeking clarification on expectations.
2. Temporarily Limited Activities
1. Event: A repeated incidence of a violation that previously resulted in a warning, or the first incidence of a more serious violation.
2. Consequence: A private, written warning with a time-limited cooldown period designed to underscore the seriousness of the situation and give the community members involved time to process the incident. The cooldown period may be limited to particular communication channels or interactions with particular community members.
3. Repair: Examples of repair may include making an apology, using the cooldown period to reflect on actions and impact, and being thoughtful about re-entering community spaces after the period is over.
3. Temporary Suspension
1. Event: A pattern of repeated violation which the Community Moderators have tried to address with warnings, or a single serious violation.
2. Consequence: A private written warning with conditions for return from suspension. In general, temporary suspensions give the person being suspended time to reflect upon their behavior and possible corrective actions.
3. Repair: Examples of repair include respecting the spirit of the suspension, meeting the specified conditions for return, and being thoughtful about how to reintegrate with the community when the suspension is lifted.
4. Permanent Ban
1. Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member.
2. Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior.
3. Repair: There is no possible repair in cases of this severity.

This enforcement ladder is intended as a guideline. It does not limit the ability of Community Managers to use their discretion and judgment, in keeping with the best interests of our community.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Attribution

This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/).

Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/)

For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozilla’s code of conduct team](https://github.com/mozilla/inclusion).
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Contributing

See the [Contributing Guide](https://poseinterface.neuroinformatics.dev/about/contributing.html)
on our website for detailed instructions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Copyright (c) 2025, Sofia Minano
Copyright (c) 2025, The poseinterface developers.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include LICENSE
include README.md
include *.md
exclude .pre-commit-config.yaml

recursive-exclude * __pycache__
Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
[![License](https://img.shields.io/badge/License-BSD_3--Clause-orange.svg)](https://opensource.org/licenses/BSD-3-Clause)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

badges! 🤩

[![CI](https://img.shields.io/github/actions/workflow/status/neuroinformatics-unit/poseinterface/test_and_deploy.yml?label=CI)](https://github.com/neuroinformatics-unit/poseinterface/actions)
[![codecov](https://codecov.io/gh/neuroinformatics-unit/poseinterface/branch/main/graph/badge.svg?token=P8CCH3TI8K)](https://codecov.io/gh/neuroinformatics-unit/poseinterface)
[![Code style: Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/format.json)](https://github.com/astral-sh/ruff)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)

# poseinterface

**poseinterface** exists to advance pose estimation and point tracking
applications in animal behaviour videos. The project aims to:

- Build a [**benchmark dataset**](https://poseinterface.neuroinformatics.dev/benchmark-dataset.html)
with dozens of videos and annotations from multiple institutes,
open to external contributions.
- Develop a general-purpose **framework** for running pose estimation and
point tracking tools on benchmark data, and for comparing their outputs
via evaluation metrics.
- Provide **baseline models** trained using common pose estimation and tracking
frameworks on the benchmark datasets.

Read the [documentation](https://poseinterface.neuroinformatics.dev/) for more information.

> [!Warning]
> This project is in early stages of development.
> The API is not stable and may change without warning.
> Use with caution.
## License
⚖️ [BSD 3-Clause](./LICENSE)

## Package template
This package layout and configuration (including pre-commit hooks and GitHub actions) have been copied from the [python-cookiecutter](https://github.com/neuroinformatics-unit/python-cookiecutter) template.
11 changes: 11 additions & 0 deletions docs/source/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# About

```{toctree}
:maxdepth: 1

mission
team
contributing
license
code-of-conduct
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Benchmark project structure
(target-benchmark-dataset)=
# Benchmark dataset

This page describes the expected folder structure and file naming conventions for pose estimation benchmark datasets.
This page describes the expected folder structure and file naming conventions for `poseinterface` benchmark datasets.

:::{note}
We mark requirements with italicised *keywords* that should be interpreted as described by the [Network Working Group](https://www.ietf.org/rfc/rfc2119.txt). In decreasing order of requirement, these are: *must*, *should*, and *may*.
Expand Down
4 changes: 4 additions & 0 deletions docs/source/code-of-conduct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(target-code-of-conduct)=

```{include} ../../CODE_OF_CONDUCT.md
```
35 changes: 30 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
sys.path.insert(0, os.path.abspath("../.."))

project = "poseinterface"
copyright = "2022, Sofia Minano"
author = "Sofia Minano"
copyright = "2025, The poseinterface developers"
author = "The poseinterface developers"
try:
full_version = get_version(project)
# Splitting the release on '+' to remove the commit hash
Expand All @@ -46,6 +46,7 @@
"sphinx_gallery.gen_gallery",
"myst_parser",
"nbsphinx",
"sphinx_design",
]

# Configure the myst parser to enable cool markdown features
Expand Down Expand Up @@ -94,7 +95,7 @@

# Remove the primary (left) sidebar for specific pages
html_sidebars = {
"project_structure": [],
"benchmark-dataset": [],
}

# Customize the theme
Expand Down Expand Up @@ -157,10 +158,34 @@
"https://cocodataset.org/",
]
# A list of regular expressions that match URIs that should not be checked
linkcheck_ignore = []
linkcheck_ignore = [
r"https://docutils\.sourceforge\.io/.*", # returns 403
r"https://www\.contributor-covenant\.org/.*", # flaky
]
# Add request headers for specific domains (e.g. to avoid rate-limiting)
linkcheck_request_headers = {
"https://github.com": {
"Authorization": f"Bearer {os.environ.get('GITHUB_TOKEN', '')}",
},
}
}

# -- myst-parser configuration -------------------------------------------------

myst_url_schemes = {
"http": None,
"https": None,
"ftp": None,
"mailto": None,
"github-docs": (
"https://docs.github.com/en/"
"{{path}}#{{fragment}}"
),
"myst-parser": (
"https://myst-parser.readthedocs.io/en/latest/"
"{{path}}#{{fragment}}"
),
"sphinx-doc": (
"https://www.sphinx-doc.org/en/master/usage/"
"{{path}}#{{fragment}}"
),
}
119 changes: 119 additions & 0 deletions docs/source/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
(target-contributing)=

# Contributing

`poseinterface` follows the same contribution workflow as `movement`.
See the [corresponding section of the movement contributing guide](https://movement.neuroinformatics.dev/latest/community/contributing.html#contribution-workflow).

## Development Environment

We use [uv](https://docs.astral.sh/uv/) for dependency management. To set up a development environment:

```bash
# Create dev environment with all extras
uv sync --all-extras

# Activate the environment
source .venv/bin/activate # On macOS and Linux
.venv\Scripts\activate # On Windows PowerShell

# Set up pre-commit hooks
pre-commit install
```

## Formatting and pre-commit hooks
Running `pre-commit install` will set up [pre-commit hooks](https://pre-commit.com/) to ensure a consistent formatting style. Currently, these include:
* [ruff](https://github.com/astral-sh/ruff) does a number of jobs, including code linting and auto-formatting.
* [mypy](https://mypy.readthedocs.io/en/stable/index.html) as a static type checker.
* [check-manifest](https://github.com/mgedmin/check-manifest) to ensure that the right files are included in the pip package.
* [codespell](https://github.com/codespell-project/codespell) to check for common misspellings.

These will prevent code from being committed if any of these hooks fail.
To run all the hooks before committing:

```sh
pre-commit run # for staged files
pre-commit run -a # for all files in the repository
```

Some problems will be automatically fixed by the hooks. In this case, you should
stage the auto-fixed changes and run the hooks again:

```sh
git add .
pre-commit run
```

If a problem cannot be auto-fixed, the corresponding tool will provide
information on what the issue is and how to fix it. For example, `ruff` might
output something like:

```
E501 Line too long (81 > 79)
--> poseinterface/io.py:83:80
```

This pinpoints the problem to a single code line and a specific [ruff rule](https://docs.astral.sh/ruff/rules/) violation.
Sometimes you may have good reasons to ignore a particular rule for a specific line of code. You can do this by adding an inline comment, e.g. `# noqa: E501`. Replace `E501` with the code of the rule you want to ignore.

For docstrings, we adhere to the [numpydoc](https://numpydoc.readthedocs.io/en/latest/format.html) style.
Make sure to provide docstrings for all public functions, classes, and methods.

## Tests

We use [pytest](https://docs.pytest.org/en/latest/) for testing, aiming for ~100% test coverage where feasible. All new features should be accompanied by tests.

To run tests and check coverage:

```bash
pytest -v --cov=poseinterface --cov-report=xml
```

### Test Data

Test CSV files in `tests/data/` represent two DLC CSV formats:
- `CollectedData_Pranav.csv`: Single-index format (path in one column)
- `CollectedData_Shailaja.csv`: Multi-index format (path split across 3 columns)

Sample benchmark data lives in `tests/data/Train/SWC-plusmaze/sub-M708149_ses-20200317/`
and conforms to the dataset spec (session video excluded from git).


## Documentation

The documentation is hosted via [GitHub pages](https://pages.github.com/) at
[poseinterface.neuroinformatics.dev](target-poseinterface).
Its source files are located in the `docs` folder of this repository.
They are written in either [MyST Markdown](myst-parser:syntax/typography.html) (preferred)
or [reStructuredText](https://docutils.sourceforge.io/rst.html).
The `index.md` file corresponds to the homepage of the documentation website.
Other `.md` or `.rst` files are linked to the homepage via the `toctree` directive.

We use [Sphinx](sphinx-doc:) and the
[PyData Sphinx Theme](https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html)
to build the source files into HTML output.
This is handled by a GitHub actions workflow:
`.github/workflows/docs_build_and_deploy.yml`.

To build the docs locally:

```bash
cd docs
make clean html
```

On Windows powershell, prepend `.\` to the make command.

You can preview the built docs at `docs/_build/html/index.html`.


### Continuous integration
All pushes and pull requests will be built by [GitHub actions](github-docs:actions).
This will usually include linting, testing and deployment.

A GitHub actions workflow (`.github/workflows/test_and_deploy.yml`) has been set up to run (on each push/PR):
* Linting checks (pre-commit).
* Testing (only if linting checks pass)
* Release to PyPI (only if a git tag is present and if tests pass).

Another workflow (`.github/workflows/docs_build_and_deploy.yml`) is set up to build and deploy the documentation to GitHub pages on each push to `main` and on releases (i.e. when a git tag is present).
50 changes: 50 additions & 0 deletions docs/source/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
(target-poseinterface)=
# poseinterface

**poseinterface** exists to advance pose estimation and point tracking
applications in animal behaviour videos. The project aims to provide
benchmark datasets, baseline models trained on those datasets, as well as
tools for running and comparing pose estimation and tracking methods.

::::{grid} 1 2 2 4
:gutter: 3

:::{grid-item-card} {fas}`info-circle;sd-text-primary` About
:link: about
:link-type: doc

Learn about the project's mission, team and how to contribute.
:::

:::{grid-item-card} {fas}`database;sd-text-primary` Benchmark dataset
:link: benchmark-dataset
:link-type: doc

Folder structure and file naming conventions for benchmark datasets.
:::

:::{grid-item-card} {fas}`code;sd-text-primary` Examples
:link: auto_examples/index
:link-type: doc

A gallery of examples using `poseinterface`.
:::

:::{grid-item-card} {fas}`book;sd-text-primary` API reference
:link: api_index
:link-type: doc

Public functions and classes in `poseinterface`.
:::
::::


```{toctree}
:maxdepth: 2
:hidden:

about
benchmark-dataset
auto_examples/index
api_index
```
Loading
Loading