contextnet/utils/utils.py
def load_keypoints(file_path):
    """
    Load keypoints from a specific file as tuples

    Parameters
    ----------
    file_path : str
        path to the file with keypoints

    Returns
    -------
    keypoints : list of tuples
        list of keypoint tuples in format (x, y, obj_class)

    Note
    ----
    This function serves as helper for the pointdet.utils.dataset.PointsDataset class
    and probably should be moved there
    """

    keypoints = []

    with open(file_path, "r") as labels_file:
        for line in labels_file:
            line_contents = line.strip().split(" ")
            line_floated = tuple(int(float(x)) for x in line_contents)
            x_center, y_center, obj_class = tuple(line_floated)
            if obj_class == 2: # FIX ME
                obj_class = 0
            keypoint = x_center, y_center, obj_class
            keypoints.append(keypoint)

    return keypoints

    Load keypoints from a specific file as tuples

    Parameters
    ----------
    file_path : str
        path to the file with keypoints

    Returns
    -------
    keypoints : list of tuples
        list of keypoint tuples in format (x, y, obj_class)

    Note
    ----
    This function serves as helper for the pointdet.utils.dataset.PointsDataset class
    and probably should be moved there
    
Load keypoints from a specific file as tuples
Parameters

file_path : str
path to the file with keypoints

Returns

keypoints : list of tuples
list of keypoint tuples in format (x, y, obj_class)

Note

This function serves as helper for the pointdet.utils.dataset.PointsDataset class
and probably should be moved there
Load keypoints from a specific file as tuples Parameters file_path : str path to the file with keypoints Returns keypoints : list of tuples list of keypoint tuples in format ( x y obj_class ) Note This function serves as helper for the pointdet . utils . dataset . PointsDataset class and probably should be moved there
def load_keypoints(file_path):
    keypoints = []
    with open(file_path, "r") as labels_file:
        for line in labels_file:
            line_contents = line.strip().split(" ")
            line_floated = tuple(int(float(x)) for x in line_contents)
            x_center, y_center, obj_class = tuple(line_floated)
            if obj_class == 2: 
                obj_class = 0
            keypoint = x_center, y_center, obj_class
            keypoints.append(keypoint)
    return keypoints
def load_keypoints ( file_path ) : keypoints = [ ] with open ( file_path , "r" ) as labels_file : for line in labels_file : line_contents = line . strip ( ) . split ( " " ) line_floated = tuple ( int ( float ( x ) ) for x in line_contents ) x_center , y_center , obj_class = tuple ( line_floated ) if obj_class == 2 : obj_class = 0 keypoint = x_center , y_center , obj_class keypoints . append ( keypoint ) return keypoints
Load keypoints from a specific file as tuples
Parameters
Load keypoints from a specific file as tuples Parameters
"""
    Load keypoints from a specific file as tuples

    Parameters
    ----------
    file_path : str
        path to the file with keypoints

    Returns
    -------
    keypoints : list of tuples
        list of keypoint tuples in format (x, y, obj_class)

    Note
    ----
    This function serves as helper for the pointdet.utils.dataset.PointsDataset class
    and probably should be moved there
    """ # FIX ME
file_path