mlfpm / deepof

DeepLabCut based data analysis package including pose estimation and representation learning mediated behavior recognition
MIT License
38 stars 6 forks source link

TypeError: __init__() got an unexpected keyword argument 'path' #3

Closed chemarestrepoCB closed 1 year ago

chemarestrepoCB commented 1 year ago

Hi Lucas,

I'm not sure why this is occurring, but when I create a deepof.data.Project() object, I seem to have an issue with the definition of the path argument:

In [ ]: my_project = deepof.data.Project(path='/Users/Behavioral_tracking/deepof_test/')

TypeError                                 Traceback (most recent call last)
Cell In[16], line 1
----> 1 my_project = deepof.data.Project(path='/Users/Behavioral_tracking/deepof_test/')

TypeError: __init__() got an unexpected keyword argument 'path'

If I omit the 'path' argument, I can successfully create a deepof.data.Project() object but, of course, it doesn't exist anywhere:

In [17]: my_project = deepof.data.Project('/Users/Behavioral_tracking/deepof_test/')

In [18]: my_project.project_path
Out[18]: '.'

In [19]: type(my_project)
Out[19]: deepof.data.Project

Would you have an idea of why this could be happening? I'm already able to import deepof.data without any errors:

In [2]: import deepof.data
2023-02-03 14:16:25.196977: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  XXX
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.

Thanks!

lucasmiranda42 commented 1 year ago

Hi! Documentation is unfortunately outdated on the Project class. We will update our read the docs website soon, but, in the meantime, you can always check the docstrings. If you're using Jupyter notebooks, you can just press shift+tab after opening parentheses - deepof.Project( -.

In particular, this is the current Project docstring:

    """Initializes a Project object.

    Args:
        animal_ids (list): list of animal ids.
        arena (str): arena type. Can be one of "circular-autodetect", "circular-manual", or "polygon-manual".
        enable_iterative_imputation (bool): whether to use iterative imputation for occluded body parts.
        Recommended, but slow.
        exclude_bodyparts (list): list of bodyparts to exclude from analysis.
        exp_conditions (dict): dictionary with experiment IDs as keys and experimental conditions as values.
        interpolate_outliers (bool): whether to interpolate missing data.
        interpolation_limit (int): maximum number of missing frames to interpolate.
        interpolation_std (int): maximum number of standard deviations to interpolate.
        likelihood_tol (float): likelihood threshold for outlier detection.
        model (str): model to use for pose estimation. Defaults to 'mouse_topview' (as described in the
        documentation).
        project_name (str): name of the current project.
        project_path (str): path to the folder containing the DLC output data.
        video_path (str): path where to find the videos to use. If not specified, deepof, assumes they are in your
        project path.
        table_path (str): path where to find the tracks to use. If not specified, deepof, assumes they are in your
        project path.
        smooth_alpha (float): smoothing intensity. The higher the value, the more smoothing.
        table_format (str): format of the table. Defaults to 'autodetect', but can be set to "csv" or "h5".
        video_format (str): video format. Defaults to '.mp4'.
        video_scale (int): diameter of the arena in mm (so far, only round arenas are supported).

    """

Hope this helps! Lucas