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

Function create_labeled_video

deeplabcut/utils/make_labeled_video.py:395–787  ·  view source on GitHub ↗

Labels the bodyparts in a video. Make sure the video is already analyzed by the function ``deeplabcut.analyze_videos``. Parameters ---------- config : string Full path of the config.yaml file. videos : list[str] A list of strings containing the full paths t

(
    config: str,
    videos: list[str],
    video_extensions: str | Sequence[str] | None = None,
    shuffle: int = 1,
    trainingsetindex: int = 0,
    filtered: bool = False,
    fastmode: bool = True,
    save_frames: bool = False,
    keypoints_only: bool = False,
    Frames2plot: list[int] | None = None,
    displayedbodyparts: list[str] | str = "all",
    displayedindividuals: list[str] | str = "all",
    codec: str = "mp4v",
    outputframerate: int | None = None,
    destfolder: Path | str | None = None,
    draw_skeleton: bool = False,
    trailpoints: int = 0,
    displaycropped: bool = False,
    color_by: str = "bodypart",
    modelprefix: str = "",
    init_weights: str = "",
    track_method: str = "",
    superanimal_name: str = "",
    pcutoff: float | None = None,
    skeleton: list = None,
    skeleton_color: str = "white",
    dotsize: int = 8,
    colormap: str = "rainbow",
    alphavalue: float = 0.5,
    overwrite: bool = False,
    confidence_to_alpha: bool | Callable[[float], float] = False,
    plot_bboxes: bool = True,
    bboxes_pcutoff: float | None = None,
    max_workers: int | None = None,
    **kwargs,
)

Source from the content-addressed store, hash-verified

393
394@renamed_parameter(old="videotype", new="video_extensions", since="3.0.0")
395def create_labeled_video(
396 config: str,
397 videos: list[str],
398 video_extensions: str | Sequence[str] | None = None,
399 shuffle: int = 1,
400 trainingsetindex: int = 0,
401 filtered: bool = False,
402 fastmode: bool = True,
403 save_frames: bool = False,
404 keypoints_only: bool = False,
405 Frames2plot: list[int] | None = None,
406 displayedbodyparts: list[str] | str = "all",
407 displayedindividuals: list[str] | str = "all",
408 codec: str = "mp4v",
409 outputframerate: int | None = None,
410 destfolder: Path | str | None = None,
411 draw_skeleton: bool = False,
412 trailpoints: int = 0,
413 displaycropped: bool = False,
414 color_by: str = "bodypart",
415 modelprefix: str = "",
416 init_weights: str = "",
417 track_method: str = "",
418 superanimal_name: str = "",
419 pcutoff: float | None = None,
420 skeleton: list = None,
421 skeleton_color: str = "white",
422 dotsize: int = 8,
423 colormap: str = "rainbow",
424 alphavalue: float = 0.5,
425 overwrite: bool = False,
426 confidence_to_alpha: bool | Callable[[float], float] = False,
427 plot_bboxes: bool = True,
428 bboxes_pcutoff: float | None = None,
429 max_workers: int | None = None,
430 **kwargs,
431):
432 """Labels the bodyparts in a video.
433
434 Make sure the video is already analyzed by the function
435 ``deeplabcut.analyze_videos``.
436
437 Parameters
438 ----------
439 config : string
440 Full path of the config.yaml file.
441
442 videos : list[str]
443 A list of strings containing the full paths to videos for analysis or a path
444 to the directory, where all the videos with same extension are stored.
445
446 video_extensions : str | Sequence[str] | None, optional, default=None
447 Controls how ``videos`` are filtered, based on file extension.
448 File paths and directory contents are treated differently:
449 - ``None`` (default): file paths are accepted as-is; directories are
450 scanned for files with a recognized video extension.
451 - ``str`` or ``Sequence[str]`` (e.g. ``"mp4"`` or ``["mp4", "avi"]``):
452 both file paths and directory contents are filtered by the given

Callers 2

after_adapt_inferenceMethod · 0.90

Calls 4

collect_video_pathsFunction · 0.90
read_configMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected