Skip to content
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

Check for dropped frames #206

Open
neuraldino opened this issue Jan 25, 2022 · 0 comments
Open

Check for dropped frames #206

neuraldino opened this issue Jan 25, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@neuraldino
Copy link

Is your feature request related to a problem? Please describe.

When running Compute Scalar DF, code crashes when some of the files have large amount of dropped frames. This is apparently due to mismatch between number of frames in pca_score and the number of frames in the model. It would be great to perform dataset integrity test early in the pipeline to avoid this problem.

Error message during Compute Scalar DF:

ValueError Traceback (most recent call last)
in
4 _, sorted_index = parse_index(progress_paths['index_file'])
5 # compute session scalar data
----> 6 scalar_df = scalars_to_dataframe(sorted_index, model_path=progress_paths['model_path'])
7
8 print('The shape of scalar_df', scalar_df.shape)

~/opt/anaconda3/envs/moseq2-app/lib/python3.7/site-packages/moseq2_viz/scalars/util.py in scalars_to_dataframe(index, include_keys, disable_output, force_conversion, model_path)
432 model_uuids = None
433 if model_path is not None and exists(model_path):
--> 434 labels_df = prepare_model_dataframe(model_path, index['pca_path']).set_index('uuid')
435 has_model = True
436 # loading the session uuids that the model was trained on

~/opt/anaconda3/envs/moseq2-app/lib/python3.7/site-packages/moseq2_viz/model/util.py in prepare_model_dataframe(model_path, pca_path)
895 # make sure all pcs align with labels
896 if not all(k in scores_idx and len(scores_idx[k]) == len(v) for k, v in labels.items()):
--> 897 raise ValueError('PC scores don't align with labels or label UUID not found in PC scores')
898
899 _df = pd.concat((pd.DataFrame({

ValueError: PC scores don't align with labels or label UUID not found in PC scores

@neuraldino neuraldino added the enhancement New feature or request label Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant