Skip to content

Commit

Permalink
Added timestamps to outcoming messages (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicikD authored Aug 14, 2024
1 parent e73f404 commit 4fffe46
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions depthai_nodes/ml/parsers/image_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@ def run(self):
image=image,
is_bgr=self.output_is_bgr,
)
image_message.setTimestamp(output.getTimestamp())

self.out.send(image_message)
1 change: 1 addition & 0 deletions depthai_nodes/ml/parsers/keypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,6 @@ def run(self):
keypoints /= self.scale_factor

msg = create_keypoints_message(keypoints)
msg.setTimestamp(output.getTimestamp())

self.out.send(msg)
1 change: 1 addition & 0 deletions depthai_nodes/ml/parsers/mediapipe_hand_landmarker.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ def run(self):
hand_landmarks_msg = create_hand_keypoints_message(
landmarks, float(handedness), float(hand_score), self.score_threshold
)
hand_landmarks_msg.setTimestamp(output.getTimestamp())
self.out.send(hand_landmarks_msg)
1 change: 1 addition & 0 deletions depthai_nodes/ml/parsers/mediapipe_palm_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,5 @@ def run(self):
scores = np.array(scores)[indices]

detections_msg = create_detection_message(bboxes, scores, labels=None)
detections_msg.setTimestamp(output.getTimestamp())
self.out.send(detections_msg)
1 change: 1 addition & 0 deletions depthai_nodes/ml/parsers/mlsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,5 @@ def run(self):
)

message = create_line_detection_message(lines, np.array(scores))
message.setTimestamp(output.getTimestamp())
self.out.send(message)
1 change: 1 addition & 0 deletions depthai_nodes/ml/parsers/monocular_depth.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ def run(self):
depth_map=depth_map,
depth_type=self.depth_type,
)
depth_message.setTimestamp(output.getTimestamp())
self.out.send(depth_message)
1 change: 1 addition & 0 deletions depthai_nodes/ml/parsers/scrfd.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,5 @@ def run(self):
scores = scores[indices]

detection_msg = create_detection_message(bboxes, scores, None, None)
detection_msg.setTimestamp(output.getTimestamp())
self.out.send(detection_msg)
1 change: 1 addition & 0 deletions depthai_nodes/ml/parsers/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,5 @@ def run(self):
)

imgFrame = create_segmentation_message(class_map)
imgFrame.setTimestamp(output.getTimestamp())
self.out.send(imgFrame)
1 change: 1 addition & 0 deletions depthai_nodes/ml/parsers/superanimal_landmarker.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ def run(self):
keypoints = keypoints[:, :2] / self.scale_factor

msg = create_keypoints_message(keypoints, scores, self.score_threshold)
msg.setTimestamp(output.getTimestamp())

self.out.send(msg)
1 change: 1 addition & 0 deletions depthai_nodes/ml/parsers/thermal_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ def run(self):
thermal_map = output[0]

thermal_message = create_thermal_message(thermal_map=thermal_map)
thermal_message.setTimestamp(output.getTimestamp())
self.out.send(thermal_message)
1 change: 1 addition & 0 deletions depthai_nodes/ml/parsers/xfeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def run(self):
if self.previous_results is not None:
mkpts0, mkpts1 = match(self.previous_results, result)
matched_points = create_tracked_features_message(mkpts0, mkpts1)
matched_points.setTimestamp(output.getTimestamp())
self.out.send(matched_points)
else:
# save the result from first frame
Expand Down
1 change: 1 addition & 0 deletions depthai_nodes/ml/parsers/yunet.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,6 @@ def run(self):
labels,
keypoints,
)
detections_message.setTimestamp(output.getTimestamp())

self.out.send(detections_message)

0 comments on commit 4fffe46

Please sign in to comment.