deeplabcut.pose_estimation_pytorch.runners.shelving
Modules used to read/write shelve data during video analysis in DeepLabCut 3.0.
Classes:
| Name | Description |
|---|---|
FeatureShelfWriter |
Writes bodypart features to a shelf on-the-fly for ReID model training. |
ShelfManager |
Class to manage shelf data. |
ShelfReader |
Reads data from a shelf. |
ShelfWriter |
Writes data to a shelf on-the-fly during video analysis. |
FeatureShelfWriter
Bases: ShelfWriter
Writes bodypart features to a shelf on-the-fly for ReID model training.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict
|
The test pose config for the model. |
required |
|
str | Path
|
The path where the data should be saved. |
required |
|
int | None
|
The number of frames in the video. Used to set the number of leading 0s in the keys of the dictionary. Default is 5 if the number of frames is not given. |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
filepath |
The path to the shelf. |
Methods:
| Name | Description |
|---|---|
add_prediction |
Adds the prediction for a frame to the shelf. |
Source code in deeplabcut/pose_estimation_pytorch/runners/shelving.py
add_prediction
Adds the prediction for a frame to the shelf.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ndarray
|
The predicted bodyparts. |
required |
|
ndarray | None
|
The features for the bodyparts. |
None
|
Source code in deeplabcut/pose_estimation_pytorch/runners/shelving.py
ShelfManager
Class to manage shelf data.
Methods:
| Name | Description |
|---|---|
close |
Closes the shelf. |
open |
Opens the shelf. |
Source code in deeplabcut/pose_estimation_pytorch/runners/shelving.py
close
ShelfReader
Bases: ShelfManager
Reads data from a shelf.
Methods:
| Name | Description |
|---|---|
__getitem__ |
Reads an item from the shelf. |
Source code in deeplabcut/pose_estimation_pytorch/runners/shelving.py
ShelfWriter
Bases: ShelfManager
Writes data to a shelf on-the-fly during video analysis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict
|
The test pose config for the model. |
required |
|
str | Path
|
The path where the data should be saved. |
required |
|
int | None
|
The number of frames in the video. Used to set the number of leading 0s in the keys of the dictionary. Default is 5 if the number of frames is not given. |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
filepath |
The path to the shelf. |
Methods:
| Name | Description |
|---|---|
add_prediction |
Adds the prediction for a frame to the shelf. |
close |
Closes the shelf and writes the updated metadata. |
open |
Opens the shelf. |
Source code in deeplabcut/pose_estimation_pytorch/runners/shelving.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
add_prediction
add_prediction(
bodyparts: ndarray, unique_bodyparts: ndarray | None = None, identity_scores: ndarray | None = None, **kwargs
) -> None
Adds the prediction for a frame to the shelf.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ndarray
|
The predicted bodyparts. |
required |
|
ndarray | None
|
The predicted unique bodyparts, if there are any. |
None
|
|
ndarray | None
|
The predicted identities, if there are any. |
None
|
Source code in deeplabcut/pose_estimation_pytorch/runners/shelving.py
close
Closes the shelf and writes the updated metadata.
Source code in deeplabcut/pose_estimation_pytorch/runners/shelving.py
open
Opens the shelf.