Skip to content

Commit ec1b1ba

Browse files
authored
Merge pull request #116 from MouseLand/dev
Add colab notebooks to readthedocs
2 parents c624ec9 + 1bfded7 commit ec1b1ba

File tree

9 files changed

+54
-39
lines changed

9 files changed

+54
-39
lines changed

.readthedocs.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ formats:
2020
python:
2121
version: 3.8
2222
install:
23-
- method: pip
24-
path: .
25-
extra_requirements:
26-
- docs
27-
- gui
23+
- requirements: docs/requirements.txt
24+
#- method: pip
25+
#path: .
26+
#extra_requirements:
27+
# - docs
28+
# - gui
29+

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"sphinx.ext.mathjax",
4040
"sphinx.ext.viewcode",
4141
"sphinx.ext.napoleon",
42+
"nbsphinx"
4243
]
4344
# extensions = ['sphinx.ext.autodoc',
4445
# 'sphinx.ext.mathjax',

docs/index.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ For more details, please see our `paper <https://www.biorxiv.org/content/10.1101
2323
:caption: API Reference:
2424

2525
api
26-
26+
27+
..
28+
Use the following command to generate documentation
29+
sphinx-build -b html docs docs/build/html

docs/notebooks/process_keypoints.ipynb

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
{
22
"cells": [
3-
{
4-
"attachments": {},
5-
"cell_type": "markdown",
6-
"metadata": {
7-
"colab_type": "text",
8-
"id": "view-in-github"
9-
},
10-
"source": [
11-
"<a href=\"https://colab.research.google.com/github/MouseLand/facemap/blob/dev/notebooks/process_keypoints.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
12-
]
13-
},
143
{
154
"attachments": {},
165
"cell_type": "markdown",
176
"metadata": {
187
"id": "aNJBMgPY5xR8"
198
},
209
"source": [
21-
"# **Facemap 1.0 Keypoints Prediction in colab with a GPU**\n",
10+
"# Facemap 1.0 Keypoints Prediction in colab with a GPU\n",
2211
"\n",
2312
"Framework for predicting neural activity from mouse orofacial movements tracked using a pose estimation model. Package also includes singular value decomposition (SVD) of behavioral videos.\n",
2413
"\n",
@@ -31,14 +20,25 @@
3120
"This tutorials shows how to process keypoints using Facemap. For more information on the Pose class see [here](https://github.com/MouseLand/facemap/blob/main/facemap/pose/pose.py)"
3221
]
3322
},
23+
{
24+
"attachments": {},
25+
"cell_type": "markdown",
26+
"metadata": {
27+
"colab_type": "text",
28+
"id": "view-in-github"
29+
},
30+
"source": [
31+
"<a href=\"https://colab.research.google.com/github/MouseLand/facemap/blob/dev/notebooks/process_keypoints.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
32+
]
33+
},
3434
{
3535
"attachments": {},
3636
"cell_type": "markdown",
3737
"metadata": {
3838
"id": "Z4tBDzjn6L5n"
3939
},
4040
"source": [
41-
"# Setup\n",
41+
"## Setup\n",
4242
"\n",
4343
"We will first install Facemap, check the GPU is working, and mount google drive to access videos."
4444
]
@@ -295,7 +295,7 @@
295295
"id": "-GqSretcASWN"
296296
},
297297
"source": [
298-
"# Pose estimation"
298+
"## Pose estimation"
299299
]
300300
},
301301
{
@@ -402,7 +402,7 @@
402402
},
403403
{
404404
"cell_type": "code",
405-
"execution_count": null,
405+
"execution_count": 1,
406406
"metadata": {
407407
"cellView": "form",
408408
"id": "IKmjuZerAf9J"
@@ -439,7 +439,7 @@
439439
"id": "DZPn2mG6lti7"
440440
},
441441
"source": [
442-
"See `load_visualize_keypoints.ipynb` to load and visualize the saved keypoints in a notebook. Alternatively, use the [Facemap GUI](https://github.com/MouseLand/facemap/blob/main/docs/pose_tracking_gui_tutorial.md#visualize-keypoints) to view keypoints tracking on video."
442+
"Next, use the [Facemap GUI](https://github.com/MouseLand/facemap/blob/main/docs/pose_tracking_gui_tutorial.md#visualize-keypoints) to view keypoints tracking on video. "
443443
]
444444
}
445445
],
@@ -462,7 +462,15 @@
462462
"name": "python3"
463463
},
464464
"language_info": {
465+
"codemirror_mode": {
466+
"name": "ipython",
467+
"version": 3
468+
},
469+
"file_extension": ".py",
470+
"mimetype": "text/x-python",
465471
"name": "python",
472+
"nbconvert_exporter": "python",
473+
"pygments_lexer": "ipython3",
466474
"version": "3.9.7"
467475
}
468476
},

docs/notebooks/refine_keypoints_model.ipynb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
{
22
"cells": [
3-
{
4-
"attachments": {},
5-
"cell_type": "markdown",
6-
"metadata": {
7-
"colab_type": "text",
8-
"id": "view-in-github"
9-
},
10-
"source": [
11-
"<a href=\"https://colab.research.google.com/github/MouseLand/facemap/blob/dev/notebooks/refine_keypoints_model.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
12-
]
13-
},
143
{
154
"attachments": {},
165
"cell_type": "markdown",
176
"metadata": {
187
"id": "aNJBMgPY5xR8"
198
},
209
"source": [
21-
"# **Facemap 1.0 - Keypoints model refinement in colab using a GPU**\n",
10+
"# Facemap 1.0 - Keypoints model refinement in colab using a GPU\n",
2211
"\n",
2312
"Facemap is a framework for predicting neural activity from mouse orofacial movements tracked using a pose estimation model. Package also includes singular value decomposition (SVD) of behavioral videos.\n",
2413
"\n",
@@ -31,14 +20,25 @@
3120
"This tutorials shows how to refine keypoints and finetune model using Facemap. For more information on the Pose class see [here](https://github.com/MouseLand/facemap/blob/main/facemap/pose/pose.py)"
3221
]
3322
},
23+
{
24+
"attachments": {},
25+
"cell_type": "markdown",
26+
"metadata": {
27+
"colab_type": "text",
28+
"id": "view-in-github"
29+
},
30+
"source": [
31+
"<a href=\"https://colab.research.google.com/github/MouseLand/facemap/blob/dev/notebooks/refine_keypoints_model.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
32+
]
33+
},
3434
{
3535
"attachments": {},
3636
"cell_type": "markdown",
3737
"metadata": {
3838
"id": "Z4tBDzjn6L5n"
3939
},
4040
"source": [
41-
"# Setup\n",
41+
"## Setup\n",
4242
"\n",
4343
"We will first install Facemap, check the GPU is working, and mount google drive to access videos."
4444
]
@@ -290,7 +290,7 @@
290290
"id": "-GqSretcASWN"
291291
},
292292
"source": [
293-
"# Fine-tune model using refined keypoints data"
293+
"## Fine-tune model using refined keypoints data"
294294
]
295295
},
296296
{

docs/outputs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Keypoints processing
9191
~~~~~~~~~~~~~~~~~~~~
9292

9393
Keypoints processing saves two outputs: a \*.h5 and a \*metadata.pkl file.
94-
- \*.h5 file contains: Keypoints stored as a 3D array of shape (3, number of bodyparts, number of frames). The first dimension of size 3 is in the order: (x, y, likelihood). For more details on using/loading the \*.h5 file in python see this `tutorial <https://github.com/MouseLand/facemap/blob/main/notebooks/load_visualize_keypoints.ipynb>`__.
94+
- \*.h5 file contains: Keypoints stored as a 3D array of shape (3, number of bodyparts, number of frames). The first dimension of size 3 is in the order: (x, y, likelihood). For more details on using/loading the \*.h5 file in python see this `tutorial <https://github.com/MouseLand/facemap/blob/main/docs/notebooks/load_visualize_keypoints.ipynb>`__.
9595
- \*metadata.pkl file: contains a dictionary consisting of the following variables:
9696
- batch_size: batch size used for inference
9797
- image_size: frame size

docs/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ipykernel
2+
nbsphinx

docs/svd_python_tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,4 @@ proc = np.load('cam1_proc.npy', allow_pickle=True).item()
121121

122122
The `_proc.npy` files can be loaded into the GUI (and will automatically be loaded after processing). The checkboxes in the lower left allow you to view different traces from the processed video(s).
123123

124-
For example usage, see [notebook](https://github.com/MouseLand/facemap/blob/dev/notebooks/process.ipynb).
124+
For example usage, see [notebook](https://github.com/MouseLand/facemap/blob/main/docs/notebooks/process_svd.ipynb).

requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)