@@ -701,19 +701,23 @@ def dlc_qc_plot(session_path, one=None):
701701 data [f'{ cam } _frame' ] = get_video_frame (video_path , frame_number = 5 * 60 * SAMPLING [cam ])[:, :, 0 ]
702702 # If not, try to stream a frame (try three times)
703703 else :
704- video_url = url_from_eid (one .path2eid (session_path ), one = one )[cam ]
705- for tries in range (3 ):
706- try :
707- data [f'{ cam } _frame' ] = get_video_frame (video_url , frame_number = 5 * 60 * SAMPLING [cam ])[:, :, 0 ]
708- break
709- except BaseException :
710- if tries < 2 :
711- tries += 1
712- logger .info (f"Streaming { cam } video failed, retrying x{ tries } " )
713- time .sleep (30 )
714- else :
715- logger .warning (f"Could not load video frame for { cam } cam. Skipping trace on frame." )
716- data [f'{ cam } _frame' ] = None
704+ try :
705+ video_url = url_from_eid (one .path2eid (session_path ), one = one )[cam ]
706+ for tries in range (3 ):
707+ try :
708+ data [f'{ cam } _frame' ] = get_video_frame (video_url , frame_number = 5 * 60 * SAMPLING [cam ])[:, :, 0 ]
709+ break
710+ except BaseException :
711+ if tries < 2 :
712+ tries += 1
713+ logger .info (f"Streaming { cam } video failed, retrying x{ tries } " )
714+ time .sleep (30 )
715+ else :
716+ logger .warning (f"Could not load video frame for { cam } cam. Skipping trace on frame." )
717+ data [f'{ cam } _frame' ] = None
718+ except KeyError :
719+ logger .warning (f"Could not load video frame for { cam } cam. Skipping trace on frame." )
720+ data [f'{ cam } _frame' ] = None
717721 # Other camera associated data
718722 for feat in ['dlc' , 'times' , 'features' , 'ROIMotionEnergy' ]:
719723 # Check locally first, then try to load from alyx, if nothing works, set to None
0 commit comments