ver228 / tierpsy-tracker

Multi-Worm Behaviour Tracker
http://ver228.github.io/tierpsy-tracker/
MIT License
24 stars 39 forks source link

error during video compression #71

Open cooketho opened 4 years ago

cooketho commented 4 years ago

I'm getting the following error when I use Tierpsy Tracker on the test data set:

Capture_Ch1_18062015_140908 Starting video compression.
ERROR: 
ValueError: not enough values to unpack (expected 3, got 2)
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
Traceback (most recent call last):
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 108, in <module>
    ProcessWorker(**args, cmd_original = subprocess.list2cmdline(sys.argv))
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 38, in __init__
    self.execAllPoints()
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 66, in execAllPoints
    cmd_original = self.cmd_original)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/trackProvenance.py", line 28, in execThisPoint
    func(**argkws)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/processVideo.py", line 142, in processVideo
    compressVideo(video_file, masked_image_file, **compress_vid_param)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/compressVideo.py", line 366, in compressVideo
    mask = getROIMask(img_reduce, **mask_param)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/compressVideo.py", line 76, in getROIMask
    mask.copy(), cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
ValueError: not enough values to unpack (expected 3, got 2)
'/Users/tom/opt/anaconda3/envs/tierpsy/bin/python' '/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py' '/Users/tom/Desktop/example_data/multiworm/Capture_Ch1_18062015_140908.mov' --masks_dir '/Users/tom/Tmp/MaskedVideos/' --results_dir '/Users/tom/Tmp/Results/' --json_file '/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/extras/param_files/MULTIWORM_OPENWORM.json' --analysis_checkpoints 'COMPRESS' 'TRAJ_CREATE' 'TRAJ_JOIN' 'SKE_INIT' 'BLOB_FEATS' 'SKE_CREATE' 'SKE_FILT' 'SKE_ORIENT' 'INT_PROFILE' 'INT_SKE_ORIENT' 'FEAT_CREATE'
*************************************************
Tasks: 1 finished, 0 remaining. Total_time 0:00:48.
*************************************************

So I copied and pasted that last subprocess command to the command line, and got the following:

(tierpsy) Toms-MacBook-Pro:~ tom$ '/Users/tom/opt/anaconda3/envs/tierpsy/bin/python' '/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py' '/Users/tom/Desktop/example_data/multiworm/Capture_Ch1_18062015_140908.mov' --masks_dir '/Users/tom/Tmp/MaskedVideos/' --results_dir '/Users/tom/Tmp/Results/' --json_file '/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/extras/param_files/MULTIWORM_OPENWORM.json' --analysis_checkpoints 'COMPRESS' 'TRAJ_CREATE' 'TRAJ_JOIN' 'SKE_INIT' 'BLOB_FEATS' 'SKE_CREATE' 'SKE_FILT' 'SKE_ORIENT' 'INT_PROFILE' 'INT_SKE_ORIENT' 'FEAT_CREATE'
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
Capture_Ch1_18062015_140908 Starting checkpoint: COMPRESS
COMPRESS
(1.0, 1.0, 'frames') (1.0, 'pixels') 1
Capture_Ch1_18062015_140908 Extracting video metadata...
Capture_Ch1_18062015_140908 Extracting video metadata. Total time = 0:00:14, fps = 37.0; Frame 500
Capture_Ch1_18062015_140908 Extracting video metadata. Total time = 0:00:29, fps = 32.4; Frame 1000
cannot read
Capture_Ch1_18062015_140908 Starting video compression.
Traceback (most recent call last):
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 108, in <module>
    ProcessWorker(**args, cmd_original = subprocess.list2cmdline(sys.argv))
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 38, in __init__
    self.execAllPoints()
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 66, in execAllPoints
    cmd_original = self.cmd_original)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/trackProvenance.py", line 28, in execThisPoint
    func(**argkws)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/processVideo.py", line 142, in processVideo
    compressVideo(video_file, masked_image_file, **compress_vid_param)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/compressVideo.py", line 366, in compressVideo
    mask = getROIMask(img_reduce, **mask_param)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/compressVideo.py", line 76, in getROIMask
    mask.copy(), cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
ValueError: not enough values to unpack (expected 3, got 2)

I saw in a closed post that some users had been having problems with openCV. I'm using the latest version, openCV version 4.2.0 on macOS Catalina 10.15.2. Could it be that Tierpsy is not compatible with the newest openCV? If so, can you please advise as to how this can be fixed? Thank you!

ver228 commented 4 years ago

Try downgrading to opencv 3. The bug is fixed in the current HEAD in the repo but I haven't updated it in the conda-forge version.

On Thursday, January 16, 2020, cooketho notifications@github.com wrote:

