read_locations#
tiatoolbox
.utils
.misc
.read_locations
- read_locations(input_table)[source]#
Read annotations as pandas DataFrame.
- :param input_table (str or pathlib.Path or
numpy.ndarray
or:pandas.DataFrame
): path to csv, npy or json. Input can also be a numpy.ndarray
orpandas.DataFrame
. First column in the table represents x position, second column represents y position. The third column represents the class. If the table has headers, the header should be x, y & class. Json should have x, y and class fields.
- Returns:
DataFrame with x, y location and class type.
- Return type:
pd.DataFrame
- Raises:
FileNotSupported – If the path to input table is not of supported type.
Examples
>>> from tiatoolbox.utils.misc import read_locations >>> labels = read_locations('./annotations.csv')
- :param input_table (str or pathlib.Path or