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

IndexError: list index out of range #16

Closed
unetzjuser opened this issue Sep 25, 2020 · 2 comments
Closed

IndexError: list index out of range #16

unetzjuser opened this issue Sep 25, 2020 · 2 comments

Comments

@unetzjuser
Copy link

First of all, thanks a lot for this nice contribution!

I encountered a problem when predicting new datasets. When I run this command:
data_new, feats_new, labels_fslow, labels_fshigh = bsoid_py.main.run(PREDICT_FOLDERS)

There is an "IndexError".

In [3]: data_new, feats_new, labels_fslow, labels_fshigh = bsoid_py.main.run(PRE
...: DICT_FOLDERS)

###Well, I did not copy the processed here.


IndexError Traceback (most recent call last)
in
----> 1 data_new, feats_new, labels_fslow, labels_fshigh = bsoid_py.main.run(PREDICT_FOLDERS)

~/Software/Deep Learning/B-SOiD/bsoid_py/main.py in run(predict_folders)
62 with open(os.path.join(OUTPUT_PATH, str.join('', ('bsoid_', MODEL_NAME, '.sav'))), 'rb') as fr:
63 behv_model, scaler = joblib.load(fr)
---> 64 data_new, feats_new, labels_fslow, labels_fshigh = bsoid_py.classify.main(predict_folders, scaler, FPS, behv_model)
65 filenames = []
66 all_df = []

~/Software/Deep Learning/B-SOiD/bsoid_py/classify.py in main(predict_folders, scaler, fps, behv_model)
167 plot_feats(feats_new, labels_fslow)
168 if GEN_VIDEOS:
--> 169 videoprocessing.main(VID_NAME, labels_fslow[ID], FPS, FRAME_DIR)
170 return data_new, feats_new, labels_fslow, labels_fshigh

~/Software/Deep Learning/B-SOiD/bsoid_py/utils/videoprocessing.py in main(vidname, labels, fps, output_path)
154 def main(vidname, labels, fps, output_path):
155 vid2frame(vidname, labels, fps, output_path)
--> 156 create_labeled_vid(labels, crit=3, counts=5, frame_dir=output_path, output_path=SHORTVID_DIR)
157 return
158

~/Software/Deep Learning/B-SOiD/bsoid_py/utils/videoprocessing.py in create_labeled_vid(labels, crit, counts, frame_dir, output_path)
121 sort_nicely(images)
122 fourcc = cv2.VideoWriter_fourcc(*'mp4v')
--> 123 frame = cv2.imread(os.path.join(frame_dir, images[0]))
124 height, width, layers = frame.shape
125 rnges = []

IndexError: list index out of range

Where is the problem? Is this because the DIR path is too long?

Thank you very much!

@runninghsus
Copy link
Collaborator

Hi @unetzjuser

Might I recommend using the bsoid_app? It is better maintained and it might just solve your issue.

@unetzjuser
Copy link
Author

Thanks for your reply! I will try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants