MCPcopy Create free account
hub / github.com/DeepLabCut/DeepLabCut / analyze_time_lapse_frames

Function analyze_time_lapse_frames

deeplabcut/compat.py:1315–1425  ·  view source on GitHub ↗

Analyzed all images (of type = frametype) in a folder and stores the output in one file. You can crop the frames (before analysis), by changing 'cropping'=True and setting 'x1','x2','y1','y2' in the config file. Output: The labels are stored as MultiIndex Pandas Array, which contai

(
    config: str,
    directory: str,
    frametype: str = ".png",
    shuffle: int = 1,
    trainingsetindex: int = 0,
    gputouse: int | None = None,
    device: str | None = None,
    save_as_csv: bool = False,
    modelprefix: str = "",
    engine: Engine | None = None,
)

Source from the content-addressed store, hash-verified

1313
1314
1315def analyze_time_lapse_frames(
1316 config: str,
1317 directory: str,
1318 frametype: str = ".png",
1319 shuffle: int = 1,
1320 trainingsetindex: int = 0,
1321 gputouse: int | None = None,
1322 device: str | None = None,
1323 save_as_csv: bool = False,
1324 modelprefix: str = "",
1325 engine: Engine | None = None,
1326):
1327 """Analyzed all images (of type = frametype) in a folder and stores the output in
1328 one file.
1329
1330 You can crop the frames (before analysis), by changing 'cropping'=True and setting
1331 'x1','x2','y1','y2' in the config file.
1332
1333 Output: The labels are stored as MultiIndex Pandas Array, which contains the name
1334 of the network, body part name, (x, y) label position in pixels, and the likelihood
1335 for each frame per body part. These arrays are stored in an efficient Hierarchical
1336 Data Format (HDF) in the same directory, where the video is stored. However, if the
1337 flag save_as_csv is set to True, the data can also be exported in comma-separated
1338 values format (.csv), which in turn can be imported in many programs, such as
1339 MATLAB, R, Prism, etc.
1340
1341 Parameters
1342 ----------
1343 config : string
1344 Full path of the config.yaml file as a string.
1345
1346 directory: string
1347 Full path to directory containing the frames that shall be analyzed
1348
1349 frametype: string, optional
1350 Checks for the file extension of the frames. Only images with this extension are
1351 analyzed. The default is ``.png``
1352
1353 shuffle: int, optional
1354 An integer specifying the shuffle index of the training dataset used for
1355 training the network. The default is 1.
1356
1357 trainingsetindex: int, optional
1358 Integer specifying which TrainingsetFraction to use. By default the first (note
1359 that TrainingFraction is a list in config.yaml).
1360
1361 gputouse: int, optional.
1362 Only for TensorFlow models. For PyTorch models, please use `device`. Natural
1363 number indicating the number of your GPU (see number in nvidia-smi). If you do
1364 not have a GPU put None. See:
1365 https://nvidia.custhelp.com/app/answers/detail/a_id/3751/~/useful-nvidia-smi-queries
1366
1367 device: str, optional
1368 The CUDA device to use for training. If None, the device will be taken from the
1369 ``pytorch_config.yaml`` file. Examples: {"cpu", "cuda", "cuda:0", "cuda:1"}. For
1370 more information, see https://pytorch.org/docs/stable/notes/cuda.html
1371
1372 save_as_csv: bool, optional

Callers

nothing calls this directly

Calls 5

get_shuffle_engineFunction · 0.90
analyze_imagesFunction · 0.90
_load_configFunction · 0.85
_gpu_to_use_to_deviceFunction · 0.85

Tested by

no test coverage detected