deepethogram 0.1.3__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. {deepethogram-0.1.3 → deepethogram-0.3.0}/MANIFEST.in +1 -1
  2. {deepethogram-0.1.3/deepethogram.egg-info → deepethogram-0.3.0}/PKG-INFO +110 -40
  3. deepethogram-0.1.3/PKG-INFO → deepethogram-0.3.0/README.md +90 -46
  4. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/__init__.py +5 -2
  5. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/__main__.py +2 -2
  6. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/base.py +146 -127
  7. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/callbacks.py +54 -74
  8. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/augs.yaml +1 -1
  9. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/config.yaml +2 -2
  10. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/debug.yaml +1 -1
  11. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/gui.yaml +1 -1
  12. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/inference.yaml +2 -2
  13. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/model/feature_extractor.yaml +1 -1
  14. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/model/flow_generator.yaml +1 -1
  15. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/model/sequence.yaml +2 -2
  16. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/postprocessor.yaml +1 -1
  17. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/preset/deg_f.yaml +1 -1
  18. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/preset/deg_m.yaml +1 -1
  19. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/preset/deg_s.yaml +1 -1
  20. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/train.yaml +0 -1
  21. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/tune/feature_extractor.yaml +2 -2
  22. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/tune/sequence.yaml +2 -2
  23. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/tune/tune.yaml +2 -2
  24. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/configuration.py +57 -57
  25. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/data/augs.py +57 -76
  26. deepethogram-0.3.0/deepethogram/data/dali.py +258 -0
  27. deepethogram-0.3.0/deepethogram/data/dataloaders.py +542 -0
  28. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/data/datasets.py +321 -310
  29. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/data/keypoint_utils.py +40 -36
  30. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/data/utils.py +96 -95
  31. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/debug.py +53 -52
  32. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/inference.py +198 -179
  33. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/losses.py +24 -47
  34. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/models/CNN.py +23 -16
  35. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/models/classifiers/alexnet.py +9 -9
  36. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/models/classifiers/densenet.py +85 -58
  37. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/models/classifiers/inception.py +15 -20
  38. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/models/classifiers/resnet.py +52 -33
  39. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/models/classifiers/resnet3d.py +33 -72
  40. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/models/classifiers/squeezenet.py +22 -32
  41. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/models/classifiers/vgg.py +73 -67
  42. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/models/hidden_two_stream.py +189 -143
  43. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/models/utils.py +35 -27
  44. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/train.py +198 -238
  45. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/file_io.py +22 -24
  46. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/flow_generator/inference.py +91 -84
  47. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/flow_generator/losses.py +154 -64
  48. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/flow_generator/models/FlowNetS.py +13 -19
  49. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/flow_generator/models/MotionNet.py +10 -46
  50. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/flow_generator/models/TinyMotionNet.py +7 -16
  51. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/flow_generator/models/TinyMotionNet3D.py +30 -37
  52. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/flow_generator/models/components.py +61 -41
  53. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/flow_generator/train.py +100 -89
  54. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/flow_generator/utils.py +42 -56
  55. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/gui/custom_widgets.py +166 -265
  56. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/gui/main.py +328 -411
  57. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/gui/mainwindow.py +31 -21
  58. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/gui/menus_and_popups.py +39 -31
  59. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/losses.py +63 -68
  60. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/metrics.py +171 -208
  61. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/postprocessing.py +56 -56
  62. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/projects.py +350 -409
  63. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/schedulers.py +31 -27
  64. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/sequence/__main__.py +1 -1
  65. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/sequence/inference.py +123 -125
  66. deepethogram-0.3.0/deepethogram/sequence/models/__init__.py +0 -0
  67. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/sequence/models/mlp.py +14 -7
  68. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/sequence/models/sequence.py +38 -16
  69. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/sequence/models/tgm.py +66 -100
  70. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/sequence/train.py +90 -92
  71. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/stoppers.py +33 -24
  72. deepethogram-0.3.0/deepethogram/tune/__init__.py +0 -0
  73. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/tune/feature_extractor.py +68 -55
  74. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/tune/sequence.py +61 -57
  75. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/tune/utils.py +17 -15
  76. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/utils.py +156 -218
  77. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/viz.py +451 -528
  78. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/zscore.py +37 -49
  79. deepethogram-0.1.3/README.md → deepethogram-0.3.0/deepethogram.egg-info/PKG-INFO +116 -31
  80. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram.egg-info/SOURCES.txt +10 -3
  81. deepethogram-0.3.0/deepethogram.egg-info/requires.txt +16 -0
  82. deepethogram-0.3.0/pyproject.toml +108 -0
  83. deepethogram-0.3.0/tests/test_data.py +28 -0
  84. deepethogram-0.3.0/tests/test_flow_generator.py +31 -0
  85. deepethogram-0.3.0/tests/test_gui.py +33 -0
  86. deepethogram-0.3.0/tests/test_integration.py +182 -0
  87. deepethogram-0.3.0/tests/test_models.py +18 -0
  88. deepethogram-0.3.0/tests/test_projects.py +119 -0
  89. deepethogram-0.3.0/tests/test_softmax.py +0 -0
  90. deepethogram-0.3.0/tests/test_z_score.py +21 -0
  91. deepethogram-0.1.3/deepethogram/conf/__pycache__/__init__.cpython-37.pyc +0 -0
  92. deepethogram-0.1.3/deepethogram/data/dali.py +0 -189
  93. deepethogram-0.1.3/deepethogram/data/dataloaders.py +0 -433
  94. deepethogram-0.1.3/deepethogram/flow_generator/__init__.py +0 -1
  95. deepethogram-0.1.3/deepethogram/flow_generator/models/__init__.py +0 -1
  96. deepethogram-0.1.3/deepethogram.egg-info/requires.txt +0 -15
  97. deepethogram-0.1.3/setup.py +0 -22
  98. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/__init__.py +0 -0
  99. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/project/project_config_default.yaml +0 -0
  100. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/conf/zscore.yaml +0 -0
  101. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/data/__init__.py +0 -0
  102. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/__init__.py +0 -0
  103. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/__main__.py +0 -0
  104. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/models/__init__.py +0 -0
  105. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/feature_extractor/models/classifiers/__init__.py +0 -0
  106. {deepethogram-0.1.3/deepethogram/gui → deepethogram-0.3.0/deepethogram/flow_generator}/__init__.py +0 -0
  107. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/flow_generator/__main__.py +0 -0
  108. {deepethogram-0.1.3/deepethogram/sequence → deepethogram-0.3.0/deepethogram/flow_generator/models}/__init__.py +0 -0
  109. {deepethogram-0.1.3/deepethogram/sequence/models → deepethogram-0.3.0/deepethogram/gui}/__init__.py +0 -0
  110. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/gui/icons/noun_Home_1158721.png +0 -0
  111. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/gui/icons/noun_Zoom In_744781.png +0 -0
  112. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/gui/icons/noun_pause_159135.png +0 -0
  113. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/gui/icons/noun_play_1713293.png +0 -0
  114. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram/gui/icons/noun_tap_145047.png +0 -0
  115. {deepethogram-0.1.3/deepethogram/tune → deepethogram-0.3.0/deepethogram/sequence}/__init__.py +0 -0
  116. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram.egg-info/dependency_links.txt +0 -0
  117. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram.egg-info/entry_points.txt +0 -0
  118. {deepethogram-0.1.3 → deepethogram-0.3.0}/deepethogram.egg-info/top_level.txt +0 -0
  119. {deepethogram-0.1.3 → deepethogram-0.3.0}/setup.cfg +0 -0
