Visitar URL original
Updates to the documentation - Maxim (#2869) · DeepLabCut/DeepLabCut@e2c2762 · GitHub
Skip to content

Commit e2c2762

Browse files
authored
Updates to the documentation - Maxim (#2869)
1 parent 394db6a commit e2c2762

38 files changed

Lines changed: 999 additions & 444 deletions

‎_config.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ only_build_toc_files: true
55

66
sphinx:
77
config:
8-
autodoc_mock_imports: ["wx"]
8+
autodoc_mock_imports: ["wx", "matplotlib", "qtpy", "PySide6", "napari", "shiboken6"]
99
mermaid_output_format: raw
1010
extra_extensions:
1111
- numpydoc

‎_toc.yml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ parts:
4646
chapters:
4747
- file: docs/ModelZoo
4848
- file: docs/recipes/UsingModelZooPupil
49-
- file: docs/recipes/MegaDetectorDLCLive
5049
- caption: 🧑‍🍳 Cookbook (detailed helper guides)
5150
chapters:
52-
- file: docs/tutorial
5351
- file: docs/convert_maDLC
5452
- file: docs/recipes/OtherData
5553
- file: docs/recipes/io

‎deeplabcut/create_project/modelzoo.py‎

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@
1313
from pathlib import Path
1414

1515
import yaml
16-
17-
import deeplabcut
18-
from deeplabcut.utils import auxiliaryfunctions
1916
from dlclibrary.dlcmodelzoo.modelzoo_download import (
2017
download_huggingface_model,
2118
MODELOPTIONS,
2219
)
2320

21+
import deeplabcut
22+
from deeplabcut import Engine
23+
from deeplabcut.generate_training_dataset.metadata import TrainingDatasetMetadata, ShuffleMetadata, DataSplit
24+
from deeplabcut.pose_estimation_pytorch.config import read_config_as_dict
25+
from deeplabcut.utils import auxiliaryfunctions
26+
2427
Modeloptions = MODELOPTIONS # backwards compatibility for COLAB NOTEBOOK
2528

2629

@@ -300,6 +303,9 @@ def create_pretrained_project(
300303

301304
MakeTest_pose_yaml(pose_cfg, keys2save, path_test_config)
302305

306+
# create fake metadata to read TF Engine in scorer (temporary fix until Pytorch version is implemented)
307+
_create_and_save_fake_metadata(cfg)
308+
303309
video_dir = os.path.join(config["project_path"], "videos")
304310
if analyzevideo == True:
305311
print("Analyzing video...")
@@ -320,3 +326,28 @@ def create_pretrained_project(
320326

321327
else:
322328
return "N/A", "N/A"
329+
330+
def _create_and_save_fake_metadata(config_path: str | Path):
331+
# First create the metadata object
332+
metadata = TrainingDatasetMetadata.create(config_path)
333+
334+
# Create a new shuffle with TensorFlow engine
335+
new_shuffle = ShuffleMetadata(
336+
name="project_name-trainset95shuffle1",
337+
# This will be overwritten with proper name
338+
train_fraction=read_config_as_dict(config_path)["TrainingFraction"][0],
339+
index=1,
340+
engine=Engine.TF,
341+
split=DataSplit(
342+
train_indices=(0, 1, 2, 3, 4), # Example indices
343+
test_indices=(5,) # Example indices
344+
)
345+
)
346+
347+
# Add the shuffle to metadata
348+
metadata = metadata.add(new_shuffle)
349+
350+
# Save the metadata
351+
metadata.save()
352+
353+
return metadata

‎deeplabcut/generate_training_dataset/metadata.py‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,15 @@ def create(config: str | Path | dict) -> TrainingDatasetMetadata:
290290
cfg = config
291291

292292
trainset_path = TrainingDatasetMetadata.path(cfg).parent
293-
shuffle_docs = [
294-
f
295-
for f in trainset_path.iterdir()
296-
if re.match(r"Documentation_data-.+shuffle[0-9]+\.pickle", f.name)
297-
]
293+
if trainset_path.exists():
294+
shuffle_docs = [
295+
f
296+
for f in trainset_path.iterdir()
297+
if re.match(r"Documentation_data-.+shuffle[0-9]+\.pickle", f.name)
298+
]
299+
else:
300+
trainset_path.mkdir(parents=True)
301+
shuffle_docs = []
298302

299303
prefix = cfg["Task"] + cfg["date"]
300304
shuffles = []

‎deeplabcut/refine_training_dataset/outlier_frames.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def extract_outlier_frames(
235235
outlieralgorithm: str, optional, default="jump".
236236
String specifying the algorithm used to detect the outliers.
237237
238-
* ``'Fitting'`` fits a Auto Regressive Integrated Moving Average model to the
238+
* ``'fitting'`` fits an Auto Regressive Integrated Moving Average model to the
239239
data and computes the distance to the estimated data. Larger distances than
240240
epsilon are then potentially identified as outliers
241241
* ``'jump'`` identifies larger jumps than 'epsilon' in any body part

‎deeplabcut/utils/visualization.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS
1818
Licensed under GNU Lesser General Public License v3.0
1919
"""
20+
from __future__ import annotations
2021

2122
import os
2223
from pathlib import Path

‎docs/Governance.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(governance-model)=
22
# Governance Model of DeepLabCut
3-
(adapted from https://napari.org/docs/_sources/developers/GOVERNANCE.md.txt)
3+
(adapted from https://napari.org/stable/community/governance.html)
44

55
## Abstract
66

@@ -30,7 +30,7 @@ project in concrete ways, such as:
3030
[GitHub pull request](https://github.com/DeepLabCut/DeepLabCut/pulls);
3131
- reporting issues on our
3232
[GitHub issues page](https://github.com/DeepLabCut/DeepLabCut/issues);
33-
- proposing a change to the documentation (http://docs.deeplabcut.org) via a
33+
- proposing a change to the [documentation](https://deeplabcut.github.io/DeepLabCut/README.html) via a
3434
GitHub pull request;
3535
- discussing the design of the `DeepLabCut` or its tutorials on in existing
3636
[issues](https://github.com/DeepLabCut/DeepLabCut/issues) and
@@ -43,7 +43,7 @@ among other possibilities. Any community member can become a contributor, and
4343
all are encouraged to do so. By contributing to the project, community members
4444
can directly help to shape its future.
4545

46-
Contributors are encouraged to read the [contributing guide](https://github.com/DeepLabCut/DeepLabCut/CONTRIBUTING.md).
46+
Contributors are encouraged to read the [contributing guide](https://github.com/DeepLabCut/DeepLabCut/blob/main/CONTRIBUTING.md).
4747

4848
### Core developers
4949

‎docs/MISSION_AND_VALUES.md‎

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,74 @@
33

44
This document is meant to help guide decisions about the future of `DeepLabCut`, be it in terms of
55
whether to accept new functionality, changes to the styling of the code or graphical user interfaces (GUI),
6-
or whether to take on new dependencies, when to break into other repos, among other things. It serves as a point of reference for core developers actively working on the project, and an introduction for
6+
or whether to take on new dependencies, when to break into other repos, among other things. It serves as a point of
7+
reference for core developers actively working on the project, and an introduction for
78
newcomers who want to learn a little more about where the project is going and what the team's
8-
values are. You can also learn more about how the project is managed by looking at our [governance model](governance-model).
9+
values are. You can also learn more about how the project is managed by looking at our
10+
[governance model](governance-model).
911

1012
## Our founding principles
1113

12-
The founding DeepLabCut team came together around a shared vision for building the first open-source animal pose estimation framework
13-
that is:
14+
The founding DeepLabCut team came together around a shared vision for building the first open-source animal pose
15+
estimation framework that is:
1416

1517
- user defined pose estimation - i.e. species or object agnostic.
1618
- access to SOTA deep learning models that can be swiftly re-trained for customized applications
1719
- fast (GPU-powered)
1820
- scalable (project focused for ease of portability and sharability)
1921

2022

21-
As the project has grown we've turned these original principles into the mission statement and set of values that we described below.
23+
As the project has grown we've turned these original principles into the mission statement and set of values that we
24+
described below.
2225

2326
## Our mission
2427

25-
DeepLabCut aims to be **the animal pose software package for Python** and to **provide access to deep learning-based pose estimation for people to use in their daily work** without the need to be able to program in a deep learning framework.
26-
We hope to accomplish this by:
28+
DeepLabCut aims to be **the animal pose software package for Python** and to **provide access to deep learning-based
29+
pose estimation for people to use in their daily work** without the need to be able to program in a deep learning
30+
framework. We hope to accomplish this by:
2731

28-
- being **easy to use and install**. We are careful in taking on new dependencies, sometimes making them optional, and aim support a fully (Python) packaged installation that works cross-platform.
32+
- being **easy to use and install**. We are careful in taking on new dependencies, sometimes making them optional, and
33+
aim support a fully (Python) packaged installation that works cross-platform.
2934

30-
- being **well-documented** with **comprehensive tutorials and examples**. All functions in our API have thorough docstrings clarifying expected inputs and outputs, and we maintain a separate [tutorials and information website](http://deeplabcut.org).
35+
- being **well-documented** with **comprehensive tutorials and examples**. All functions in our API have thorough
36+
docstrings clarifying expected inputs and outputs, and we maintain a separate
37+
[tutorials and information website](http://deeplabcut.org).
3138

3239
- providing **GUI access** to all critical functionality so DeepLabCut can be used by people without coding experience.
3340

3441
- being **interactive** and **highly performant** in order to support large data pipelines.
3542

36-
- providing a **consistent and stable API** to enable plugin developers to build on top of DeepLabCut without their code constantly breaking and to enable advanced users to build out sophisticated Python workflows, if needed.
43+
- providing a **consistent and stable API** to enable plugin developers to build on top of DeepLabCut without their
44+
code constantly breaking and to enable advanced users to build out sophisticated Python workflows, if needed.
3745

38-
- **ensuring correctness**. We strive for complete test coverage of both the code and GUI, with all code reviewed by a core developer before being included in the repository.
46+
- **ensuring correctness**. We strive for complete test coverage of both the code and GUI, with all code reviewed by a
47+
core developer before being included in the repository.
3948

4049
## Our values
4150

42-
- We are **inclusive**. We welcome newcomers who are making their first contribution and strive to grow our most dedicated contributors into [core developers](https://github.com/orgs/DeepLabCut/teams/core-developers). We have a [Code of Conduct](https://github.com/DeepLabCut/DeepLabCut/CODE_OF_CONDUCT.md) to make DeepLabCut
51+
- We are **inclusive**. We welcome newcomers who are making their first contribution and strive to grow our most
52+
dedicated contributors into [core developers](https://github.com/orgs/DeepLabCut/teams/core-developers).
53+
We have a [Code of Conduct](https://github.com/DeepLabCut/DeepLabCut/blob/main/CODE_OF_CONDUCT.md) to make DeepLabCut
4354
a welcoming place for all.
4455

45-
- We are **community-engaged**. We respond to feature requests and proposals on our [issue tracker](https://github.com/DeepLabCut/DeepLabCut/issues).
56+
- We are **community-engaged**. We respond to feature requests and proposals on our
57+
- [issue tracker](https://github.com/DeepLabCut/DeepLabCut/issues).
4658

47-
- We serve **scientific applications** primarily, over “consumer or commercial” pose estimation tools. This often means prioritizing core functionality support, and rejecting implementations of “flashy” features that have little scientific value.
59+
- We serve **scientific applications** primarily, over “consumer or commercial” pose estimation tools. This often means
60+
prioritizing core functionality support, and rejecting implementations of “flashy” features that have little
61+
scientific value.
4862

49-
- We are **domain agnostic** within the sciences. Functionality that is highly specific to particular scientific domains belongs in plugins, whereas functionality that cuts across many domains and is likely to be widely used belongs inside DeepLabCut.
63+
- We are **domain agnostic** within the sciences. Functionality that is highly specific to particular scientific
64+
domains belongs in plugins, whereas functionality that cuts across many domains and is likely to be widely used belongs
65+
inside DeepLabCut.
5066

51-
- We value **education and documentation**. All functions should have docstrings, preferably with examples, and major functionality should be explained in our [tutorials](http://deeplabcut.org). Core developers can take an active role in finishing documentation examples.
67+
- We value **education and documentation**. All functions should have docstrings, preferably with examples, and major
68+
functionality should be explained in our [tutorials](http://deeplabcut.org). Core developers can take an active role
69+
in finishing documentation examples.
5270

5371

5472
## Acknowledgements
5573

56-
We share a lot of our mission and values with [`napari`](https://napari.org/docs/developers/MISSION_AND_VALUES.html) and [`scikit-image`](https://scikit-image.org/docs/dev/values.html) and acknowledge the influence of their mission and values statements on this document.
74+
We share a lot of our mission and values with [`napari`](https://napari.org/stable/community/mission_and_values.html)
75+
and [`scikit-image`](https://scikit-image.org/docs/stable/about/values.html) and acknowledge the influence of their
76+
mission and values statements on this document.

0 commit comments

Comments
 (0)