Skip to content

Commit b009a6c

Browse files
Added comments to 23 functions across 5 files
1 parent b918901 commit b009a6c

File tree

5 files changed

+808
-0
lines changed

5 files changed

+808
-0
lines changed

insect/environment_object_perception/src/ByteTrack/basetrack.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,41 @@ def end_frame(self):
3434

3535
@staticmethod
3636
def next_id():
37+
"""
38+
This function increments the count of `BaseTrack` objects by one and returns
39+
the new value of `BaseTrack._count`. It can be used to generate a unique
40+
ID for each object instance.
41+
42+
Returns:
43+
int: The output returned by the `next_id()` function is an integer
44+
representing the next available ID value in the `BaseTrack` class
45+
instance, incremented by 1 each time the function is called.
46+
47+
"""
3748
BaseTrack._count += 1
3849
return BaseTrack._count
3950

4051
@staticmethod
4152
def next_class_id(clase):
53+
"""
54+
This function increments the class id for a given class when it's encountered
55+
for the first time in a `BaseTrack` instance, and sets the class count to
56+
1 if the class is not already known. It returns the updated class count
57+
for that class.
58+
59+
Args:
60+
clase (str): The `clase` input parameter in the given function is used
61+
to identify the class for which the next class ID should be
62+
generated. It is a key component of the function's logic, as it
63+
determines which class the ID should be assigned to.
64+
65+
Returns:
66+
int: The `next_class_id` function increments a count for a class each
67+
time it's called, and stores the resulting count as the ID for that
68+
class in the `_class_count` dictionary. Therefore, the output of the
69+
function is the unique ID for the given class.
70+
71+
"""
4272
if clase in BaseTrack._class_count.keys():
4373
BaseTrack._class_count[clase] += 1
4474
else:

0 commit comments

Comments
 (0)