Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/EthoML/VAME into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vinicvaz committed May 22, 2024
2 parents 63aa916 + 43464de commit 158e484
Show file tree
Hide file tree
Showing 29 changed files with 1,349 additions and 201 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release-vame-package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Release

on:
workflow_run:
workflows: [Testing]
branches: [main]
types:
- completed
jobs:
pypi-release:
name: Release VAME in pypi
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install twine
- name: Build and publish to PyPI
run: |
python -m build
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Testing

on:
push:
branches:
- main
- dev


jobs:
run:
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
os: [ubuntu-latest, macos-13, windows-latest]
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow --tags
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install tests dependencies
run: |
python -m pip install -U pip
pip install . --no-cache-dir
pip install -r tests/requirements-tests.txt --no-cache-dir
- name: Run tests.
run: pytest --cov=src/vame --cov-report=xml --cov-report=term-missing -v

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Sample files
examples/*.mp4


# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -7,7 +11,7 @@ __pycache__/

# C extensions
*.so
*.mp4


# Distribution / packaging
.Python
Expand Down Expand Up @@ -95,8 +99,6 @@ celerybeat-schedule
venv/
ENV/
venv_docs/
examples/sample_data


# Spyder project settings
.spyderproject
Expand Down
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
prune tests
prune docs
prune examples
prune Images
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
![image](https://github.com/EthoML/VAME/assets/844306/0f08424f-06ab-48e4-8094-da0f0c78a08d)

<p align="center">
<a href="https://codecov.io/gh/EthoML/VAME" >
<img src="https://codecov.io/gh/EthoML/VAME/graph/badge.svg?token=J1CUXB4N0E"/>
</a>
</p>

🌟 Welcome to EthoML/VAME (Variational Animal Motion Encoding), an open-source machine learning tool for behavioral segmentation and analyses.

We are a group of behavioral enthusiasts, comprising the original VAME developers Kevin Luxem and Pavol Bauer, behavioral neuroscientists Stephanie R. Miller and Jorge J. Palop, and computer scientists and statisticians Alex Pico, Reuben Thomas, and Katie Ly). Our aim is to provide scalable, unbiased and sensitive approaches for assessing mouse behavior using computer vision and machine learning approaches.

We are focused on the expanding the analytical capabilities of VAME segmentation by providing curated scripts for VAME implementation and tools for data processing, visualization, and statistical analyses.
We are focused on the expanding the analytical capabilities of VAME segmentation by providing curated scripts for VAME implementation and tools for data processing, visualization, and statistical analyses.

## Recent Improvements to VAME
* Curated scripts for VAME implementation
Expand Down
20 changes: 1 addition & 19 deletions VAME.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,9 @@
# update: conda env update -f VAME.yaml
name: vame
channels:
- pytorch
- defaults
dependencies:
- python=3.11
- pip
- torchvision
- jupyter
- nb_conda
- pip:
- pytest-shutil
- scipy
- numpy
- matplotlib
- pathlib
- pandas
- ruamel.yaml
- scikit-learn
- pyyaml
- opencv-python-headless
- h5py
- umap-learn
- networkx
- tqdm
- hmmlearn
- -r requirements.txt
24 changes: 0 additions & 24 deletions deprecated_setup.py

This file was deleted.

163 changes: 155 additions & 8 deletions examples/demo.ipynb

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions examples/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

# These paths have to be set manually
working_directory = './'
project = 'first_vame_project'
project = 'my-vame-project'
videos = ['./video-1.mp4']
poses_estimations = ['./video-1.csv']


# Step 1.1: Initialize your project
config = vame.init_new_project(project=project, videos=videos, poses_estimations=poses_estimations, working_directory=working_directory, videotype='.mp4')

Expand All @@ -27,7 +28,7 @@
# As our config.yaml is sometimes still changing a little due to updates, we have here a small function
# to update your config.yaml to the current state. Be aware that this will overwrite your current config.yaml
# and make sure to back up your version if you did parameter changes!
vame.update_config(config)
vame.update_config(config, force_update=False)

# Step 1.2: Align your behavior videos egocentric and create training dataset
# pose_ref_index: list of reference coordinate indices for alignment
Expand All @@ -41,13 +42,13 @@
# Step 1.3: create the training set for the VAME model
vame.create_trainset(config, check_parameter=False, pose_ref_index=[0,5])

# Step 2: Train VAME
# # Step 2: Train VAME
vame.train_model(config)

# Step 3: Evaluate model # -> produces an image
# # Step 3: Evaluate model
vame.evaluate_model(config)

# Step 4: Segment motifs/pose # -> dont
# # Step 4: Segment motifs/pose
vame.pose_segmentation(config)


Expand Down
12 changes: 10 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[project]
name = "vame"
name = "vame-py"
version = '0.1.0'
dynamic = ["dependencies"]
description = "Variational Animal Motion Embedding."
authors = [
Expand All @@ -8,7 +9,6 @@ authors = [
]
requires-python = ">=3.11"
keywords = ["vame", "auto-encoder"]
version = '0.1.0'

[project.urls]
homepage = "https://github.com/EthoML/VAME/"
Expand All @@ -27,3 +27,11 @@ package-dir = { "" = "src" }
[tool.setuptools.packages.find]
where = ["src"]

[tool.pytest.ini_options]
pythonpath = [
".", "src"
]
testpaths = [
"tests"
]

78 changes: 12 additions & 66 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,66 +1,12 @@
contextlib2==21.6.0
contourpy==1.2.1
cycler==0.12.1
exceptiongroup==1.2.1
execnet==2.1.1
filelock==3.14.0
fonttools==4.51.0
fsspec==2024.3.1
h5py==3.11.0
hmmlearn==0.3.2
iniconfig==2.0.0
install==1.3.5
Jinja2==3.1.4
joblib==1.4.2
kiwisolver==1.4.5
llvmlite==0.42.0
MarkupSafe==2.1.5
matplotlib==3.8.4
mock==5.1.0
mpmath==1.3.0
networkx==3.3
numba==0.59.1
numpy==1.26.4
nvidia-cublas-cu12==12.1.3.1
nvidia-cuda-cupti-cu12==12.1.105
nvidia-cuda-nvrtc-cu12==12.1.105
nvidia-cuda-runtime-cu12==12.1.105
nvidia-cudnn-cu12==8.9.2.26
nvidia-cufft-cu12==11.0.2.54
nvidia-curand-cu12==10.3.2.106
nvidia-cusolver-cu12==11.4.5.107
nvidia-cusparse-cu12==12.1.0.106
nvidia-nccl-cu12==2.20.5
nvidia-nvjitlink-cu12==12.4.127
nvidia-nvtx-cu12==12.1.105
opencv-python-headless==4.9.0.80
packaging==24.0
pandas==2.2.2
path==16.14.0
path.py==12.5.0
pathlib==1.0.1
pillow==10.3.0
pluggy==1.5.0
pynndescent==0.5.12
pyparsing==3.1.2
pytest==8.2.0
pytest-shutil==1.7.0
python-dateutil==2.9.0.post0
pytz==2024.1
PyYAML==6.0.1
ruamel.yaml==0.18.6
ruamel.yaml.clib==0.2.8
scikit-learn==1.4.2
scipy==1.13.0
six==1.16.0
sympy==1.12
termcolor==2.4.0
threadpoolctl==3.5.0
tomli==2.0.1
torch==2.3.0
torchvision==0.18.0
tqdm==4.66.4
triton==2.3.0
typing_extensions==4.11.0
tzdata==2024.1
umap-learn==0.5.6
PyYAML>=6.0.0
ruamel.yaml>=0.18.0
numpy>=1.26.0
pandas>=2.2.0
scipy>=1.13.0
matplotlib>=3.9.0
torch==2.2.2
tqdm>=4.66.0
hmmlearn>=0.3.0
opencv-python-headless>=4.9.0.0
umap-learn>=0.5.0
h5py>=3.11.0
Loading

0 comments on commit 158e484

Please sign in to comment.