msaf/algorithms/fmc2d/utils_2dfmc.py
def json_to_bounds(segments_json):
    """Extracts the boundaries from a json file and puts them into
        an np array."""
    f = open(segments_json)
    segments = json.load(f)["segments"]
    bounds = []
    for segment in segments:
        bounds.append(segment["start"])
    bounds.append(bounds[-1] + segments[-1]["duration"]) # Add last boundary
    f.close()
    return np.asarray(bounds)
def json_to_bounds(segments_json):
    """Extracts the boundaries from a json file and puts them into
        an np array."""
    f = open(segments_json)
    segments = json.load(f)["segments"]
    bounds = []
    for segment in segments:
        bounds.append(segment["start"])
    bounds.append(bounds[-1] + segments[-1]["duration"]) # Add last boundary
    f.close()
    return np.asarray(bounds)
Extracts the boundaries from a json file and puts them into
        an np array.