deepof.annotation_utils

Functions and general utilities for supervised pose estimation. See documentation for details.

Functions

assign_custom_behavior_colors([custom_behaviors])

Returns a list of hex colors (same order as custom_behaviors), uses user defined colors if available

augment_with_neighbors(X_huddle[, window, ...])

Expands a given set of features with leading and lagging features on the time axis.

calculate_close_range(df, mouse_id, ...)

Detects for a given set of mouse coordinates if the selected bodypart of the selected mouse is close to any bodypart of any other mouse for each frame.

climb_arena(arena_type, arena, pos_dict, ...)

Return True if the specified mouse is climbing the wall.

close_double_contact(pos_dframe, left1, ...)

Return a boolean array that's True if the specified body parts are closer than tol.

close_single_contact(pos_dframe, left, ...)

Return a boolean array that's True if the specified body parts are closer than tol.

compute_climb_arena(ctx, animal_id)

compute_detect_activity(ctx, animal_id)

compute_following(ctx, mice_pair)

Directional: (a,b) means a follows b.

compute_immobility(ctx, animal_id)

compute_nose2body(ctx, mice_pair)

Directional: (a,b) means a_nose close to any of b main_body parts.

compute_nose2nose(ctx, mice_pair)

nondirectional, noses of both mice are close

compute_nose2tail(ctx, mice_pair)

Directional: (a,b) means a_nose close to b_tailbase

compute_rearing(ctx, animal_id)

compute_sidebyside(ctx, mice_pair)

nondirectional, mice are next to each other nose by nose

compute_sidereside(ctx, mice_pair)

nondirectional, mice are next to each other nose by tail

compute_sniff_arena(ctx, animal_id)

compute_sniffing(ctx, animal_id)

compute_stat_lookaround(ctx, animal_id)

detect_activity(speed_dframe, ...[, ...])

Return true when the mouse is either moving (moving), standing still and either moving (active) or not moving (passive).

digging(speed_dframe, dist_dframe, ...[, ...])

Return true when the mouse is digging.

following_path(distance_dframe, ...[, ...])

Return True if 'follower' is closer than tol to the path that followed has walked over the last specified number of frames.

frame_corners(w, h[, corners])

Return a dictionary with the corner positions of the video frame.

immobility(X_huddle, huddle_estimator[, ...])

Return true when the mouse is huddling a pretrained model.

max_behaviour(behaviour_dframe[, ...])

Return the most frequent behaviour in a window of window_size frames.

outside_ellipse(x, y, e_center, e_axes, e_angle)

Auxiliar function to climb_wall and sniff_object.

postprocess_following(y, ctx, animal_ids)

Standard postprocessing, then removal of short segments

postprocess_identity(y, ctx, animal_ids)

Does not apply any postprocessing, used for e.g. continuous behaviors.

postprocess_median_filtering(y, ctx, ...)

Default postprocessing for most binary behaviors.

rearing(pos_dframe, speed_dframe, ...[, ...])

Return true when the mouse is sniffing around using simple rules.

rotate(origin, point, ang)

Auxiliar function to climb_wall and sniff_object.

sniff_around(speed_dframe, ...[, ...])

Return true when the mouse is sniffing around using simple rules.

sniff_object(speed_dframe, arena, pos_dict, ...)

Return True if the specified mouse is sniffing an object.

stationary_lookaround(speed_dframe, ...[, ...])

Return true when the mouse is standing still and looking around (moving nose without head being tilted too much).

supervised_tagging(coord_object, raw_coords, ...)

Output a dataframe with the registered motives per frame.

validate_custom_behaviors([...])

Classes

BehaviorContext(key, animal_ids, frame_rate, ...)

Behavior_output(value)

An enumeration.

Behavior_scope(value)

An enumeration.

DeepOF_behavior(name, scope, output_type, ...)

Class for different types of behaviors that The supervised annotations of DeepOF can process.