diff --git a/motmetrics/mot.py b/motmetrics/mot.py index ec7ae59..87d1a70 100644 --- a/motmetrics/mot.py +++ b/motmetrics/mot.py @@ -454,7 +454,8 @@ def merge_event_dataframes(dfs, update_frame_indices=True, update_oids=True, upd next_frame_id = max(r.index.get_level_values(0).max() + 1, r.index.get_level_values(0).unique().shape[0]) if np.isnan(next_frame_id): next_frame_id = 0 - copy.index = copy.index.map(lambda x: (x[0] + next_frame_id, x[1])) + if not copy.index.empty: + copy.index = copy.index.map(lambda x: (x[0] + next_frame_id, x[1])) infos['frame_offset'] = next_frame_id # Update object / hypothesis ids