I'm getting the following error when I use Tierpsy Tracker on the test data set:

Capture_Ch1_18062015_140908 Starting video compression. ERROR: ValueError: not enough values to unpack (expected 3, got 2) /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject Traceback (most recent call last): File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 108, in ProcessWorker(args, cmd_original = subprocess.list2cmdline(sys.argv)) File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 38, in init self.execAllPoints() File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 66, in execAllPoints cmd_original = self.cmd_original) File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/trackProvenance.py", line 28, in execThisPoint func(argkws) File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/processVideo.py", line 142, in processVideo compressVideo(video_file, masked_image_file, compress_vid_param) File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/compressVideo.py", line 366, in compressVideo mask = getROIMask(img_reduce, mask_param) File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/compressVideo.py", line 76, in getROIMask mask.copy(), cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) ValueError: not enough values to unpack (expected 3, got 2) '/Users/tom/opt/anaconda3/envs/tierpsy/bin/python' '/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py' '/Users/tom/Desktop/example_data/multiworm/Capture_Ch1_18062015_140908.mov' --masks_dir '/Users/tom/Tmp/MaskedVideos/' --results_dir '/Users/tom/Tmp/Results/' --json_file '/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/extras/param_files/MULTIWORM_OPENWORM.json' --analysis_checkpoints 'COMPRESS' 'TRAJ_CREATE' 'TRAJ_JOIN' 'SKE_INIT' 'BLOB_FEATS' 'SKE_CREATE' 'SKE_FILT' 'SKE_ORIENT' 'INT_PROFILE' 'INT_SKE_ORIENT' 'FEAT_CREATE'


Tasks: 1 finished, 0 remaining. Total_time 0:00:48.


So I copied and pasted that last subprocess command to the command line, and got the following:

(tierpsy) Toms-MacBook-Pro:~ tom$ '/Users/tom/opt/anaconda3/envs/tierpsy/bin/python' '/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py' '/Users/tom/Desktop/example_data/multiworm/Capture_Ch1_18062015_140908.mov' --masks_dir '/Users/tom/Tmp/MaskedVideos/' --results_dir '/Users/tom/Tmp/Results/' --json_file '/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/extras/param_files/MULTIWORM_OPENWORM.json' --analysis_checkpoints 'COMPRESS' 'TRAJ_CREATE' 'TRAJ_JOIN' 'SKE_INIT' 'BLOB_FEATS' 'SKE_CREATE' 'SKE_FILT' 'SKE_ORIENT' 'INT_PROFILE' 'INT_SKE_ORIENT' 'FEAT_CREATE' /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject /Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject Capture_Ch1_18062015_140908 Starting checkpoint: COMPRESS COMPRESS (1.0, 1.0, 'frames') (1.0, 'pixels') 1 Capture_Ch1_18062015_140908 Extracting video metadata... Capture_Ch1_18062015_140908 Extracting video metadata. Total time = 0:00:14, fps = 37.0; Frame 500 Capture_Ch1_18062015_140908 Extracting video metadata. Total time = 0:00:29, fps = 32.4; Frame 1000 cannot read Capture_Ch1_18062015_140908 Starting video compression. Traceback (most recent call last): File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 108, in ProcessWorker(args, cmd_original = subprocess.list2cmdline(sys.argv)) File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 38, in init self.execAllPoints() File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 66, in execAllPoints cmd_original = self.cmd_original) File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/trackProvenance.py", line 28, in execThisPoint func(argkws) File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/processVideo.py", line 142, in processVideo compressVideo(video_file, masked_image_file, compress_vid_param) File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/compressVideo.py", line 366, in compressVideo mask = getROIMask(img_reduce, mask_param) File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/compressVideo.py", line 76, in getROIMask mask.copy(), cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) ValueError: not enough values to unpack (expected 3, got 2)

I saw in a closed post that some users had been having problems with openCV. I'm using the latest version, openCV version 4.2.0 on macOS Catalina 10.15.2. Could it be that Tierpsy is not compatible with the newest openCV? If so, can you please advise as to how this can be fixed? Thank you!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ver228/tierpsy-tracker/issues/71?email_source=notifications&email_token=AB72CUBWTTIEQQU5PR2ECZ3Q6CFFTA5CNFSM4KHXDF52YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IGWPPYA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB72CUEBZR5ZCQQWKIXAZV3Q6CFFTANCNFSM4KHXDF5Q .

zhaoyuan98 commented 4 years ago

I got the exactly same error as "ValueError: not enough values to unpack (expected 3, got 2)" while compressing the video after installation followed the given instruction. Did you update it in the condo-forge version now? If not, could you recommend me how to fix this error? Thank you!