@@ -1,3 +1,3 @@
1
1
  include README.md
2
2
  include deepethogram/gui/icons/*.png
3
- recursive-include deepethogram/conf *
3
+ recursive-include deepethogram/conf *
@@ -1,22 +1,35 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: deepethogram
3
- Version: 0.1.3
3
+ Version: 0.3.0
4
4
  Summary: Temporal action detection for biology
5
- Author: Jim Bohnslav
6
- Author-email: jbohnslav@gmail.com
7
- License: UNKNOWN
8
- Platform: UNKNOWN
5
+ Author-email: Jim Bohnslav <jbohnslav@gmail.com>
9
6
  Classifier: Programming Language :: Python :: 3
10
7
  Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.6
8
+ Requires-Python: <3.12,>=3.9
12
9
  Description-Content-Type: text/markdown
10
+ Requires-Dist: chardet
11
+ Requires-Dist: h5py
12
+ Requires-Dist: kornia>=0.5
13
+ Requires-Dist: matplotlib
14
+ Requires-Dist: numpy
15
+ Requires-Dist: omegaconf>=2
16
+ Requires-Dist: opencv-python-headless
17
+ Requires-Dist: opencv-transforms
18
+ Requires-Dist: pandas<2.1,>=1.5
19
+ Requires-Dist: PySide6>=6.6.0
20
+ Requires-Dist: scikit-learn<1.4,>=1.2
21
+ Requires-Dist: scipy<1.11,>=1.9
22
+ Requires-Dist: torch==2.4.1
23
+ Requires-Dist: tqdm
24
+ Requires-Dist: vidio
25
+ Requires-Dist: pytorch_lightning==1.6.5
13
26
 
14
27
  # DeepEthogram
15
28
  - Written by Jim Bohnslav, except where as noted
16
29
  - JBohnslav@gmail.com
17
30
 
18
- DeepEthogram is an open-source package for automatically classifying each frame of a video into a set of pre-defined
19
- behaviors. Designed for neuroscience research, it could be used in any scenario where you need to detect actions from
31
+ DeepEthogram is an open-source package for automatically classifying each frame of a video into a set of pre-defined
32
+ behaviors. Designed for neuroscience research, it could be used in any scenario where you need to detect actions from
20
33
  each frame of a video.
21
34
 
22
35
  Example use cases:
@@ -25,7 +38,7 @@ Example use cases:
25
38
  * Counting licks from video for appetite measurement
26
39
  * Measuring reach onset times for alignment with neural activity
27
40
 
28
- DeepEthogram uses state-of-the-art algorithms for *temporal action detection*. We build on the following previous machine
41
+ DeepEthogram uses state-of-the-art algorithms for *temporal action detection*. We build on the following previous machine
29
42
  learning research into action detection:
30
43
  * [Hidden Two-Stream Convolutional Networks for Action Recognition](https://arxiv.org/abs/1704.00389)
31
44
  * [Temporal Gaussian Mixture Layer for Videos](https://arxiv.org/abs/1803.06316)
@@ -33,51 +46,74 @@ learning research into action detection:
33
46
  ![deepethogram schematic](docs/images/deepethogram_schematic.png)
34
47
 
35
48
  ## Installation
36
- For full installation instructions, see [this readme file](docs/installation.md).
49
+ DeepEthogram recently migrated from Miniconda/pip to [uv](https://docs.astral.sh/uv/). Current releases are uv-first,
50
+ recommend Python 3.11, support Python `>=3.9,<3.12`, and use PySide6 for the GUI.
37
51
 
38
- In brief:
39
- * [Install PyTorch](https://pytorch.org/)
40
- * `pip install deepethogram`
52
+ Install uv first:
53
+
54
+ ```bash
55
+ curl -LsSf https://astral.sh/uv/install.sh | sh
56
+ # or
57
+ brew install uv
58
+ ```
59
+
60
+ For development from this repository:
61
+
62
+ ```bash
63
+ git clone https://github.com/jbohnslav/deepethogram.git
64
+ cd deepethogram
65
+ uv sync
66
+ uv run deepethogram
67
+ ```
68
+
69
+ For a user install:
70
+
71
+ ```bash
72
+ uv pip install deepethogram
73
+ ```
74
+
75
+ Detailed setup, troubleshooting, and legacy conda/pip instructions for older releases are in [docs/installation.md](docs/installation.md).
41
76
 
42
77
  ## Data
43
- **NEW!** All datasets collected and annotated by the DeepEthogram authors are now available from this DropBox link:
78
+ **NEW!** All datasets collected and annotated by the DeepEthogram authors are now available from this DropBox link:
44
79
  https://www.dropbox.com/sh/3lilfob0sz21och/AABv8o8KhhRQhYCMNu0ilR8wa?dl=0
45
80
 
46
- If you have issues downloading the data, please raise an issue on Github.
81
+ If you have issues downloading the data, please raise an issue on Github.
47
82
 
48
83
  ## COLAB
49
- I've written a Colab notebook that shows how to upload your data and train models. You can also use this if you don't
50
- have access to a decent GPU.
84
+ I've written a Colab notebook that shows how to upload your data and train models. You can also use this if you don't
85
+ have access to a decent GPU.
51
86
 
52
- To use it, please [click this link to the Colab notebook](https://colab.research.google.com/drive/1Nf9FU7FD77wgvbUFc608839v2jPYgDhd?usp=sharing).
53
- Then, click `copy to Drive` at the top. You won't be able to save your changes to the notebook as-is.
87
+ To use it, please [click this link to the Colab notebook](https://colab.research.google.com/drive/1Nf9FU7FD77wgvbUFc608839v2jPYgDhd?usp=sharing).
88
+ Then, click `copy to Drive` at the top. You won't be able to save your changes to the notebook as-is.
54
89
 
55
90
 
56
91
  ## News
57
- DeepEthogram is now in Beta, version 0.1! There are major changes to the codebase and to model training and inference. Model performance, measured by F1, accuracy, etc. should be higher in version 0.1. Model training times and inference times should be dramatically reduced. For full information, see [the DeepEthogram Beta docs](docs/beta.md)
92
+ We now support docker! Docker is a way to run `deepethogram` in completely reproducible environments, without interacting
93
+ with other system dependencies. [See docs/Docker for more information](docs/docker.md)
58
94
 
59
95
  ## Pretrained models
60
- Rather than start from scratch, we will start with model weights pretrained on the Kinetics700 dataset. Go to
96
+ Rather than start from scratch, we will start with model weights pretrained on the Kinetics700 dataset. Go to
61
97
  To download the pretrained weights, please use [this Google Drive link](https://drive.google.com/file/d/1ntIZVbOG1UAiFVlsAAuKEBEVCVevyets/view?usp=sharing).
62
- Unzip the files in your `project/models` directory. Make sure that you don't add an extra directory when unzipping! The path should be
98
+ Unzip the files in your `project/models` directory. Make sure that you don't add an extra directory when unzipping! The path should be
63
99
  `your_project/models/pretrained_models/{models 1:6}`, not `your_project/models/pretrained_models/pretrained_models/{models1:6}`.
64
100
 
65
101
  ## Licensing
66
102
  Copyright (c) 2020 - President and Fellows of Harvard College. All rights reserved.
67
103
 
68
- This software is free for academic use. For commercial use, please contact the Harvard Office of Technology
69
- Development (hms_otd@harvard.edu) with cc to Dr. Chris Harvey. For details, see [license.txt](license.txt).
104
+ This software is free for academic use. For commercial use, please contact the Harvard Office of Technology
105
+ Development (hms_otd@harvard.edu) with cc to Dr. Chris Harvey. For details, see [license.txt](license.txt).
70
106
 
71
107
  ## Usage
72
108
  ### [To use the GUI, click](docs/using_gui.md)
73
109
  #### [To use the command line interface, click](docs/using_CLI.md)
74
110
 
75
111
  ## Dependencies
76
- The major dependencies for DeepEthogram are as follows:
112
+ The major dependencies for DeepEthogram are as follows:
77
113
  * pytorch, torchvision: all the neural networks, training, and inference pipelines were written in PyTorch
78
114
  * pytorch-lightning: for nice model training base classes
79
115
  * kornia: for GPU-based image augmentations
80
- * pyside2: for the GUI
116
+ * PySide6: for the GUI
81
117
  * opencv: for video and image reading and writing
82
118
  * opencv_transforms: for fast image augmentation
83
119
  * scikit-learn, scipy: for binary classification metrics
@@ -88,33 +124,67 @@ The major dependencies for DeepEthogram are as follows:
88
124
  * tqdm: for nice progress bars
89
125
 
90
126
  ## Hardware requirements
91
- For GUI usage, we expect that the users will be working on a local workstation with a good NVIDIA graphics card. For training via a cluster, you can use the command line interface.
127
+ For GUI usage, we expect that the users will be working on a local workstation with a good NVIDIA graphics card. For training via a cluster, you can use the command line interface.
92
128
 
93
129
  * CPU: 4 cores or more for parallel data loading
94
130
  * Hard Drive: SSD at minimum, NVMe drive is better.
95
- * GPU: DeepEthogram speed is directly related to GPU performance. An NVIDIA GPU is absolutely required, as PyTorch uses
96
- CUDA, while AMD does not.
131
+ * GPU: DeepEthogram speed is directly related to GPU performance. An NVIDIA GPU is absolutely required, as PyTorch uses
132
+ CUDA, while AMD does not.
97
133
  The more VRAM you have, the more data you can fit in one batch, which generally increases performance. a
98
134
  I'd recommend 6GB VRAM at absolute minimum. 8GB is better, with 10+ GB preferred.
99
- Recommended GPUs: `RTX 3090`, `RTX 3080`, `Titan RTX`, `2080 Ti`, `2080 super`, `2080`, `1080 Ti`, `2070 super`, `2070`
100
- Some older ones might also be fine, like a `1080` or even `1070 Ti`/ `1070`.
135
+ Recommended GPUs: `RTX 3090`, `RTX 3080`, `Titan RTX`, `2080 Ti`, `2080 super`, `2080`, `1080 Ti`, `2070 super`, `2070`
136
+ Some older ones might also be fine, like a `1080` or even `1070 Ti`/ `1070`.
101
137
 
102
138
  ## testing
103
- Test coverage is still low, but in the future we will be expanding our unit tests.
139
+ Test coverage is still low, but in the future we will be expanding our unit tests.
104
140
 
105
141
  First, download a copy of [`testing_deepethogram_archive.zip`](https://drive.google.com/file/d/1IFz4ABXppVxyuhYik8j38k9-Fl9kYKHo/view?usp=sharing)
106
- Make a directory in tests called `DATA`. Unzip this and move it to the `deepethogram/tests/DATA`
107
- directory, so that the path is `deepethogram/tests/DATA/testing_deepethogram_archive/{DATA,models,project_config.yaml}`. Then run `pytest tests/` to run.
108
- the `zz_commandline` test module will take a few minutes, as it is an end-to-end test that performs model training
109
- and inference. Its name reflects the fact that it should come last in testing.
142
+ Make a directory in tests called `DATA`. Unzip this and move it to the `deepethogram/tests/DATA`
143
+ directory, so that the path is `deepethogram/tests/DATA/testing_deepethogram_archive/{DATA,models,project_config.yaml}`.
144
+
145
+ To run tests:
146
+ ```bash
147
+ # Run all tests except GPU tests (default)
148
+ uv run pytest tests/
149
+
150
+ # Run only GPU tests (requires NVIDIA GPU)
151
+ uv run pytest -m gpu
152
+
153
+ # Run all tests including GPU tests
154
+ uv run pytest -m ""
155
+ ```
156
+
157
+ GPU tests are skipped by default as they require significant computational resources and time to complete. These tests perform end-to-end model training and inference.
158
+
159
+ ## Developer Guide
160
+ ### Code Style and Pre-commit Hooks
161
+ We use pre-commit hooks to maintain code quality and consistency. The hooks include:
162
+ - Ruff for Python linting and formatting
163
+ - Various file checks (trailing whitespace, YAML validation, etc.)
164
+
165
+ To set up the development environment:
166
+
167
+ 1. Install the development dependencies:
168
+ ```bash
169
+ uv sync --dev
170
+ ```
171
+
172
+ 2. Install pre-commit hooks:
173
+ ```bash
174
+ uvx pre-commit install
175
+ ```
176
+
177
+ The hooks will run automatically on every commit. You can also run them manually on all files:
178
+ ```bash
179
+ uvx pre-commit run --all-files
180
+ ```
110
181
 
111
182
  ## Changelog
183
+ * 0.1.4: bugfixes for dependencies; added docker
112
184
  * 0.1.2/3: fixes for multiclass (not multilabel) training
113
185
  * 0.1.1.post1/2: batch prediction
114
186
  * 0.1.1.post0: flow generator metric bug fix
115
187
  * 0.1.1: bug fixes
116
- * 0.1: deepethogram beta! See above for details.
188
+ * 0.1: deepethogram beta! See above for details.
117
189
  * 0.0.1.post1: bug fixes and video conversion scripts added
118
190
  * 0.0.1: initial version
119
-
120
-
@@ -1,22 +1,9 @@
1
- Metadata-Version: 2.1
2
- Name: deepethogram
3
- Version: 0.1.3
4
- Summary: Temporal action detection for biology
5
- Author: Jim Bohnslav
6
- Author-email: jbohnslav@gmail.com
7
- License: UNKNOWN
8
- Platform: UNKNOWN
9
- Classifier: Programming Language :: Python :: 3
10
- Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.6
12
- Description-Content-Type: text/markdown
13
-
14
1
  # DeepEthogram
15
2
  - Written by Jim Bohnslav, except where as noted
16
3
  - JBohnslav@gmail.com
17
4
 
18
- DeepEthogram is an open-source package for automatically classifying each frame of a video into a set of pre-defined
19
- behaviors. Designed for neuroscience research, it could be used in any scenario where you need to detect actions from
5
+ DeepEthogram is an open-source package for automatically classifying each frame of a video into a set of pre-defined
6
+ behaviors. Designed for neuroscience research, it could be used in any scenario where you need to detect actions from
20
7
  each frame of a video.
21
8
 
22
9
  Example use cases:
@@ -25,7 +12,7 @@ Example use cases:
25
12
  * Counting licks from video for appetite measurement
26
13
  * Measuring reach onset times for alignment with neural activity
27
14
 
28
- DeepEthogram uses state-of-the-art algorithms for *temporal action detection*. We build on the following previous machine
15
+ DeepEthogram uses state-of-the-art algorithms for *temporal action detection*. We build on the following previous machine
29
16
  learning research into action detection:
30
17
  * [Hidden Two-Stream Convolutional Networks for Action Recognition](https://arxiv.org/abs/1704.00389)
31
18
  * [Temporal Gaussian Mixture Layer for Videos](https://arxiv.org/abs/1803.06316)
@@ -33,51 +20,74 @@ learning research into action detection:
33
20
  ![deepethogram schematic](docs/images/deepethogram_schematic.png)
34
21
 
35
22
  ## Installation
36
- For full installation instructions, see [this readme file](docs/installation.md).
23
+ DeepEthogram recently migrated from Miniconda/pip to [uv](https://docs.astral.sh/uv/). Current releases are uv-first,
24
+ recommend Python 3.11, support Python `>=3.9,<3.12`, and use PySide6 for the GUI.
25
+
26
+ Install uv first:
27
+
28
+ ```bash
29
+ curl -LsSf https://astral.sh/uv/install.sh | sh
30
+ # or
31
+ brew install uv
32
+ ```
33
+
34
+ For development from this repository:
35
+
36
+ ```bash
37
+ git clone https://github.com/jbohnslav/deepethogram.git
38
+ cd deepethogram
39
+ uv sync
40
+ uv run deepethogram
41
+ ```
37
42
 
38
- In brief:
39
- * [Install PyTorch](https://pytorch.org/)
40
- * `pip install deepethogram`
43
+ For a user install:
44
+
45
+ ```bash
46
+ uv pip install deepethogram
47
+ ```
48
+
49
+ Detailed setup, troubleshooting, and legacy conda/pip instructions for older releases are in [docs/installation.md](docs/installation.md).
41
50
 
42
51
  ## Data
43
- **NEW!** All datasets collected and annotated by the DeepEthogram authors are now available from this DropBox link:
52
+ **NEW!** All datasets collected and annotated by the DeepEthogram authors are now available from this DropBox link:
44
53
  https://www.dropbox.com/sh/3lilfob0sz21och/AABv8o8KhhRQhYCMNu0ilR8wa?dl=0
45
54
 
46
- If you have issues downloading the data, please raise an issue on Github.
55
+ If you have issues downloading the data, please raise an issue on Github.
47
56
 
48
57
  ## COLAB
49
- I've written a Colab notebook that shows how to upload your data and train models. You can also use this if you don't
50
- have access to a decent GPU.
58
+ I've written a Colab notebook that shows how to upload your data and train models. You can also use this if you don't
59
+ have access to a decent GPU.
51
60
 
52
- To use it, please [click this link to the Colab notebook](https://colab.research.google.com/drive/1Nf9FU7FD77wgvbUFc608839v2jPYgDhd?usp=sharing).
53
- Then, click `copy to Drive` at the top. You won't be able to save your changes to the notebook as-is.
61
+ To use it, please [click this link to the Colab notebook](https://colab.research.google.com/drive/1Nf9FU7FD77wgvbUFc608839v2jPYgDhd?usp=sharing).
62
+ Then, click `copy to Drive` at the top. You won't be able to save your changes to the notebook as-is.
54
63
 
55
64
 
56
65
  ## News
57
- DeepEthogram is now in Beta, version 0.1! There are major changes to the codebase and to model training and inference. Model performance, measured by F1, accuracy, etc. should be higher in version 0.1. Model training times and inference times should be dramatically reduced. For full information, see [the DeepEthogram Beta docs](docs/beta.md)
66
+ We now support docker! Docker is a way to run `deepethogram` in completely reproducible environments, without interacting
67
+ with other system dependencies. [See docs/Docker for more information](docs/docker.md)
58
68
 
59
69
  ## Pretrained models
60
- Rather than start from scratch, we will start with model weights pretrained on the Kinetics700 dataset. Go to
70
+ Rather than start from scratch, we will start with model weights pretrained on the Kinetics700 dataset. Go to
61
71
  To download the pretrained weights, please use [this Google Drive link](https://drive.google.com/file/d/1ntIZVbOG1UAiFVlsAAuKEBEVCVevyets/view?usp=sharing).
62
- Unzip the files in your `project/models` directory. Make sure that you don't add an extra directory when unzipping! The path should be
72
+ Unzip the files in your `project/models` directory. Make sure that you don't add an extra directory when unzipping! The path should be
63
73
  `your_project/models/pretrained_models/{models 1:6}`, not `your_project/models/pretrained_models/pretrained_models/{models1:6}`.
64
74
 
65
75
  ## Licensing
66
76
  Copyright (c) 2020 - President and Fellows of Harvard College. All rights reserved.
67
77
 
68
- This software is free for academic use. For commercial use, please contact the Harvard Office of Technology
69
- Development (hms_otd@harvard.edu) with cc to Dr. Chris Harvey. For details, see [license.txt](license.txt).
78
+ This software is free for academic use. For commercial use, please contact the Harvard Office of Technology
79
+ Development (hms_otd@harvard.edu) with cc to Dr. Chris Harvey. For details, see [license.txt](license.txt).
70
80
 
71
81
  ## Usage
72
82
  ### [To use the GUI, click](docs/using_gui.md)
73
83
  #### [To use the command line interface, click](docs/using_CLI.md)
74
84
 
75
85
  ## Dependencies
76
- The major dependencies for DeepEthogram are as follows:
86
+ The major dependencies for DeepEthogram are as follows:
77
87
  * pytorch, torchvision: all the neural networks, training, and inference pipelines were written in PyTorch
78
88
  * pytorch-lightning: for nice model training base classes
79
89
  * kornia: for GPU-based image augmentations
80
- * pyside2: for the GUI
90
+ * PySide6: for the GUI
81
91
  * opencv: for video and image reading and writing
82
92
  * opencv_transforms: for fast image augmentation
83
93
  * scikit-learn, scipy: for binary classification metrics
@@ -88,33 +98,67 @@ The major dependencies for DeepEthogram are as follows:
88
98
  * tqdm: for nice progress bars
89
99
 
90
100
  ## Hardware requirements
91
- For GUI usage, we expect that the users will be working on a local workstation with a good NVIDIA graphics card. For training via a cluster, you can use the command line interface.
101
+ For GUI usage, we expect that the users will be working on a local workstation with a good NVIDIA graphics card. For training via a cluster, you can use the command line interface.
92
102
 
93
103
  * CPU: 4 cores or more for parallel data loading
94
104
  * Hard Drive: SSD at minimum, NVMe drive is better.
95
- * GPU: DeepEthogram speed is directly related to GPU performance. An NVIDIA GPU is absolutely required, as PyTorch uses
96
- CUDA, while AMD does not.
105
+ * GPU: DeepEthogram speed is directly related to GPU performance. An NVIDIA GPU is absolutely required, as PyTorch uses
106
+ CUDA, while AMD does not.
97
107
  The more VRAM you have, the more data you can fit in one batch, which generally increases performance. a
98
108
  I'd recommend 6GB VRAM at absolute minimum. 8GB is better, with 10+ GB preferred.
99
- Recommended GPUs: `RTX 3090`, `RTX 3080`, `Titan RTX`, `2080 Ti`, `2080 super`, `2080`, `1080 Ti`, `2070 super`, `2070`
100
- Some older ones might also be fine, like a `1080` or even `1070 Ti`/ `1070`.
109
+ Recommended GPUs: `RTX 3090`, `RTX 3080`, `Titan RTX`, `2080 Ti`, `2080 super`, `2080`, `1080 Ti`, `2070 super`, `2070`
110
+ Some older ones might also be fine, like a `1080` or even `1070 Ti`/ `1070`.
101
111
 
102
112
  ## testing
103
- Test coverage is still low, but in the future we will be expanding our unit tests.
113
+ Test coverage is still low, but in the future we will be expanding our unit tests.
104
114
 
105
115
  First, download a copy of [`testing_deepethogram_archive.zip`](https://drive.google.com/file/d/1IFz4ABXppVxyuhYik8j38k9-Fl9kYKHo/view?usp=sharing)
106
- Make a directory in tests called `DATA`. Unzip this and move it to the `deepethogram/tests/DATA`
107
- directory, so that the path is `deepethogram/tests/DATA/testing_deepethogram_archive/{DATA,models,project_config.yaml}`. Then run `pytest tests/` to run.
108
- the `zz_commandline` test module will take a few minutes, as it is an end-to-end test that performs model training
109
- and inference. Its name reflects the fact that it should come last in testing.
116
+ Make a directory in tests called `DATA`. Unzip this and move it to the `deepethogram/tests/DATA`
117
+ directory, so that the path is `deepethogram/tests/DATA/testing_deepethogram_archive/{DATA,models,project_config.yaml}`.
118
+
119
+ To run tests:
120
+ ```bash
121
+ # Run all tests except GPU tests (default)
122
+ uv run pytest tests/
123
+
124
+ # Run only GPU tests (requires NVIDIA GPU)
125
+ uv run pytest -m gpu
126
+
127
+ # Run all tests including GPU tests
128
+ uv run pytest -m ""
129
+ ```
130
+
131
+ GPU tests are skipped by default as they require significant computational resources and time to complete. These tests perform end-to-end model training and inference.
132
+
133
+ ## Developer Guide
134
+ ### Code Style and Pre-commit Hooks
135
+ We use pre-commit hooks to maintain code quality and consistency. The hooks include:
136
+ - Ruff for Python linting and formatting
137
+ - Various file checks (trailing whitespace, YAML validation, etc.)
138
+
139
+ To set up the development environment:
140
+
141
+ 1. Install the development dependencies:
142
+ ```bash
143
+ uv sync --dev
144
+ ```
145
+
146
+ 2. Install pre-commit hooks:
147
+ ```bash
148
+ uvx pre-commit install
149
+ ```
150
+
151
+ The hooks will run automatically on every commit. You can also run them manually on all files:
152
+ ```bash
153
+ uvx pre-commit run --all-files
154
+ ```
110
155
 
111
156
  ## Changelog
157
+ * 0.1.4: bugfixes for dependencies; added docker
112
158
  * 0.1.2/3: fixes for multiclass (not multilabel) training
113
159
  * 0.1.1.post1/2: batch prediction
114
160
  * 0.1.1.post0: flow generator metric bug fix
115
161
  * 0.1.1: bug fixes
116
- * 0.1: deepethogram beta! See above for details.
162
+ * 0.1: deepethogram beta! See above for details.
117
163
  * 0.0.1.post1: bug fixes and video conversion scripts added
118
164
  * 0.0.1: initial version
119
-
120
-
@@ -7,9 +7,12 @@
7
7
  # from deepethogram.sequence.inference import sequence_inference
8
8
  import importlib.util
9
9
 
10
- spec = importlib.util.find_spec('hydra')
10
+ spec = importlib.util.find_spec("hydra")
11
11
  if spec is not None:
12
- raise ValueError('Hydra installation found. Please run pip uninstall hydra-core: {}'.format(spec))
12
+ raise ValueError(
13
+ "Hydra installation found. Remove it from the current environment, for example with "
14
+ "`uv pip uninstall hydra-core`: {}".format(spec)
15
+ )
13
16
  # try:
14
17
  # import hydra
15
18
  # except Exception as e:
@@ -6,5 +6,5 @@ from deepethogram.gui.main import entry
6
6
  # def main(cfg: DictConfig) -> None:
7
7
  # run(cfg)
8
8
 
9
- if __name__ == '__main__':
10
- entry()
9
+ if __name__ == "__main__":
10
+ entry()