MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / evaluate_network

Function evaluate_network

deeplabcut/compat.py:382–573  ·  view source on GitHub ↗

Evaluates the network. Evaluates the network based on the saved models at different stages of the training network. The evaluation results are stored in the .h5 and .csv file under the subdirectory 'evaluation_results'. Change the snapshotindex parameter in the config file to 'all'

(
    config: str | Path,
    shuffles: Sequence[int] = (1,),
    trainingsetindex: int | str = 0,
    plotting: bool | str = False,
    show_errors: bool = True,
    comparison_bodyparts: str | list[str] = "all",
    gputouse: str | None = None,
    rescale: bool = False,
    modelprefix: str = "",
    per_keypoint_evaluation: bool = False,
    snapshots_to_evaluate: list[str] | None = None,
    pcutoff: float | list[float] | dict[str, float] | None = None,
    engine: Engine | None = None,
    **torch_kwargs,
)

Source from the content-addressed store, hash-verified

380@renamed_parameter(old="comparisonbodyparts", new="comparison_bodyparts", since="3.0.0")
381@renamed_parameter(old="Shuffles", new="shuffles", since="3.0.0")
382def evaluate_network(
383 config: str | Path,
384 shuffles: Sequence[int] = (1,),
385 trainingsetindex: int | str = 0,
386 plotting: bool | str = False,
387 show_errors: bool = True,
388 comparison_bodyparts: str | list[str] = "all",
389 gputouse: str | None = None,
390 rescale: bool = False,
391 modelprefix: str = "",
392 per_keypoint_evaluation: bool = False,
393 snapshots_to_evaluate: list[str] | None = None,
394 pcutoff: float | list[float] | dict[str, float] | None = None,
395 engine: Engine | None = None,
396 **torch_kwargs,
397):
398 """Evaluates the network.
399
400 Evaluates the network based on the saved models at different stages of the training
401 network. The evaluation results are stored in the .h5 and .csv file under the
402 subdirectory 'evaluation_results'. Change the snapshotindex parameter in the config
403 file to 'all' in order to evaluate all the saved models.
404
405 Parameters
406 ----------
407 config : string
408 Full path of the config.yaml file.
409
410 shuffles: sequence of int, optional, default=[1]
411 List of integers specifying the shuffle indices of the training dataset.
412
413 trainingsetindex: int or str, optional, default=0
414 Integer specifying which "TrainingsetFraction" to use.
415 Note that "TrainingFraction" is a list in config.yaml. This variable can also
416 be set to "all".
417
418 plotting: bool or str, optional, default=False
419 Plots the predictions on the train and test images.
420 If provided it must be either ``True``, ``False``, ``"bodypart"``, or
421 ``"individual"``. Setting to ``True`` defaults as ``"bodypart"`` for
422 multi-animal projects.
423 If a detector is used, the predicted bounding boxes will also be plotted.
424
425 show_errors: bool, optional, default=True
426 Display train and test errors.
427
428 comparison_bodyparts: str or list, optional, default="all"
429 The average error will be computed for those body parts only.
430 The provided list has to be a subset of the defined body parts.
431
432 gputouse: int or None, optional, default=None
433 Indicates the GPU to use (see number in ``nvidia-smi``). If you do not have a
434 GPU put `None``.
435 See: https://nvidia.custhelp.com/app/answers/detail/a_id/3751/~/useful-nvidia-smi-queries
436
437 rescale: bool, optional, default=False
438 Evaluate the model at the ``'global_scale'`` variable (as set in the
439 ``pose_config.yaml`` file for a particular project). I.e. every image will be

Callers

nothing calls this directly

Calls 5

get_shuffle_engineFunction · 0.90
evaluate_networkFunction · 0.90
_load_configFunction · 0.85
_update_deviceFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected