Ruff Docstring formatting (#15793)
Signed-off-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
d27664216b
commit
776ca86369
60 changed files with 241 additions and 309 deletions
|
|
@ -29,7 +29,6 @@ class AIGym:
|
|||
pose_down_angle (float, optional): Angle threshold for the 'down' pose. Defaults to 90.0.
|
||||
pose_type (str, optional): Type of pose to detect ('pullup', 'pushup', 'abworkout'). Defaults to "pullup".
|
||||
"""
|
||||
|
||||
# Image and line thickness
|
||||
self.im0 = None
|
||||
self.tf = line_thickness
|
||||
|
|
@ -65,7 +64,6 @@ class AIGym:
|
|||
im0 (ndarray): Current frame from the video stream.
|
||||
results (list): Pose estimation data.
|
||||
"""
|
||||
|
||||
self.im0 = im0
|
||||
|
||||
if not len(results[0]):
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ class Analytics:
|
|||
save_img (bool): Whether to save the image.
|
||||
max_points (int): Specifies when to remove the oldest points in a graph for multiple lines.
|
||||
"""
|
||||
|
||||
self.bg_color = bg_color
|
||||
self.fg_color = fg_color
|
||||
self.view_img = view_img
|
||||
|
|
@ -115,7 +114,6 @@ class Analytics:
|
|||
frame_number (int): The current frame number.
|
||||
counts_dict (dict): Dictionary with class names as keys and counts as values.
|
||||
"""
|
||||
|
||||
x_data = np.array([])
|
||||
y_data_dict = {key: np.array([]) for key in counts_dict.keys()}
|
||||
|
||||
|
|
@ -177,7 +175,6 @@ class Analytics:
|
|||
frame_number (int): The current frame number.
|
||||
total_counts (int): The total counts to plot.
|
||||
"""
|
||||
|
||||
# Update line graph data
|
||||
x_data = self.line.get_xdata()
|
||||
y_data = self.line.get_ydata()
|
||||
|
|
@ -230,7 +227,7 @@ class Analytics:
|
|||
"""
|
||||
Write and display the line graph
|
||||
Args:
|
||||
im0 (ndarray): Image for processing
|
||||
im0 (ndarray): Image for processing.
|
||||
"""
|
||||
im0 = cv2.cvtColor(im0[:, :, :3], cv2.COLOR_RGBA2BGR)
|
||||
cv2.imshow(self.title, im0) if self.view_img else None
|
||||
|
|
@ -243,7 +240,6 @@ class Analytics:
|
|||
Args:
|
||||
count_dict (dict): Dictionary containing the count data to plot.
|
||||
"""
|
||||
|
||||
# Update bar graph data
|
||||
self.ax.clear()
|
||||
self.ax.set_facecolor(self.bg_color)
|
||||
|
|
@ -282,7 +278,6 @@ class Analytics:
|
|||
Args:
|
||||
classes_dict (dict): Dictionary containing the class data to plot.
|
||||
"""
|
||||
|
||||
# Update pie chart data
|
||||
labels = list(classes_dict.keys())
|
||||
sizes = list(classes_dict.values())
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ class Heatmap:
|
|||
shape="circle",
|
||||
):
|
||||
"""Initializes the heatmap class with default values for Visual, Image, track, count and heatmap parameters."""
|
||||
|
||||
# Visual information
|
||||
self.annotator = None
|
||||
self.view_img = view_img
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ class ObjectCounter:
|
|||
line_dist_thresh (int): Euclidean distance threshold for line counter.
|
||||
cls_txtdisplay_gap (int): Display gap between each class count.
|
||||
"""
|
||||
|
||||
# Mouse events
|
||||
self.is_drawing = False
|
||||
self.selected_point = None
|
||||
|
|
@ -141,7 +140,6 @@ class ObjectCounter:
|
|||
|
||||
def extract_and_process_tracks(self, tracks):
|
||||
"""Extracts and processes tracks for object counting in a video stream."""
|
||||
|
||||
# Annotator Init and region drawing
|
||||
self.annotator = Annotator(self.im0, self.tf, self.names)
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ class QueueManager:
|
|||
region_thickness (int, optional): Thickness of the counting region lines. Defaults to 5.
|
||||
fontsize (float, optional): Font size for the text annotations. Defaults to 0.7.
|
||||
"""
|
||||
|
||||
# Mouse events state
|
||||
self.is_drawing = False
|
||||
self.selected_point = None
|
||||
|
|
@ -88,7 +87,6 @@ class QueueManager:
|
|||
|
||||
def extract_and_process_tracks(self, tracks):
|
||||
"""Extracts and processes tracks for queue management in a video stream."""
|
||||
|
||||
# Initialize annotator and draw the queue region
|
||||
self.annotator = Annotator(self.im0, self.tf, self.names)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue