Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

unable to triangulate #19

Open
caoshenghao opened this issue Mar 5, 2021 · 0 comments
Open

unable to triangulate #19

caoshenghao opened this issue Mar 5, 2021 · 0 comments

Comments

@caoshenghao
Copy link

I have a GPU card RTX3090, so I chose to use deeplabcutcore.

I got a TypeError: unhashable type: 'CommentedMap' while running deeplabcut.triangulate(config3d_path, video_path, videotype='avi', gputouse=0, filterpredictions=True) (already import deeplabcutcore as deeplabcut).

And I found that if I set filterpredictions=False, I got another error IndexError: list index out of range.

If I use import deeplabcut, it works well but really slowly!

Hope you can help.

IndexError: list index out of range

Analyzing video D:\deeplabcut-video\3dvideos\finger-camera-1.avi using config_file_camera-1
Using snapshot-2000 for model D:/deeplabcut-video/finger3d-camera1-cshh-2021-03-05\dlc-models\iteration-0\finger3d-camera1Mar5-trainset95shuffle1
Initializing ResNet
INFO:tensorflow:Restoring parameters from D:/deeplabcut-video/finger3d-camera1-cshh-2021-03-05\dlc-models\iteration-0\finger3d-camera1Mar5-trainset95shuffle1\train\snapshot-2000
INFO:tensorflow:Restoring parameters from D:/deeplabcut-video/finger3d-camera1-cshh-2021-03-05\dlc-models\iteration-0\finger3d-camera1Mar5-trainset95shuffle1\train\snapshot-2000
Starting to analyze %  D:\deeplabcut-video\3dvideos\finger-camera-1.avi
Video already analyzed! D:\deeplabcut-video\3dvideos\finger-camera-1DLC_resnet50_finger3d-camera1Mar5shuffle1_2000.h5
The videos are analyzed. Now your research can truly start! 
 You can create labeled videos with 'create_labeled_video'.
If the tracking is not satisfactory for some videos, consider expanding the training set. You can use the function 'extract_outlier_frames' to extract any outlier frames!
D:\deeplabcut-video\3dvideos finger-camera-1 DLC_resnet50_finger3d-camera1Mar5shuffle1_2000
Analyzing video D:\deeplabcut-video\3dvideos\finger-camera-5.avi using config_file_camera-5
Snapshotindex is set to 'all' in the config.yaml file. Running video analysis with all snapshots is very costly! Use the function 'evaluate_network' to choose the best the snapshot. For now, changing snapshot index to -1!
Using snapshot-2000 for model D:/deeplabcut-video/finger3d-camera5-cshh-2021-03-05\dlc-models\iteration-0\finger3d-camera5Mar5-trainset95shuffle1
Initializing ResNet
INFO:tensorflow:Restoring parameters from D:/deeplabcut-video/finger3d-camera5-cshh-2021-03-05\dlc-models\iteration-0\finger3d-camera5Mar5-trainset95shuffle1\train\snapshot-2000
INFO:tensorflow:Restoring parameters from D:/deeplabcut-video/finger3d-camera5-cshh-2021-03-05\dlc-models\iteration-0\finger3d-camera5Mar5-trainset95shuffle1\train\snapshot-2000
Starting to analyze %  D:\deeplabcut-video\3dvideos\finger-camera-5.avi
Video already analyzed! D:\deeplabcut-video\3dvideos\finger-camera-5DLC_resnet50_finger3d-camera5Mar5shuffle1_2000.h5
The videos are analyzed. Now your research can truly start! 
 You can create labeled videos with 'create_labeled_video'.
If the tracking is not satisfactory for some videos, consider expanding the training set. You can use the function 'extract_outlier_frames' to extract any outlier frames!
D:\deeplabcut-video\3dvideos finger-camera-5 DLC_resnet50_finger3d-camera5Mar5shuffle1_2000
Undistorting...
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-24-682fd20e3c04> in <module>
      4 video_path = 'D:\\deeplabcut-video\\3dvideos'
      5 
----> 6 deeplabcut.triangulate(config3d_path, video_path, videotype='avi', gputouse=0, filterpredictions=False)

