Skip to content
Snippets Groups Projects
Commit 39aee35a authored by Egor Sobolev's avatar Egor Sobolev
Browse files

Use numpy.split to split frame selection on train masks

parent e606fce2
No related branches found
No related tags found
1 merge request!14Add lit frame selection
......@@ -344,13 +344,9 @@ class LitFrames(ReductionMethod):
train_sel, nfrm, cell_id, [sel_type])
# select frames for every train
i0 = 0
for i in range(len(train_sel)):
iN = i0 + nfrm[i]
self.select_xtdf(src,
by_id[[train_sel[i]]],
frame_sel[i0:iN])
i0 = iN
train_masks = np.split(frame_sel, np.cumsum(nfrm))
for train_id, mask in zip(train_sel, train_masks):
self.select_xtdf(src, by_id[[train_id]], mask)
def print_report(self, sel, max_lines=20):
report = sel.report()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment