denisecailab / ezTrack

Free, platform independent, behavior tracking software.
GNU General Public License v3.0
118 stars 41 forks source link

roi_stream error #66

Closed mgao101 closed 1 year ago

mgao101 commented 1 year ago

Thanks for sharing the great tool. There are some errors when running the individual and batch location tracking. Here shows individual errors. Details see attached PDF. Thanks.

KeyError Traceback (most recent call last) Input In [9], in <cell line: 1>() ----> 1 location = lt.TrackLocation(video_dict, tracking_params) 2 location.to_csv(os.path.splitext(video_dict['fpath'])[0] + '_LocationOutput.csv', index=False) 3 location.head()

File ~\ezTrack\LocationTracking\LocationTracking_Functions.py:786, in TrackLocation(video_dict, tracking_params) 772 df = pd.DataFrame( 773 {'File' : video_dict['file'], 774 'Location_Thresh': np.ones(len(D))*tracking_params['loc_thresh'], (...) 782 'Distance_px': D 783 }) 785 #add region of interest info --> 786 df = ROI_Location(video_dict, df) 787 if video_dict['region_names'] is not None: 788 print('Defining transitions...')

File ~\ezTrack\LocationTracking\LocationTracking_Functions.py:1150, in ROI_Location(video_dict, location) 1148 #Create ROI Masks 1149 ROI_masks = {} -> 1150 for poly in range(len(video_dict['roi_stream'].data['xs'])): 1151 x = np.array(video_dict['roi_stream'].data['xs'][poly]) #x coordinates 1152 y = np.array(video_dict['roi_stream'].data['ys'][poly]) #y coordinates

KeyError: 'roi_stream'

Error (Individual ).pdf Error (batch).pdf

ZachPenn commented 1 year ago

For the individually processed video, in cell 2 you have region names set to ["left","right","top","bottom"], but you don't define their location. This will cause an error. If you do not intend to use regions of interest, it must be set to None.

For the batched processed video, you ran the cell to set the distance scale (where it says 'Select Points'), but I don't see any points selected. If you run this cell but don't select any points it will cause an error.

mgao101 commented 1 year ago

Thanks. It works.