~\.conda\envs\deeplabcutcore\lib\site-packages\deeplabcutcore\pose_estimation_3d\triangulation.py in triangulate(config, video_path, videotype, filterpredictions, filtertype, gputouse, destfolder, save_as_csv)
    212             #undistort points for this pair
    213             print("Undistorting...")
--> 214             dataFrame_camera1_undistort,dataFrame_camera2_undistort,stereomatrix,path_stereo_file = undistort_points(config,dataname,str(cam_names[0]+'-'+cam_names[1]),destfolder)
    215             if len(dataFrame_camera1_undistort) != len(dataFrame_camera2_undistort):
    216                 import warnings

~\.conda\envs\deeplabcutcore\lib\site-packages\deeplabcutcore\pose_estimation_3d\triangulation.py in undistort_points(config, dataframe, camera_pair, destfolder)
    314     if True:
    315         # Create an empty dataFrame to store the undistorted 2d coordinates and likelihood
--> 316         dataframe_cam1 = pd.read_hdf(dataframe[0])
    317         dataframe_cam2 = pd.read_hdf(dataframe[1])
    318         scorer_cam1 = dataframe_cam1.columns.get_level_values(0)[0]

IndexError: list index out of range

TypeError: unhashable type: 'CommentedMap'

Analyzing video D:\deeplabcut-video\3dvideos\finger-camera-1.avi using config_file_camera-1
Using snapshot-2000 for model D:/deeplabcut-video/finger3d-camera1-cshh-2021-03-05\dlc-models\iteration-0\finger3d-camera1Mar5-trainset95shuffle1
Initializing ResNet
INFO:tensorflow:Restoring parameters from D:/deeplabcut-video/finger3d-camera1-cshh-2021-03-05\dlc-models\iteration-0\finger3d-camera1Mar5-trainset95shuffle1\train\snapshot-2000
INFO:tensorflow:Restoring parameters from D:/deeplabcut-video/finger3d-camera1-cshh-2021-03-05\dlc-models\iteration-0\finger3d-camera1Mar5-trainset95shuffle1\train\snapshot-2000
0it [00:00, ?it/s]
Starting to analyze %  D:\deeplabcut-video\3dvideos\finger-camera-1.avi
Video already analyzed! D:\deeplabcut-video\3dvideos\finger-camera-1DLC_resnet50_finger3d-camera1Mar5shuffle1_2000.h5
The videos are analyzed. Now your research can truly start! 
 You can create labeled videos with 'create_labeled_video'.
If the tracking is not satisfactory for some videos, consider expanding the training set. You can use the function 'extract_outlier_frames' to extract any outlier frames!
D:\deeplabcut-video\3dvideos finger-camera-1 DLC_resnet50_finger3d-camera1Mar5shuffle1_2000
Filtering with median model D:\deeplabcut-video\3dvideos\finger-camera-1.avi

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~\.conda\envs\deeplabcutcore\lib\site-packages\pandas\core\arrays\categorical.py in __init__(self, values, categories, ordered, dtype, fastpath)
    342             try:
--> 343                 codes, categories = factorize(values, sort=True)
    344             except TypeError as err:

~\.conda\envs\deeplabcutcore\lib\site-packages\pandas\core\algorithms.py in factorize(values, sort, na_sentinel, size_hint)
    677         codes, uniques = _factorize_array(
--> 678             values, na_sentinel=na_sentinel, size_hint=size_hint, na_value=na_value
    679         )

~\.conda\envs\deeplabcutcore\lib\site-packages\pandas\core\algorithms.py in _factorize_array(values, na_sentinel, size_hint, na_value, mask)
    500     uniques, codes = table.factorize(
--> 501         values, na_sentinel=na_sentinel, na_value=na_value, mask=mask
    502     )

pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.factorize()

pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable._unique()

TypeError: unhashable type: 'CommentedMap'

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
<ipython-input-25-3fd320d1d100> in <module>
      4 video_path = 'D:\\deeplabcut-video\\3dvideos'
      5 
----> 6 deeplabcut.triangulate(config3d_path, video_path, videotype='avi', gputouse=0, filterpredictions=True)

