annnic / cichlid-analysis

cichlid behaviour analysis
GNU General Public License v3.0
0 stars 2 forks source link

'split_tracking.py' broken for retracked videos #7

Closed maxshafer closed 3 years ago

maxshafer commented 3 years ago

Running 'split_tracking.py' on retracks causes an error:

/usr/local/bin/python3.7 /Users/maxwellshafer/cichlid-analysis/cichlidanalysis/quality_control/split_tracking.py objc[2617]: Class FIFinderSyncExtensionHost is implemented in both /System/Library/PrivateFrameworks/FinderKit.framework/Versions/A/FinderKit (0x7fff9fcb03c8) and /System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride (0x121600f50). One of the two will be used. Which one is undefined. Traceback (most recent call last): File "/Users/maxwellshafer/cichlid-analysis/cichlidanalysis/quality_control/split_tracking.py", line 175, in displacement_internal, track_single = load_track(track_path) File "/Users/maxwellshafer/cichlid-analysis/cichlidanalysis/io/tracks.py", line 11, in load_track track_internal = np.genfromtxt(csv_file_path, delimiter=',') File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/lib/npyio.py", line 1749, in genfromtxt fid = np.lib._datasource.open(fname, 'rt', encoding=encoding) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/lib/_datasource.py", line 195, in open return ds.open(path, mode, encoding=encoding, newline=newline) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/lib/_datasource.py", line 535, in open raise IOError("%s not found." % path) OSError: /Volumes/BZ/Scientific Data/RG-AS04-Data01/Cichlid_sleep_videos/FISH20200930_LT_Cyplep/20200930_c2_Cyprichromis-leptosoma/FISH20200930_c2_r0_Cyprichromis-leptosoma_sm/20201005-114400_120_roi-0.csv not found.

Process finished with exit code 1

Reproducible on "/Volumes/BZ/Scientific Data/RG-AS04-Data01/Cichlid_sleep_videos/FISH20200930_LT_Cyplep/20200930_c2_Cyprichromis-leptosoma/FISH20200930_c2_r0_Cyprichromis-leptosoma_sm/20201005-114400_120_roi-0.mp4"

annnic commented 3 years ago

Let me know if there's any more issues on this

maxshafer commented 3 years ago

When running on "20201005-164315_125_roi-0.mp4" in Cyplep c2 r0:

 20201005-154323_124_per90_Background.png
Splitting video between frame 3790.0 and frame 31433.0
Retrack the split movie? y/n: 
y
Traceback (most recent call last):
  File "/Users/maxwellshafer/cichlid-analysis/cichlidanalysis/quality_control/split_tracking.py", line 231, in <module>
    na, track_single_orig = load_track(os.path.join(vid_folder_path, orig_file[0]))
IndexError: list index out of range

Process finished with exit code 1

Likely a simple fix for finding the retracked csv for timestamps, rather then the original track csv

annnic commented 3 years ago

Thanks! Try it out now

maxshafer commented 3 years ago

Ok, so 'split_tracking' now works, but 'run_fish_als' errors out:

/usr/local/bin/python3.7 /Users/maxwellshafer/cichlid-analysis/cichlidanalysis/analysis/run_fish_als.py
Analyse multiple folders (ROIs) (y) or only one ROI (n)?: 
n
objc[10546]: Class FIFinderSyncExtensionHost is implemented in both /System/Library/PrivateFrameworks/FinderKit.framework/Versions/A/FinderKit (0x7fff9fcb03c8) and /System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride (0x124067f50). One of the two will be used. Which one is undefined.
/Volumes/BZ/Scientific Data/RG-AS04-Data01/Cichlid_sleep_videos/FISH20200930_LT_Cyplep/20200930_c2_Cyprichromis-leptosoma/config.yaml
{'cam_ID': '19463146', 'filechunk': 3600, 'fps': 10, 'mm_per_pixel': 0.49956460050324186, 'tot_hours': 166}
/Volumes/BZ/Scientific Data/RG-AS04-Data01/Cichlid_sleep_videos/FISH20200930_LT_Cyplep/20200930_c2_Cyprichromis-leptosoma/FISH20200930_c2_r0_Cyprichromis-leptosoma_sm/meta_data.yaml
{'fish_length_mm': 50.0, 'sex': 'm', 'species': 'Cyprichromis leptosoma'}
two  options for replacement for split movie... exiting
Traceback (most recent call last):
  File "/Users/maxwellshafer/cichlid-analysis/cichlidanalysis/analysis/run_fish_als.py", line 358, in <module>
    full_analysis(rootdir)
  File "/Users/maxwellshafer/cichlid-analysis/cichlidanalysis/analysis/run_fish_als.py", line 38, in full_analysis
    track_full, speed_full = extract_tracks_from_fld(rootdir, file_ending)
TypeError: cannot unpack non-iterable bool object

Process finished with exit code 1

Lilkely due to having both "20201005-164315_125_roi-0_tracks_20210121_Thresh_35_Area_100_roi-0.csv" and "20201005-164315_125_roi-0_tracks_20210128_Thresh_35_Area_100Range00000-03790.csv" in the folder for the split tracked video.