tools/data/parse_file_list.py
def line_to_map(line):
        """A function to map line string to vid and label.

        Args:
            line (str): A long directory path, which is a text path.

        Returns:
            tuple[str, str]: (vid, label), vid is the video id,
                label is the video label.
        """
        items = line.strip().split()
        vid = osp.splitext(items[0])[0]
        if level == 1:
            vid = osp.basename(vid)
            label = items[0]
        elif level == 2:
            vid = osp.join(osp.basename(osp.dirname(vid)), osp.basename(vid))
            label = class_mapping[osp.dirname(items[0])]
        return vid, label
A function to map line string to vid and label.

        Args:
            line (str): A long directory path, which is a text path.

        Returns:
            tuple[str, str]: (vid, label), vid is the video id,
                label is the video label.
        
A function to map line string to vid and label.
A function to map line string to vid and label .
def line_to_map(line):
        items = line.strip().split()
        vid = osp.splitext(items[0])[0]
        if level == 1:
            vid = osp.basename(vid)
            label = items[0]
        elif level == 2:
            vid = osp.join(osp.basename(osp.dirname(vid)), osp.basename(vid))
            label = class_mapping[osp.dirname(items[0])]
        return vid, label
def line_to_map ( line ) : items = line . strip ( ) . split ( ) vid = osp . splitext ( items [ 0 ] ) [ 0 ] if level == 1 : vid = osp . basename ( vid ) label = items [ 0 ] elif level == 2 : vid = osp . join ( osp . basename ( osp . dirname ( vid ) ) , osp . basename ( vid ) ) label = class_mapping [ osp . dirname ( items [ 0 ] ) ] return vid , label
A function to map line string to vid and label.
A function to map line string to vid and label .
"""A function to map line string to vid and label.

        Args:
            line (str): A long directory path, which is a text path.

        Returns:
            tuple[str, str]: (vid, label), vid is the video id,
                label is the video label.
        """
(vid, label), vid is the video id,
label is the video label.
( vid label ) vid is the video id label is the video label .
tuple[str, str]
line
A long directory path, which is a text path.
A long directory path which is a text path .