Skip to content

Commit

Permalink
fix(reporter): calculation of time cost
Browse files Browse the repository at this point in the history
  • Loading branch information
williamfzc committed Jul 18, 2019
1 parent 4586826 commit db54b84
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stagesepx/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ def draw(cls, data_list: typing.List[ClassifierResult], report_path: str = None)
x_axis = sorted(list(set([i.stage for i in data_list])))
bar.add_xaxis(x_axis)
y_axis = list()
offset = data_list[1].timestamp - data_list[0].timestamp
for each_stage_name in x_axis:
each_stage = sorted([i for i in data_list if i.stage == each_stage_name], key=lambda x: x.frame_id)
time_cost = each_stage[-1].timestamp - each_stage[0].timestamp
time_cost = each_stage[-1].timestamp - each_stage[0].timestamp + offset
y_axis.append(time_cost)
bar.add_yaxis('time cost', y_axis)
bar.set_global_opts(
Expand Down

0 comments on commit db54b84

Please sign in to comment.