Example #1
0
def label_frames(config, multiple_individualsGUI=False, imtypes=["*.png"]):
    """
    Manually label/annotate the extracted frames. Update the list of body parts you want to localize in the config.yaml file first.

    Parameter
    ----------
    config : string
        String containing the full path of the config file in the project.

    multiple_individualsGUI: bool, optional
          If this is set to True, a user can label multiple individuals. Note for "multianimalproject=True" this is automatically used.
          The default is ``False``; if provided it must be either ``True`` or ``False``.

    imtypes: list of imagetypes to look for in folder to be labeled. By default only png images are considered.

    Example
    --------
    Standard use case:
    >>> deeplabcut.label_frames('/myawesomeproject/reaching4thestars/config.yaml')

    To label multiple individuals (without having a multiple individuals project); otherwise this GUI is loaded automatically
    >>> deeplabcut.label_frames('/analysis/project/reaching-task/config.yaml',multiple_individualsGUI=True)

    To label other image types
    >>> label_frames(config,multiple=False,imtypes=['*.jpg','*.jpeg'])
    --------

    """
    startpath = os.getcwd()
    wd = Path(config).resolve().parents[0]
    os.chdir(str(wd))
    cfg = auxiliaryfunctions.read_config(config)
    if cfg.get("multianimalproject", False) or multiple_individualsGUI:
        from deeplabcut.generate_training_dataset import (
            multiple_individuals_labeling_toolbox,
        )

        multiple_individuals_labeling_toolbox.show(config)
    else:
        from deeplabcut.generate_training_dataset import labeling_toolbox

        labeling_toolbox.show(config, imtypes=imtypes)

    os.chdir(startpath)
Example #2
0
def label_frames(config, multiple=False, imtypes=['*.png']):
    """
    Manually label/annotate the extracted frames. Update the list of body parts you want to localize in the config.yaml file first.

    Parameter
    ----------
    config : string
        String containing the full path of the config file in the project.

    multiple: bool, optional
        If this is set to True, a user can label multiple individuals.
        The default is ``False``; if provided it must be either ``True`` or ``False``.

    imtypes: list of imagetypes to look for in folder to be labeled. By default only png images are considered.

    Example
    --------
    Standard use case:
    >>> deeplabcut.label_frames('/myawesomeproject/reaching4thestars/config.yaml')

    To label multiple individuals
    >>> deeplabcut.label_frames('/analysis/project/reaching-task/config.yaml',multiple=True)

    To label other image types
    >>> label_frames(config,multiple=False,imtypes=['*.jpg','*.jpeg'])

    --------

    """
    startpath = os.getcwd()
    wd = Path(config).resolve().parents[0]
    os.chdir(str(wd))

    if multiple == False:
        from deeplabcut.generate_training_dataset import labeling_toolbox

        # labeling_toolbox.show(config,Screens,scale_w,scale_h, winHack, img_scale)
        labeling_toolbox.show(config, imtypes=imtypes)
    else:
        from deeplabcut.generate_training_dataset import multiple_individuals_labeling_toolbox
        multiple_individuals_labeling_toolbox.show(config)

    os.chdir(startpath)