Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mediapipe generic metrics demo #3054

Merged
merged 2 commits into from
Feb 18, 2025
Merged

Mediapipe generic metrics demo #3054

merged 2 commits into from
Feb 18, 2025

Conversation

bstrzele
Copy link
Collaborator

🛠 Summary

JIRA/Issue if applicable.
Describe the changes.

🧪 Checklist

  • Unit tests added.
  • The documentation updated.
  • Change follows security best practices.
    ``

@@ -172,7 +173,7 @@ def display(self):
self.pq.put((sent_frame_id, received_frame, timestamp))

def get_timestamp(self) -> int:
return int(cv2.getTickCount() / cv2.getTickFrequency() * 1e6)
return int(time.time() * 1e6)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change? why do we still want to stamp it manually? should we rely on automatic stamping?
otherwise the metric is wrong - we take into account client->server network transfer time

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed that, now benchmarking is based on server side timestamps. Client side timestamps are now only used to order frames while using legacy(non-streaming) method.

@@ -232,7 +233,7 @@ def start(self, *, ovms_address : str, input_name : str, model_name : str, datat
inputs=[grpcclient.InferInput(input_name, np_frame.shape, datatype.string())]
inputs[0].set_data_from_numpy(np_frame)
if streaming_api:
triton_client.async_stream_infer(model_name=model_name, inputs=inputs, parameters={"OVMS_MP_TIMESTAMP":self.get_timestamp()})
triton_client.async_stream_infer(model_name=model_name, inputs=inputs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we still have get_timestamp if we dont use it here?

@bstrzele bstrzele force-pushed the mp_request_latency_metric branch from bd053a3 to 5dd015b Compare February 12, 2025 10:37
@bstrzele bstrzele force-pushed the mp_request_latency_metric branch from 5dd015b to 43e1c69 Compare February 12, 2025 12:00
@bstrzele bstrzele force-pushed the mp_metrics_demo branch 2 times, most recently from f97f626 to 87121dd Compare February 12, 2025 13:06
@bstrzele bstrzele force-pushed the mp_request_latency_metric branch from ef43bc6 to df10202 Compare February 17, 2025 09:52
@bstrzele bstrzele force-pushed the mp_request_latency_metric branch from df10202 to 626fb8b Compare February 18, 2025 12:05
Base automatically changed from mp_request_latency_metric to main February 18, 2025 12:28
@bstrzele bstrzele merged commit 489953d into main Feb 18, 2025
9 checks passed
@bstrzele bstrzele deleted the mp_metrics_demo branch February 18, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants