visiannot.visiannot.ViSiAnnoT¶
Summary¶
Module defining ViSiAnnoT
Classes¶
Class defining the visualization and annotation GUI for a set of synchronized video(s) and signal(s). |
API¶
Class ViSiAnnoT¶
-
class
visiannot.visiannot.ViSiAnnoT.ViSiAnnoT(video_dict, signal_dict, annotevent_dict={}, annotimage_list=[], threshold_dict={}, interval_dict={}, y_range_dict={}, poswid_dict={}, layout_mode=1, flag_long_rec=False, from_cursor_list=[], zoom_factor=2, nb_ticks=10, flag_annot_overlap=False, annot_dir='Annotations', flag_pause_status=False, max_points=5000, time_zone='Europe/Paris', flag_infinite_loop=True, bg_color=(244, 244, 244), bg_color_plot=(255, 255, 255), font_name='Times', font_size=12, font_size_title=16, font_color=(0, 0, 0), current_fmt='%Y-%m-%dT%H:%M:%S.%s', range_fmt='%H:%M:%S.%s', ticks_fmt='%H:%M:%S.%s', ticks_color=(93, 91, 89), ticks_size=12, ticks_offset=5, y_ticks_width=30, nb_table_annot=5, height_widget_signal=150)[source]¶ Bases:
objectClass defining the visualization and annotation GUI for a set of synchronized video(s) and signal(s).
The constructor takes as arguments dictionaries with the path to the video files and signal files. It calls the method
set_all_data()in order to load data and store them in attributes.For a given video file, data are loaded in an instance of cv2.VideoCapture. The set of video data is stored in
video_data_dict. The widgets for plotting video are stored inwid_vid_dict.For a given signal file, data are loaded in an instance of
Signal. The supported formats are txt, mat, h5 and wav. The set ofSignalinstances is stored insig_dict. The widgets for plotting signals are stored inwid_sig_list.The reference frequency
ViSiAnnoT.fpsis defined as the video frequency. If there is no video to display,ViSiAnnoT.fpsis defined as the frequency of the first signal to plot. The playback speed (both video and signal temporal cursor) is at the reference frequency.The temporal range is defined by
first_frameandlast_frame(sampled atViSiAnnoT.fps). The signal widgets display the signal between those bounds. So when zooming in/out, the temporal range is modified and then the display is updated with the methodupdate_signal_plot().The playback is managed with two separate threads:
Reading next video frame - an instance of threading.Thread with the method
update_video_frame()as target,Updating plot - an instance of QtCore.QTimer connected to the method
update_plot().
The current position in the video file (i.e. the current position of the temporal cursor) is
frame_id(sampled atViSiAnnoT.fps).- Parameters
video_dict (dict) –
video configuration, each item corresponds to one camera. Key is the camera ID (string). Value is a configuration list with 4 elements:
(str) Path to the video file,
(str) Delimiter to get beginning datetime in the video file name,
(int) Position of the beginning datetime in the video file name, according to the delimiter,
(str) Format of the beginning datetime in the video file name (either
"posix"or a format compliant withdatetime.strptime()).
signal_dict (dict) –
signal configuration, each item corresponds to one signal widget. Key is the widget ID (Y axis label, string). Value is a nested list of signal configurations. Each element of the nested list corresponds to one signal plot and is a configuration list of 7 elements:
(str) Path to the signal file, data must be stored in a 1D array if regularly sampled, otherwise in a 2D array (where first column is the timestamp in milliseconds and the second column the signal value)
(str) Delimiter to get beginning datetime in the signal file name,
(int) Position of the beginning datetime in the signal file name, according to the delimiter,
(str) Format of the beginning datetime in the signal file name (either
"posix"or a format compliant withdatetime.strptime()),(str) Key to access the data (in case of .mat or .h5 file),
(int or float or str) Signal frequency, set it to
0if signal non regularly sampled, set it to-1if same frequency asViSiAnnoT.fps, it may be a string with the path to the frequency attribute in a .h5 file - in case of 2D data with several value columns, then the column index must be specified, e.g."key - 1"or"key - colName"if there is an attribute atkeynamedcolumnswith columns name being comma-separated (first column is always the timestamps),(dict) Plot style, see https://pyqtgraph.readthedocs.io/en/latest/graphicsItems/plotdataitem.html for details, set it to
Nonefor default.
See Signal visualization for details and examples.
annotevent_dict (dict) – events annotation configuration, key is the label (string), value is the associated color (RGBA)
annotimage_list (list) – labels for image extraction
threshold_dict (dict) –
threshold configuration. Each item corresponds to a signal widget on which to plot threshold(s). The key must be the same as in
signal_dict. Value is a list of configuration lists. This is a nested list because there can be several thresholds plotted in the same widget. A configuration list has 2 elements:(int or float) Threshold value on Y axis,
(tuple or list) Plot color (RGB).
interval_dict (dict) –
interval configuration. Each item corresponds to a signal widget on which to plot intervals. The key must be the same as in
signal_dict. Value is a nested list of interval configurations. Each element of the nested list corresponds to one type of interval to be plotted on the same signal widget and is a configuration list of 7 elements:(str) Path to the interval file, data can be stored as a 2D array (where each line has 2 elements: start and stop frames) or a 1D array (time series of 0 and 1),
(str) Delimiter to get beginning datetime in the interval file name,
(int) Position of the beginning datetime in the interval file name, according to the delimiter,
(str) Format of the beginning datetime in the interval file name (either
"posix"or a format compliant withdatetime.strptime()),(str) Key to access the data (in case of .mat or .h5 file),
(int) Signal frequency, set it to
-1if same frequency asViSiAnnoT.fps, it may be a string with the path to the frequency attribute in a .h5 file,(tuple or list) Plot color (RGBA).
y_range_dict (dict) – visible Y range for signal widgets, each item corresponds to a signal widget. The key must be the same as in
signal_dict. Value is a list/tuple of length 2 with the min and max values to display on the Y axis. The signal widgets that are not specified in this dictionary have auto-range enabled for Y axis.poswid_dict (dict) –
custom organization of widgets positioning in the window layout. Value is a tuple of length 2
(row, col)or 4(row, col, rowspan, colspan). Key identifies the widget:"video""select_manual""select_from_cursor""annot_event""annot_image""visi""zoomin""zoomout""progress"
The signal widgets are automatically positioned below the progress bar.
layout_mode (int) –
organization of widgets positioning in the window layout (ignored if custom layout organization provided with keyword argument
poswid_dict), one of the following:1(focus on video, works better with a big screen),2(focus on signal, suitable for a laptop screen),3(compact display with some features disabled),4(adapted to portrait screen orientation).
flag_long_rec (bool) – specify if
ViSiAnnoTis launched in the context ofViSiAnnoTLongRec(long recording)from_cursor_list (list) – (tool for fast navigation) list of durations that are available in the combo box to select a temporal range duration in order to display a new temporal range that will begin at the current position of the temporal cursor. Each element is a tuple of length 2
(min, sec). An example:[[0,30],[1,0],[2,0],[3,0],[4,0],[5,0]].zoom_factor (int) – zoom factor
nb_ticks (int) – number of temporal ticks on the X axis of the signals widgets
flag_annot_overlap (bool) – specify if overlap of events annotations is enabled
annot_dir (str) – directory where to save annotations, automatically created if it does not exist
flag_pause_status (bool) – specify if the video is paused when launching
ViSiAnnoTmax_points (int) – maximum number of points to plot for the signals
time_zone (str) – time zone (compliant package pytz)
flag_infinite_loop (bool) – specify if an infinite loop is set after creating the window. Set it to
Falseif severalViSiAnnoTwindows must be displayed simultaneousely, do not forget to store each instance ofViSiAnnoTin a variable and to set manually the infinite loop withinfinite_loop_gui()bg_color (tuple or str) – backgroud color of the GUI, RGB or HEX string
bg_color_plot (tuple or str) – background color of the signal plots, RGB or HEX string
font_name (str) – font used for the text in the GUI (must be available in PyQt5)
font_size (int) – font size of the text in the GUI
font_size_title (int) – font size of the titles in the GUI (progress bar and video widgets)
font_color (tuple) – font color of the text in the GUI, RGB
current_fmt (str) – datetime string format of the current temporal position in progress bar, see keyword argument
fmtofconvert_datetime_to_string()range_fmt (str) – datetime string format of the temporal range duration in progress bar, see keyword argument
fmtofconvert_datetime_to_string()ticks_fmt (str) – datetime string format of X axis ticks text, see keyword argument
fmtofconvert_datetime_to_string()ticks_color (tuple or str) – color of the ticks in the signal plots, RGB or HEX string
ticks_size (int) – size of the ticks values in the signal plots
ticks_offset (int) – offset between the ticks and associated values in the signal plots
y_ticks_width (int) – horizontal space in pixels for the text of Y axis ticks in signal widgets
nb_table_annot (int) – maximum number of labels in a row in the widgets for events annotation and image annotation
height_widget_signal (int) – minimum height in pixel of the signal widgets
Methods for plotting region items (pyqtgraph.LinearRegionItem):
add_item_to_signals(item_list)Displays items in the signal widgets
add_region_to_widgets(bound_1, bound_2[, color])Creates and displays a region item (pyqtgraph.LinearRegionItem) for the progress bar (
wid_progress) and the signal widgets (wid_sig_list)create_text_item(text, pos_ms, pos_y_list[, …])Adds a text item to the signal widgets (
wid_sig_list)remove_region_in_widgets(region_list)Removes a region item from the progress bar widget and the signal widgets
Methods for conversion between milliseconds and frame number:
convert_ms_to_frame_ref(frame_ms)Converts milliseconds to frame number sampled at the reference frequency
ViSiAnnoT.fpsConverts the current temporal range defined by
ViSiAnnoT.first_frameandViSiAnnoT.last_frameto millisecondsget_frame_id_in_ms(frame_id)Converts a frame number to milliseconds
Methods for setting video and signal data:
get_data_frequency(path, freq)Gets the frequency of data in a file
get_synchro_info_signal(line)In case of long recording, gets the path to data file and the start second of a line of a temporary signal synchronization file
get_synchro_info_video(line)In case of long recording, gets the path to video file, the start second and end second of a line of a temporary signal synchronization file
get_synchro_signal(path, delimiter, pos, …)Gets synchronized signal data for current file in the long recording
get_synchro_video(path)Gets info for video synchronization for the current file in the long recording
set_all_data(video_dict, signal_dict, …)Sets video and signal data (to be called before plotting)
Methods for mouse interaction with plots:
Gets position of the mouse on the Y axis of all the signal widgets
zoom_or_annot_clicked(ev, pos_frame, pos_ms)Manages mouse click for zoom or annotation
Methods for displaying video, signals and progress bar:
init_signal_plot(progbar_wid_pos[, y_range_dict])Creates the signal widgets and initializes the signal plots
Updates the displayed video frame and the plots of the temporal cursor at the current frame position
frame_idCloses streams (elements of
video_data_dict) and deletes temporary signal folderupdate_frame_id(frame_id)Sets the value of current frame
frame_idand updates the displayed video frame and the plots of the temporal cursor at new current frameUpdates (during playback) the displayed video frame and the plots of the temporal cursor at the current frame
frame_idupdate_plot_new_frame(new_frame_id[, …])Updates plots after having set the current frame to display by changing file in long recording or defining a custom temporal range
update_signal_plot([…])Updates the signal plots and the progress bar so that they span the current temporal range defined by
first_frameandlast_frameReads the video stream (launched in a thread)
Callback method for key press interaction:
key_press(ev)Callback method for key press interaction, see Keyboard
key_release(ev)Callback method for key release interaction, see Keyboard
Attributes:
(str) Datetime string format of the text of X axis ticks
(int) Number of temporal ticks on the X axis of the signals plots
(str) Time zone (as in package pytz)
(int) Maximum number of points to plot for the signals
(list) Default plot styles for signals on a single widget (length 10)
(str) Directory where the events annotations and extracted images are saved
(bool) Specify if
ViSiAnnoTis launched in the context ofViSiAnnoTLongRec(dict) Video data, each item corresponds to one camera
(dict) Signal data, each item corresponds to a signal widget
(dict) Intervals to plot on signals, each item corresponds to one signal widget
(int) Reference frequency
(int) Number of frames in the video (or the first signal if there is no video)
(datetime.datetime) Beginning datetime of the data (current file in case of long recording)
(dict) Thresholds to plot on signals widgets, each item corresponds to one signal widget
(int) Start position (frame number) for custom manual zoom (set to -1 if not defined)
(int) End position (frame number) for custom manual zoom (set to -1 if not defined)
(list) Instances of pyqtgraph.LinearRegionItem with all the grey regions for custom manual zoom
(list) Instances of pyqtgraph.TextItem with the duration of the custom manual zoom
(bool) Specify if the video is paused
(int) Index of the current frame
(int) First frame that is displayed in the signal plots
(int) Last frame that is displayed in the signal plots
(bool) Specify if the window is running
(QtWidgets.QApplication) GUI initializer
(QtWidgets.QWidget) Window container
(QtWidgets.QGridLayout) layout filling the window
(
MenuBar) Menu bar item, instance of a sub-class of QtWidgets.QMenuBar, by default it is hidden, seekey_release()for the keyword shortcut for displaying it(
CustomTemporalRangeWidget) Widget for defining a custom temporal range(
FromCursorTemporalRangeWidget) Widget for selecting a duration of temporal range to be started at the current frame(
ProgressWidget) Widget containing the progress bar(dict) Video widgets, each item corresponds to one camera
(list) Signal widgets, each element is an instance of
SignalWidget(same order assig_dict)(
FullVisiWidget) Widget for zooming out to the full temporal range(
ZoomInWidget) Widget for zooming in(
ZoomOutWidget) Widget for zooming out(
AnnotEventWidget) Widget for events annotation(
AnnotImageWidget) Widget for image extraction(threading.Thread) Thread for getting video frames, connected to the method
ViSiAnnoT.update_video_frame()(QtCore.QTimer) Thread for updating the current frame position, connected to the method
ViSiAnnoT.update_plot()-
add_item_to_signals(item_list)[source]¶ Displays items in the signal widgets
- Parameters
item_list (list) – items to display in the signal widgets, same length as
wid_sig_list, each element corresponds to one signal widget
-
add_region_to_widgets(bound_1, bound_2, color=(150, 150, 150, 50))[source]¶ Creates and displays a region item (pyqtgraph.LinearRegionItem) for the progress bar (
wid_progress) and the signal widgets (wid_sig_list)- Parameters
bound_1 (int) – start frame of the region item (sampled at the reference frequency
ViSiAnnoT.fps)bound_2 (int) – end frame of the region item (sampled at the reference frequency
ViSiAnnoT.fps)color (tuple or list) – plot color (RGBA)
- Returns
instances of pyqtgraph.LinearRegionItem (corresponding to the same region), first element displayed in the progress bar widget, remaining elements displayed in the widget signals
- Return type
list
-
convert_ms_to_frame_ref(frame_ms)[source]¶ Converts milliseconds to frame number sampled at the reference frequency
ViSiAnnoT.fps- Parameters
frame_ms (float) – frame number in milliseconds
- Returns
frame number sampled at the reference frequency
ViSiAnnoT.fps- Return type
int
-
create_text_item(text, pos_ms, pos_y_list, text_color=(0, 0, 0), border_color=(255, 255, 255), border_width=3)[source]¶ Adds a text item to the signal widgets (
wid_sig_list)See https://pyqtgraph.readthedocs.io/en/latest/functions.html#pyqtgraph.mkColor for supported color formats.
- Parameters
text (str) – text to display in the signal widgets (it is the same in each widget)
pos_ms (float) – temporal position (X axis) of the text item in milliseconds
pos_y_list (float) – position on the Y axis of the text item in each signal widget, same length as
wid_sig_listtext_color (tuple or list or str) – color of the text
border_color (tuple or list or str) – color of the text item border
border_width (int) – width of the text item border in pixels
- Returns
instances of pyqtgraph.TextItem, each element corresponds to a signal widget, same length and order as
wid_sig_list- Return type
list
-
get_current_range_in_ms()[source]¶ Converts the current temporal range defined by
ViSiAnnoT.first_frameandViSiAnnoT.last_frameto milliseconds- Returns
first_frame_ms (int) – first frame of the current temporal range in milliseconds
last_frame_ms (int) – last frame of the current temporal range in milliseconds
-
get_data_frequency(path, freq)[source]¶ Gets the frequency of data in a file
- Parameters
path (str) – path to the data file
freq (str or float) – data frequency as retrieved from input configuration dictionary (it may be directly the frequency, or the key to get frequency in a H5 file)
- Returns
data frequency
- Return type
float
-
get_frame_id_in_ms(frame_id)[source]¶ Converts a frame number to milliseconds
- Parameters
frame_id (int) – frame number sampled at the reference frequency
ViSiAnnoT.fps- Returns
frame number in milliseconds
- Return type
float
-
get_mouse_y_position(ev)[source]¶ Gets position of the mouse on the Y axis of all the signal widgets
- Parameters
ev (QtGui.QMouseEvent) – emitted when the mouse is clicked/moved
- Returns
same length as
wid_sig_list, each element is the position of the mouse on the Y axis in the corresponding signal widget, it returns[]if the mouse clicked on a label item (most likely the widget title)- Return type
list
-
get_synchro_info_signal(line)[source]¶ In case of long recording, gets the path to data file and the start second of a line of a temporary signal synchronization file
- Parameters
line (str) – line of a temporary signal synchronization file
delimiter (str) – delimiter used to split the line
- Returns
path (str) – path to the signal file
start_sec (float) – start second
-
get_synchro_info_video(line)[source]¶ In case of long recording, gets the path to video file, the start second and end second of a line of a temporary signal synchronization file
- Parameters
line (str) – line of a temporary signal synchronization file
delimiter (str) – delimiter used to split the line
- Returns
path (str) – path to the signal file
start_sec (float) – start second
end_sec (float) – end second
-
get_synchro_signal(path, delimiter, pos, fmt, key_data, freq_data, signal_id, flag_interval=False)[source]¶ Gets synchronized signal data for current file in the long recording
- Parameters
path (str) – path to the temporary synchronization file
delimiter (str) – delimiter to get the signal file timestamp in the file name
pos (int) – position of the signal file timestamp in the file name
fmt (str) – format of signal file timestamp found in the file name
key_data (str) – key to access the data (in case of .h5 or .mat file)
freq_data (float or str) – signal frequency as found in the configuration file, in case this is a string, then the frequency is retrieved in the data file
signal_id (str) – signal type (key in the dictionary
signal_dict, second positional argument ofViSiAnnoTconstructor)tmp_delimiter (str) – delimiter used to split the lines of the temporary signal files
flag_interval (bool) – specify if data to load is intervals
- Returns
data (numpy array) – synchronized signal data
freq_data (float) – signal frequency
-
get_synchro_video(path)[source]¶ Gets info for video synchronization for the current file in the long recording
It is assumed that all videos have the same frequency, stored as reference frequency in attribute
fps.- Parameters
path (str) – path to the current temporary synchronization file
- Returns
video_data_list (list) – instances of cv2.VideoCapture with video data spanning the current file in the long recording
path_list (list) – names of the video files corresponding to the elements of
video_data_listframe_array (numpy array) – shape (n, 2), where n is equal to the length of
video_data_list, each row corresponds to an element ofvideo_data_list(same ordering) and gives the starting frame and ending frame (sampled at video FPS) that the video spans in the current file of the long recording
-
init_signal_plot(progbar_wid_pos, y_range_dict={}, **kwargs)[source]¶ Creates the signal widgets and initializes the signal plots
The widgets are automatically positioned below the progress bar.
It sets the attribute
ViSiAnnoT.wid_sig_list.Make sure the attributes
ViSiAnnoT.lay,ViSiAnnoT.sig_dict,ViSiAnnoT.threshold_dictandViSiAnnoT.interval_dictare defined before calling this method.- Parameters
progbar_wid_pos (tuple of list) – position of the progress bar widget, length 2
(row, col)or 4(row, col, rowspan, colspan)y_range_dict (dict) – visible Y range for signal widgets, see positional argument
y_range_dictofViSiAnnoTconstructorkwargs – keyword arguments of the constructor of
SignalWidget, excepty_rangeandleft_label
-
key_press(ev)[source]¶ Callback method for key press interaction, see Keyboard
- Parameters
ev (QtGui.QKeyEvent) – emmited when a key is pressed
-
key_release(ev)[source]¶ Callback method for key release interaction, see Keyboard
- Parameters
ev (QtGui.QKeyEvent) – emmited when a key is released
-
plot_frame_id_position()[source]¶ Updates the displayed video frame and the plots of the temporal cursor at the current frame position
frame_idIf
frame_idis out of the temporal range (defined byfirst_frameandlast_frame), then the temporal range is updated. For example, in the context of long recording, this might happen when navigating from one file to another. If the temporal range is updated, then the methodupdate_signal_plot()is called in order to update the signal plots with the new temporal range.The attribute
img_vid_dictis set with the values inim_dictin order to update the displayed video frame.If the navigation point of the progress bar is not dragged, then the attribute
wid_progressis modified in order to update the position of the navigation point.The attribute
current_cursor_listis set in order to update the position of the temporal cursor in the signal widgets.
-
remove_region_in_widgets(region_list)[source]¶ Removes a region item from the progress bar widget and the signal widgets
- Parameters
region_list (list) – instances of pyqtgraph.LinearRegionItem, all elements correspond to the same region displayed in the different widgets, first element is the region item displayed in the progress bar widget (
wid_progress) and the remaining elements are the region items displayed in the signal widgets (same order aswid_sig_list)
-
set_all_data(video_dict, signal_dict, interval_dict)[source]¶ Sets video and signal data (to be called before plotting)
Make sure the following attributes are defined before calling this method:
Make sure the follwing attributes are initialized before calling this method (it can be empty):
Otherwise the video thread throws a RunTime error. These attributes are then set thanks to the positional arguments
video_dict,signal_dictandinterval_dict.This method sets the following attributes:
If there is no video, the attributes
nframes,ViSiAnnoT.fpsandbeginning_datetimeare set with the first signal insignal_dict.
-
stop_processing()[source]¶ Closes streams (elements of
video_data_dict) and deletes temporary signal folderIt sets the value of
flag_processingtoFalseso that the threadupdate_frame_threadis stopped.
-
update_frame_id(frame_id)[source]¶ Sets the value of current frame
frame_idand updates the displayed video frame and the plots of the temporal cursor at new current frameThe displayed video frame and the plots are updated by calling the method
plot_frame_id_position().- Parameters
frame_id (int) – new current frame index
-
update_plot()[source]¶ Updates (during playback) the displayed video frame and the plots of the temporal cursor at the current frame
frame_idIt is called by the thread
timer.The displayed video frame and the plots are updated by calling the method
plot_frame_id_position().It is only effective if
flag_pause_statusisFalse.It increments the value of
frame_id.
-
update_plot_new_frame(new_frame_id, new_temporal_range=None, flag_previous_scroll=False)[source]¶ Updates plots after having set the current frame to display by changing file in long recording or defining a custom temporal range
- Parameters
new_frame_id (int) – new current frame number (sampled at the reference frequency
ViSiAnnoT.fps)new_temporal_range (tuple) – new temporal range (first frame, last frame), if last frame is above
ViSiAnnoT.nframes, then it is truncated - by default it starts at 0 (or at the end of the file in case of backward scrolling) and keeps the same current temporal range durationflag_previous_scroll (bool) – specify if the new file is reach backward by scrolling
-
update_signal_plot(flag_reset_combo_from_cursor=True)[source]¶ Updates the signal plots and the progress bar so that they span the current temporal range defined by
first_frameandlast_frame- Parameters
flag_reset_combo_from_cursor (bool) – specify if the combo box of
wid_from_cursormust be reset
-
update_video_frame()[source]¶ Reads the video stream (launched in a thread)
Called by the thread
update_frame_thread.It updates the attribute
wid_vid_dictwith the image at the current frame for each camera.
-
zoom_or_annot_clicked(ev, pos_frame, pos_ms)[source]¶ Manages mouse click for zoom or annotation
- Parameters
ev (QtGui.QMouseEvent) – emitted when the mouse is clicked/moved
pos_frame (int) – mouse position on the X axis in frame number (sampled at the reference frequency
ViSiAnnoT.fps)pos_ms (int) – mouse position on the X axis in milliseconds
-
annot_dir¶ (str) Directory where the events annotations and extracted images are saved
-
app¶ (QtWidgets.QApplication) GUI initializer
-
beginning_datetime¶ (datetime.datetime) Beginning datetime of the data (current file in case of long recording)
-
first_frame¶ (int) First frame that is displayed in the signal plots
-
flag_long_rec¶ (bool) Specify if
ViSiAnnoTis launched in the context ofViSiAnnoTLongRec
-
flag_pause_status¶ (bool) Specify if the video is paused
-
flag_processing¶ (bool) Specify if the window is running
-
fps¶ (int) Reference frequency
-
frame_id¶ (int) Index of the current frame
-
interval_dict¶ (dict) Intervals to plot on signals, each item corresponds to one signal widget
Key is the data type of the signal widget on which to plot (same as in positional argument
signal_dictof the constructor ofViSiAnnoT)Value is a list of lists, so that several intervals files can be plotted on the same signal widget. Each sub-list has 3 elements:
(numpy array) Intervals data, shape