~\.conda\envs\deeplabcutcore\lib\site-packages\deeplabcutcore\pose_estimation_3d\triangulation.py in triangulate(config, video_path, videotype, filterpredictions, filtertype, gputouse, destfolder, save_as_csv)
    205                     print(destfolder, vname , DLCscorer)
    206                     if filterpredictions:
--> 207                         filtering.filterpredictions(config_2d,[video],videotype=videotype,shuffle=shuffle,trainingsetindex=trainingsetindex,filtertype=filtertype,destfolder=destfolder)
    208                         dataname.append(os.path.join(destfolder,vname + DLCscorer + '.h5'))
    209 

~\.conda\envs\deeplabcutcore\lib\site-packages\deeplabcutcore\post_processing\filtering.py in filterpredictions(config, video, videotype, shuffle, trainingsetindex, filtertype, windowlength, p_bound, ARdegree, MAdegree, alpha, save_as_csv, destfolder)
    108                     Dataframe = pd.read_hdf(sourcedataname,'df_with_missing')
    109                     for bpindex,bp in tqdm(enumerate(cfg['bodyparts'])):
--> 110                         pdindex = pd.MultiIndex.from_product([[scorer], [bp], ['x', 'y','likelihood']],names=['scorer', 'bodyparts', 'coords'])
    111                         x,y,p=Dataframe[scorer][bp]['x'].values,Dataframe[scorer][bp]['y'].values,Dataframe[scorer][bp]['likelihood'].values
    112 

~\.conda\envs\deeplabcutcore\lib\site-packages\pandas\core\indexes\multi.py in from_product(cls, iterables, sortorder, names)
    558             iterables = list(iterables)
    559 
--> 560         codes, levels = factorize_from_iterables(iterables)
    561         if names is lib.no_default:
    562             names = [getattr(it, "name", None) for it in iterables]

~\.conda\envs\deeplabcutcore\lib\site-packages\pandas\core\arrays\categorical.py in factorize_from_iterables(iterables)
   2723         # For consistency, it should return a list of 2 lists.
   2724         return [[], []]
-> 2725     return map(list, zip(*(factorize_from_iterable(it) for it in iterables)))

~\.conda\envs\deeplabcutcore\lib\site-packages\pandas\core\arrays\categorical.py in <genexpr>(.0)
   2723         # For consistency, it should return a list of 2 lists.
   2724         return [[], []]
-> 2725     return map(list, zip(*(factorize_from_iterable(it) for it in iterables)))

~\.conda\envs\deeplabcutcore\lib\site-packages\pandas\core\arrays\categorical.py in factorize_from_iterable(values)
   2695         # but only the resulting categories, the order of which is independent
   2696         # from ordered. Set ordered to False as default. See GH #15457
-> 2697         cat = Categorical(values, ordered=False)
   2698         categories = cat.categories
   2699         codes = cat.codes

~\.conda\envs\deeplabcutcore\lib\site-packages\pandas\core\arrays\categorical.py in __init__(self, values, categories, ordered, dtype, fastpath)
    343                 codes, categories = factorize(values, sort=True)
    344             except TypeError as err:
--> 345                 codes, categories = factorize(values, sort=False)
    346                 if dtype.ordered:
    347                     # raise, as we don't have a sortable data structure and so

~\.conda\envs\deeplabcutcore\lib\site-packages\pandas\core\algorithms.py in factorize(values, sort, na_sentinel, size_hint)
    676 
    677         codes, uniques = _factorize_array(
--> 678             values, na_sentinel=na_sentinel, size_hint=size_hint, na_value=na_value
    679         )
    680 

~\.conda\envs\deeplabcutcore\lib\site-packages\pandas\core\algorithms.py in _factorize_array(values, na_sentinel, size_hint, na_value, mask)
    499     table = hash_klass(size_hint or len(values))
    500     uniques, codes = table.factorize(
--> 501         values, na_sentinel=na_sentinel, na_value=na_value, mask=mask
    502     )
    503 

pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.factorize()

pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable._unique()

TypeError: unhashable type: 'CommentedMap'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant