Labelling
Extracting labelled images
- class simba.labelling.extract_labelled_frames.AnnotationFrameExtractor(clfs: List[str], settings: Dict[str, int], config_path: str)[source]
Bases:
ConfigReader
Extracts all human annotated frames where behavior is annotated as present into .pngs within a SimBA project.
- Parameters
Note
Use settings={‘downsample’: 2} to downsample all .pngs to 0.5 original size for disk space savings.
- Example
>>> extractor = AnnotationFrameExtractor(config_path='project_folder/project_config.ini', clfs=['Sniffing', 'Attack'], settings={'downsample': 2}) >>> extractor.run()
SimBA advanced GUI labelling interface
- class simba.labelling.labelling_advanced_interface.AdvancedLabellingInterface(config_path: str, file_path: str, continuing: bool)[source]
Bases:
ConfigReader
Launch advanced labelling (annotation) interface in SimBA.
- Parameters
Examples
>>> select_labelling_video_advanced(config_path='MyProjectConfig', file_path='MyVideoFilePath', continuing=True)
SimBA GUI labelling interface
- class simba.labelling.labelling_interface.LabellingInterface(config_path: str, file_path: str, threshold_dict: Optional[Dict[str, float]] = None, setting: typing_extensions.Literal['from_scratch', 'pseudo'] = 'pseudo', continuing: bool = False)[source]
Bases:
ConfigReader
Launch
standard
orpseudo
-labelling (annotation) GUI interface in SimBA.Note
Tutorial <https://github.com/sgoldenlab/simba/blob/master/docs/label_behavior.md>`__.
- Parameters
config_path (str) – path to SimBA project config file in Configparser format
file_path (str) – Path to video that is to be annotated
setting (str) – String representing annotation method. OPTIONS:
from_scratch
orpseudo
threshold_dict (dict) – If setting
pseudo
, threshold_dict dict contains the machine probability thresholds, with the classifier names as keys and the classification probabilities as values, e.g. {‘Attack’: 0.40, ‘Sniffing’: 0.7).continuing (bool) – If True, continouing previously started annotation session.
Examples
>>> select_labelling_video(config_path='MyConfigPath', threshold_dict={'Attack': 0.4}, file_path='MyVideoFilePath', setting='pseudo', continuing=False)