(float) Frequency (
0if timestamps,-1if same as signal)(tuple) Plot color (RGBA)
-
last_frame¶ (int) Last frame that is displayed in the signal plots
Actually, the last frame that is displayed is
last_frame` - 1, because of zero-indexation.
-
lay¶ (QtWidgets.QGridLayout) layout filling the window
-
max_points¶ (int) Maximum number of points to plot for the signals
(
MenuBar) Menu bar item, instance of a sub-class of QtWidgets.QMenuBar, by default it is hidden, seekey_release()for the keyword shortcut for displaying it
-
nb_ticks¶ (int) Number of temporal ticks on the X axis of the signals plots
-
nframes¶ (int) Number of frames in the video (or the first signal if there is no video)
-
plot_style_list¶ (list) Default plot styles for signals on a single widget (length 10)
-
region_zoom_list¶ (list) Instances of pyqtgraph.LinearRegionItem with all the grey regions for custom manual zoom
-
region_zoom_text_item_list¶ (list) Instances of pyqtgraph.TextItem with the duration of the custom manual zoom
Same length and order as
ViSiAnnoT.wid_sig_list, so that one element corresponds to one signal widget
-
sig_dict¶ (dict) Signal data, each item corresponds to a signal widget
Key is the data type (same keys as
signal_dict, positional argument of the constructor), used as label of the Y axis of the corresponding widget.Value is a list of instances of
Signalto plot on the corresponding widget
-
threshold_dict¶ (dict) Thresholds to plot on signals widgets, each item corresponds to one signal widget
Key is the data type of the signal widget on which to plot (same as in positional argument
signal_dictof the constructor ofViSiAnnoT)Value is a list of length 2:
(float) Value of the threshold on Y axis
(tuple) Color to plot (RGB), it can also be a string with HEX color
-
ticks_fmt¶ (str) Datetime string format of the text of X axis ticks
-
time_zone¶ (str) Time zone (as in package pytz)
-
timer¶ (QtCore.QTimer) Thread for updating the current frame position, connected to the method
ViSiAnnoT.update_plot()
-
update_frame_thread¶ (threading.Thread) Thread for getting video frames, connected to the method
ViSiAnnoT.update_video_frame()
-
video_data_dict¶ (dict) Video data, each item corresponds to one camera
Key is the camera ID (same keys as
video_dict, positional argument of the constructor ofViSiAnnoT).If
flag_long_recisFalse, value is a tuple of 2 elements:(cv2.VideoCapture) Video data
(str) Name of the video file
If
flag_long_recisTrue, value is a tuple of 3 elements:(list) Instances of cv2.VideoCapture containing the video data spanning the current file in the long recording
(list) Names of the the video files spanning the current file in the long recording (same ordering than list of cv2.VideoCapture instances)
(numpy array) Array of shape (n, 2) (n is equal to the length of the list of video data), each row corresponds to an element of the list of cv2.VideoCapture instances (same ordering) and contains the bounding frames that the video spans in the current file in the long recording
-
wid_annotevent¶ (
AnnotEventWidget) Widget for events annotation
-
wid_annotimage¶ (
AnnotImageWidget) Widget for image extraction
-
wid_from_cursor¶ (
FromCursorTemporalRangeWidget) Widget for selecting a duration of temporal range to be started at the current frame
-
wid_progress¶ (
ProgressWidget) Widget containing the progress bar
-
wid_sig_list¶ (list) Signal widgets, each element is an instance of
SignalWidget(same order assig_dict)
-
wid_time_edit¶ (
CustomTemporalRangeWidget) Widget for defining a custom temporal range
-
wid_vid_dict¶ (dict) Video widgets, each item corresponds to one camera
Key is the camera ID (same keys as the positional argument
video_dictof the constructor ofViSiAnnoT).Value is an instance of
VideoWidgetwhere the corresponding camera is displayed.
-
wid_visi¶ (
FullVisiWidget) Widget for zooming out to the full temporal range
-
wid_zoomin¶ (
ZoomInWidget) Widget for zooming in
-
wid_zoomout¶ (
ZoomOutWidget) Widget for zooming out
-
win¶ (QtWidgets.QWidget) Window container
-
zoom_pos_1¶ (int) Start position (frame number) for custom manual zoom (set to -1 if not defined)
-
zoom_pos_2¶ (int) End position (frame number) for custom manual zoom (set to -1 if not defined)