Skip to content
Open
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
25 changes: 25 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Codespell configuration is within setup.cfg
---
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Annotate locations with typos
uses: codespell-project/codespell-problem-matcher@v1
- name: Codespell
uses: codespell-project/actions-codespell@v2
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Next you can extract information from the videos like track keypoints, compute m

## I. Pose tracking

<img src="https://raw.githubusercontent.com/MouseLand/facemap/main/figs/facemap.gif" width="100%" height="470" title="Tracker" alt="tracker" algin="middle" vspace = "10">
<img src="https://raw.githubusercontent.com/MouseLand/facemap/main/figs/facemap.gif" width="100%" height="470" title="Tracker" alt="tracker" align="middle" vspace = "10">

Facemap provides a trained network for tracking distinct keypoints on the mouse face from different camera views (some examples shown below). Check the `keypoints` box then click `process`. Next a bounding box will appear -- focus this on the face as shown below. Then the processed keypoints `*.h5` file will be saved in the output folder along with the corresponding metadata file `*.pkl`.

Expand All @@ -131,7 +131,7 @@ For more details on using the tracker, please refer to the [GUI Instructions](ht

<p float="middle">
<img src="https://raw.githubusercontent.com/MouseLand/facemap/main/figs/mouse_face1_keypoints.png" width="310" height="290" title="View 1" alt="view1" align="left" vspace = "10" hspace="30" style="border: 0.5px solid white" />
<img src="https://raw.githubusercontent.com/MouseLand/facemap/main/figs/mouse_face0_keypoints.png" width="310" height="290" title="View 2" alt="view2" algin="right" vspace = "10" style="border: 0.5px solid white">
<img src="https://raw.githubusercontent.com/MouseLand/facemap/main/figs/mouse_face0_keypoints.png" width="310" height="290" title="View 2" alt="view2" align="right" vspace = "10" style="border: 0.5px solid white">
</p>

### 📢 User contributions 📹 📷
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
# Configuration file for the Sphinx documentation builder.
#
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you are on Yosemite Mac OS, PyQt doesn't work, and you won't be able to insta

The software has been heavily tested on Ubuntu 18.04, and less well tested on Windows 10 and Mac OS. Please post an issue if you have installation problems.

### Pyhton dependencies
### Python dependencies

Facemap python relies on these awesome packages:
- [pyqtgraph](http://pyqtgraph.org/)
Expand Down
4 changes: 2 additions & 2 deletions docs/pose_tracking_gui_tutorial.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Pose tracking **(GUI)** :mouse:

<img src="../figs/tracker.gif" width="100%" height="500" title="Tracker" alt="tracker" algin="middle" vspace = "10">
<img src="../figs/tracker.gif" width="100%" height="500" title="Tracker" alt="tracker" align="middle" vspace = "10">

The latest python version is integrated with Facemap network for tracking 14 distinct keypoints on mouse face and an additional point for tracking paw. The keypoints can be tracked from different camera views (some examples shown below).

<p float="middle">
<img src="../figs/mouse_face1_keypoints.png" width="310" height="290" title="View 1" alt="view1" align="left" vspace = "10" hspace="30" style="border: 0.5px solid white" />
<img src="../figs/mouse_face0_keypoints.png" width="310" height="290" title="View 2" alt="view2" algin="right" vspace = "10" style="border: 0.5px solid white">
<img src="../figs/mouse_face0_keypoints.png" width="310" height="290" title="View 2" alt="view2" align="right" vspace = "10" style="border: 0.5px solid white">
</p>

## Generate keypoints
Expand Down
4 changes: 2 additions & 2 deletions docs/pose_tracking_gui_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Follow the steps below to generate keypoints for your videos:
- For processing single video, select ``Load video``. Alternatively,
for processing multiple videos, select ``Load multiple videos`` to
select the folder containing the videos. (Note: Pose estimation
for multipl videos is only supported for videos recorded
for multiple videos is only supported for videos recorded
simultaneously i.e. have the same time duration and frame rate).

(Optional) Set output folder
Expand All @@ -38,7 +38,7 @@ Follow the steps below to generate keypoints for your videos:
- A dialog box for selecting a bounding box for the face will
appear. Drag the red rectangle to select region of interest on the
frame where the keypoints will be tracked. Please ensure that the
bouding box is focused on the face where all the keypoints will be
bounding box is focused on the face where all the keypoints will be
visible. See example frames `here <https://github.com/MouseLand/facemap/blob/main/figs/mouse_views.png>`__. If a
‘Face (pose)’ ROI has already been added then this step will be
skipped.
Expand Down
2 changes: 1 addition & 1 deletion docs/svd_matlab_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ You can draw areas to be included and excluded in the multivideo SVD (or single

The motion energy is then computed from these non-red pixels.

### Proccessed output
### Processed output

The GUIs create one file for all videos (saved in current folder), the processed mat file has name "videofile_proc.mat".

Expand Down
2 changes: 1 addition & 1 deletion facemap/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
name = "facemap"
from facemap.version import version, version_str
2 changes: 1 addition & 1 deletion facemap/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import argparse
import time
Expand Down
2 changes: 1 addition & 1 deletion facemap/gui/cluster.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os

Expand Down
6 changes: 3 additions & 3 deletions facemap/gui/gui.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os
import sys
Expand Down Expand Up @@ -836,7 +836,7 @@ def add_pose_model(self, pose_model_path=None):
msg = QMessageBox()
msg.setIcon(QMessageBox.Icon.Critical)
msg.setText("Pose model not added. Error: " + str(e))
msg.setWindowTitle("Eror")
msg.setWindowTitle("Error")
msg.setStandardButtons(QMessageBox.StandardButton.Ok)
msg.exec_()

Expand Down Expand Up @@ -2250,7 +2250,7 @@ def update_ROI_vis_comboBox(self):

def display_ROI(self):
"""
Plot selected ROI on visualizaiton window
Plot selected ROI on visualization window
"""
self.roi_display_combobox.show()
roi_request = self.roi_display_combobox.currentText()
Expand Down
2 changes: 1 addition & 1 deletion facemap/gui/guiparts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import numpy as np
import pyqtgraph as pg
Expand Down
2 changes: 1 addition & 1 deletion facemap/gui/help_windows.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os
import typing
Expand Down
2 changes: 1 addition & 1 deletion facemap/gui/io.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import glob
import os
Expand Down
2 changes: 1 addition & 1 deletion facemap/gui/menus.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
from qtpy.QtWidgets import QAction
from qtpy.QtGui import QGuiApplication
Expand Down
2 changes: 1 addition & 1 deletion facemap/keypoints.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os

Expand Down
2 changes: 1 addition & 1 deletion facemap/neural_prediction/keypoints_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os

Expand Down
2 changes: 1 addition & 1 deletion facemap/neural_prediction/neural_activity.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion facemap/neural_prediction/neural_model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import time
from io import StringIO
Expand Down
2 changes: 1 addition & 1 deletion facemap/neural_prediction/prediction_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os
import time
Expand Down
4 changes: 2 additions & 2 deletions facemap/pose/datasets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os
from glob import glob
Expand Down Expand Up @@ -254,7 +254,7 @@ def load_keypoints_h5(self):
if len(annotation_files) == 0:
raise ValueError("No .h5 files found in the directory")

# Landmarks dataframe concatentation
# Landmarks dataframe concatenation
landmarks = pd.DataFrame()
for f in annotation_files:
df = pd.read_hdf(f)
Expand Down
2 changes: 1 addition & 1 deletion facemap/pose/facemap_network.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Network ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion facemap/pose/model_loader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
"""
Facemap model trained for generating pose estimates. Contains functions for:
Expand Down
2 changes: 1 addition & 1 deletion facemap/pose/model_training.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
## Import packages
import os
Expand Down
2 changes: 1 addition & 1 deletion facemap/pose/pose.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os
import pickle
Expand Down
2 changes: 1 addition & 1 deletion facemap/pose/pose_gui.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import numpy as np
import pyqtgraph as pg
Expand Down
2 changes: 1 addition & 1 deletion facemap/pose/pose_helper_functions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import random
from platform import python_version
Expand Down
2 changes: 1 addition & 1 deletion facemap/pose/refine_pose.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os
import shutil
Expand Down
4 changes: 2 additions & 2 deletions facemap/pose/transforms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
"""
Facemap functions for:
Expand Down Expand Up @@ -82,7 +82,7 @@ def randomize_bbox_coordinates(bbox, im_shape, random_factor_range=(0.1, 0.3)):
im_shape: tuple of size (2,)
image shape in order Ly, Lx
random_factor_range: tuple of size (2,)
range of random factor to use for expaning bounding box
range of random factor to use for expanding bounding box
Returns
-------
bbox: tuple of size (4,)
Expand Down
4 changes: 2 additions & 2 deletions facemap/process.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os
import time
Expand Down Expand Up @@ -710,7 +710,7 @@ def run(
Lybin, Lxbin, iinds = binned_inds(Ly, Lx, sbin)
LYbin, LXbin, sybin, sxbin = utils.video_placement(Lybin, Lxbin)

# number of mot/mov ROIs
# number of mot/mov ROIs # codespell:ignore
nroi = 0
if rois is not None:
for r in rois:
Expand Down
2 changes: 1 addition & 1 deletion facemap/pupil.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import numpy as np
from scipy.ndimage import gaussian_filter
Expand Down
2 changes: 1 addition & 1 deletion facemap/roi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import numpy as np
import pyqtgraph as pg
Expand Down
2 changes: 1 addition & 1 deletion facemap/running.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
# outputs the dx, dy offsets between frames by registering frame N to frame
# N-1. If the movement is larger than half the frame size, outputs NaN.
Expand Down
2 changes: 1 addition & 1 deletion facemap/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import cv2
import h5py
Expand Down
2 changes: 1 addition & 1 deletion facemap/version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""

import sys
Expand Down
4 changes: 2 additions & 2 deletions matlab/pupil/fitMVGaus.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
% fit 2D gaussian to cell with lam pixel weights
function params = fitMVGaus(iy, ix, lam0, thres)

% normalize pixel weigths
% normalize pixel weights
lam = lam0;

% iteratively fit the Guassian, excluding outliers
% iteratively fit the Gaussian, excluding outliers
for k = 1:5
lam = lam / sum(lam);
mu = [sum(lam.*iy) sum(lam.*ix)];
Expand Down
2 changes: 1 addition & 1 deletion paper/fig1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import cv2
import matplotlib
Expand Down
2 changes: 1 addition & 1 deletion paper/fig3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import matplotlib.pyplot as plt
import torch
Expand Down
2 changes: 1 addition & 1 deletion paper/fig4.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import matplotlib.pyplot as plt
import torch
Expand Down
2 changes: 1 addition & 1 deletion paper/fig_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import string

Expand Down
2 changes: 1 addition & 1 deletion paper/kpsproc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os

Expand Down
2 changes: 1 addition & 1 deletion paper/neuralpred.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os
import sys
Expand Down
Loading