Visualization#
Visualization containers for viewing behavior videos and corresponding ethograms.
- class animal_soup.viewers.BehaviorVizContainer(dataframe, start_index=0)#
Creates an ipydatagrid and fastplotlib
ImageWidgetviewer based on a dataframe.- Parameters:
dataframe (pd.DataFrame) – Dataframe used to create the ipydatagrid. Datagrid will show a subset of columns from the original dataframe.
start_index (int, default 0) – Row index in datagrid that will start out as being selected initially. Default is first row.
- show()#
Shows the widget.
- class animal_soup.viewers.EthogramVizContainer(dataframe, start_index=0, mode='inference')#
Wraps BehaviorVizContainer, in addition to showing behavior videos, will also show corresponding ethograms.
- Parameters:
dataframe (pd.DataFrame) – Dataframe used to create the ipydatagrid. Datagrid will show a subset of columns from the original dataframe.
start_index (int, default 0) – Row index in datagrid that will start out as being selected initially. Default is first row.
mode (str, default 'inference') – One of [‘ground’, ‘inference’]. The locations of ethograms can either be stored on disk if they have been inferred or in the dataframe if they are hand-labels. Mode argument can be passed to the ethogram viewer to set where to look for available ethograms.
- show()#
Shows the widget.
- class animal_soup.viewers.EthogramCleanerVizContainer(dataframe, start_index=0, mode='inference')#
Creates container for editing ethograms and saving them to a new dataframe.
- Parameters:
dataframe (pandas.Dataframe) – Dataframe to create ipydatagrid viewer from.
start_index (int, default 0) – Row of the dataframe that will initially be selected to view videos and corresponding ethograms.
mode (str, default 'inference') – One of [‘ground’, ‘inference’]. Indicates the location in which to load ethograms for cleaning from as well as where to save cleaned ethograms.
- property current_behavior#
Current behavior selected in ethogram.
- property current_highlight#
Current graphic that is highlighted.
- save_ethogram()#
Saves an ethogram to the clean dataframe or to disk depending on the mode specified at instantiation.
- class animal_soup.viewers.EthogramComparisonVizContainer(dataframe, start_index=0)#
Creates container for editing ethograms and saving them to a new dataframe.
- Parameters:
dataframe (
pandas.Dataframe) – Dataframe for ethograms that need to be cleaned. Should be organized in terms of animal_id and session_id. Should also have columns for comparing ethograms, those that were manually labeled and predictions.start_index (
int, default 0) – Row of the dataframe that will initially be selected to view videos and corresponding ethograms.
- show()#
Shows the widget.