-
Notifications
You must be signed in to change notification settings - Fork 3
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
New requirement: iter_frames #3
Comments
Would the function simple yield raw Cap'N Proto frames? Or would they also be converted to |
Agreed Regarding the
Otherwise it could be argued, that if you need the I would prefer option 2 with the from numpy.lib.recfunctions import append_fields
for frame, fc in repo.iter_frames(start, end):
arr = convert_frame_to_numpy(frame)
cam_col = np.repeat(fc.camId, arr.shape[0])
arr_ext = append_fields(arr, 'cam_id', cam_col, usemask=False)
# ... do something with arr_ext like stacking We also could enhance for frame, fc in repo.iter_frames(start, end):
arr = convert_frame_to_numpy(frame, add_columns={'cam_id': fc.camId}) From my perspective this would be the most practical solution. |
I would prefer that too. That way the caller can always get the values he is interested in. I also like you suggested enhancement, but you have to decide how useful it would be for the tracking. You already had some basic code for |
…iners The Repository class has a new convenience function to extract all frames in a given time range. Before it only was possible to iterate over frame containers, which also hold frames that are **not** in the requested time range. Refs #3
It would be helpful if there would be a function
iter_frames(start=None, end=None, cam=None)
analogous to iter_fnames.This function would iterate through frames in a given time range.
Start is inclusive, end is exclusive.
No start or end given: behavior
like iter_fnames
.The text was updated successfully, but these errors were encountered: