Work through most of the cspell warnings in python (#13794)

This commit is contained in:
gtsiam
2024-09-17 10:41:46 -05:00
committed by GitHub
parent 350abda21a
commit edababa88e
20 changed files with 208 additions and 66 deletions
+2 -2
View File
@@ -511,12 +511,12 @@ def reduce_detections(
# due to min score requirement of NMSBoxes
confidences = [0.6 if clipped(o, frame_shape) else o[1] for o in group]
idxs = cv2.dnn.NMSBoxes(
indices = cv2.dnn.NMSBoxes(
boxes, confidences, 0.5, LABEL_NMS_MAP.get(label, LABEL_NMS_DEFAULT)
)
# add objects
for index in idxs:
for index in indices:
index = index if isinstance(index, np.int32) else index[0]
obj = group[index]
selected_objects.append(obj)
+3 -3
View File
@@ -122,7 +122,7 @@ def get_cpu_stats() -> dict[str, dict]:
stats = f.readline().split()
utime = int(stats[13])
stime = int(stats[14])
starttime = int(stats[21])
start_time = int(stats[21])
with open("/proc/uptime") as f:
system_uptime_sec = int(float(f.read().split()[0]))
@@ -131,9 +131,9 @@ def get_cpu_stats() -> dict[str, dict]:
process_utime_sec = utime // clk_tck
process_stime_sec = stime // clk_tck
process_starttime_sec = starttime // clk_tck
process_start_time_sec = start_time // clk_tck
process_elapsed_sec = system_uptime_sec - process_starttime_sec
process_elapsed_sec = system_uptime_sec - process_start_time_sec
process_usage_sec = process_utime_sec + process_stime_sec
cpu_average_usage = process_usage_sec * 100 // process_elapsed_sec