21 using Clock = std::chrono::steady_clock;
22 using TimePoint = std::chrono::time_point<Clock>;
23 using Duration = Clock::duration;
24 using Ms = std::chrono::duration<double, std::ratio<1, 1000>>;
25 using Sec = std::chrono::duration<double, std::ratio<1, 1>>;
39 void update(TimePoint lastRequestStartTime,
41 cv::Point position = {15, 30},
42 int fontFace = cv::FONT_HERSHEY_COMPLEX,
43 double fontScale = 0.75,
44 cv::Scalar color = {200, 10, 10},
45 int thickness = 2, MetricTypes metricType = ALL);
46 void update(TimePoint lastRequestStartTime);
55 cv::Point position = { 15, 30 },
56 int fontFace = cv::FONT_HERSHEY_COMPLEX,
57 double fontScale = 0.75,
58 cv::Scalar color = { 200, 10, 10 },
59 int thickness = 2, MetricTypes metricType = ALL)
const;
61 Metrics getLast()
const;
62 Metrics getTotal()
const;
63 void logTotal()
const;
72 latency = Duration::zero();
73 period = Duration::zero();
77 void combine(
const Statistic& other) {
78 latency += other.latency;
79 period += other.period;
80 frameCount += other.frameCount;
84 Duration timeWindowSize;
85 Statistic lastMovingStatistic;
86 Statistic currentMovingStatistic;
87 Statistic totalStatistic;
88 TimePoint lastUpdateTime;
89 bool firstFrameProcessed;
92 void logLatencyPerStage(
double readLat,
double preprocLat,
double inferLat,
double postprocLat,
double renderLat);
a header file with common samples functionality using OpenCV