@@ -5,13 +5,11 @@ class Load:
55 """Base class to load tracking.txt files"""
66
77 def __init__ (self , path ):
8- """
9- Constructor for Load.
8+ """Constructor for Load class.
109
11- :param [path]: [Path to the tracking.txt file.]
12- :type [path]: [str]
13- ...
14- :raises [Exception]: []
10+ :param path: Path to the tracking.txt file.
11+ :type path: str
12+ :raises Exception
1513 """
1614 self .path = os .path .abspath (path )
1715 try :
@@ -20,82 +18,70 @@ def __init__(self, path):
2018 raise e
2119
2220 def getDataframe (self ):
23- """
24- Get the tracking data in a DataFrame.
21+ """Get the tracking data in a DataFrame.
2522
26- :raises [Exception]: [The selected file is empty]
27- ...
28- :return: [Tracking data]
29- :rtype: [DataFrame]
23+ :raises Exception: The selected file is empty
24+ :return: Tracking data
25+ :rtype: DataFrame
3026 """
3127 if self .tracking .empty :
3228 raise Exception ("The selected file is empty" )
3329 else :
3430 return self .tracking
3531
3632 def getObjectNumber (self ):
37- """
38- Get the total number of objects.
33+ """Get the total number of objects.
3934
40- ...
4135 :return: [Total number of objects]
4236 :rtype: [int]
4337 """
4438 maxObj = len (set (self .tracking .id .values ))
4539 return maxObj
4640
4741 def getObject (self , iD ):
48- """
49- Get the data for the object with id.
42+ """Get the data for the object with id.
5043
51- :param [iD]: [Id of the object.]
52- :type [index]: [int]
53- ...
54- :return: [Data for the object id.]
55- :rtype: [DataFrame]
44+ :param iD: Id of the object.
45+ :type index: int
46+ :return: Data for the object id.
47+ :rtype: DataFrame
5648 """
5749 objectData = self .tracking [self .tracking .id == iD ]
5850 return objectData
5951
6052 def getFrame (self , index ):
61- """
62- Get the data for the image number index.
53+ """Get the data for the image number index.
6354
64- :param [index]: [Index of the image.]
65- :type [index]: [int]
66- ...
67- :return: [Data for the image index.]
68- :rtype: [DataFrame]
55+ :param index: Index of the image.
56+ :type index: int
57+ :return: Data for the image index.
58+ :rtype: DataFrame
6959 """
7060 objectData = self .tracking [self .tracking .imageNumber == index ]
7161 return objectData
7262
7363 def getObjectInFrame (self , iD , index ):
74- """
75- Get the data for an object id is in a frame index.
64+ """Get the data for an object id is in a frame index.
7665
77- :param [iD]: [Id of the object.]
78- :type [index]: [int]
79- :param [index]: [Index of the image.]
80- :type [index]: [int]
81- ...
82- :return: [True if object id in frame index.]
83- :rtype: [bool]
66+ :param iD: [Id of the object.]
67+ :type iD: int
68+ :param index: Index of the image.
69+ :type index: int
70+ :return: True if object id in frame index.
71+ :rtype: bool
8472 """
8573 data = self .tracking [(self .tracking .imageNumber == index )& (self .tracking .id == iD )]
8674 return data
8775
8876 def isObjectInFrame (self , iD , index ):
89- """
90- Check if an object id is in a frame index.
77+ """Check if an object id is in a frame index.
9178
92- :param [iD]: [Id of the object.]
93- :type [index]: [int]
94- :param [index]: [Index of the image.]
95- :type [index]: [int]
96- ...
97- :return: [True if object id in frame index.]
98- :rtype: [bool]
79+ :param iD: Id of the object.
80+ :type index: int
81+ :param index: Index of the image.
82+ :type index: int
83+ :return: True if object id in frame index.
84+ :rtype: bool
9985 """
10086 data = self .tracking [(self .tracking .imageNumber == index )& (self .tracking .id == iD )]
10187 if data .empty :
0 commit comments