pyVHR.plot package

Submodules

pyVHR.plot.visualize module

class pyVHR.plot.visualize.VisualizeParams

Bases: object

This class contains usefull parameters used by this module.

The “renderer” variable is used for rendering plots on Jupyter notebook (‘notebook’) or Colab notebook (‘colab’).

renderer = 'colab'
pyVHR.plot.visualize.display_video(video_file_name, scaling=1)

This method create an interactive plot for visualizing the frames of a video. This method must be called inside a Jupyter notebook or a Colab notebook.

Parameters
  • video_file_name (str) – video file name or path.

  • scaling (float) – scale factor useful for enlarging or decreasing the resolution of the image.

pyVHR.plot.visualize.interactive_image_plot(images_list, scaling=1)

This method create an interactive plot of a list of images. This method must be called inside a Jupyter notebook or a Colab notebook.

Parameters
  • images_list (list of ndarray) – list of images as ndarray with shape [rows, columns, rgb_channels].

  • scaling (float) – scale factor useful for enlarging or decreasing the resolution of the image.

pyVHR.plot.visualize.plot_circle(theta, l=None, C1=None, C2=None, radius=500)

TODO: documentare Produce a plot with the locations of all poles and zeros

pyVHR.plot.visualize.visualize_BPMs(BPMs_list)

This method create a plotly plot for visualizing a list of BPM signals. This method must be called inside a Jupyter notebook or a Colab notebook.

Parameters

BPMs_list (list) – The BPM signals is a 2D list structured as [[BPM_list, times, name_tag], …]. The first element is a float32 ndarray that contains the BPM signal, the second element is a float32 1D ndarray that contains the time in seconds of each BPM, the third element is a string that is used in the plot’s legend.

pyVHR.plot.visualize.visualize_BVPs(BVPs, window)

This method create a plotly plot for visualizing a window of a windowed BVP signal. This method must be called inside a Jupyter notebook or a Colab notebook.

Parameters
  • BVPs (list of float32 ndarray) – windowed BPM signal as a list of length num_windows of float32 ndarray with shape [num_estimators, window_frames].

  • window (int) – the index of the window to plot.

pyVHR.plot.visualize.visualize_BVPs_PSD(BVPs, window, fps, minHz=0.65, maxHz=4.0)

This method create a plotly plot for visualizing the Power Spectral Density of a window of a windowed BVP signal. This method must be called inside a Jupyter notebook or a Colab notebook.

Parameters
  • BVPs (list of float32 ndarray) – windowed BPM signal as a list of length num_windows of float32 ndarray with shape [num_estimators, window_frames].

  • window (int) – the index of the window to plot.

  • fps (float) – frames per seconds.

  • minHz (float) – frequency in Hz used to isolate a specific subband [minHz, maxHz] (esclusive).

  • maxHz (float) – frequency in Hz used to isolate a specific subband [minHz, maxHz] (esclusive).

pyVHR.plot.visualize.visualize_BVPs_PSD_clutering(GT_BPM, GT_times, BVPs, times, fps, minHz=0.65, maxHz=4.0, out_fact=1)

TODO: documentare This method create a plotly plot for visualizing the Power Spectral Density of a window of a windowed BVP signal. This method must be called inside a Jupyter notebook or a Colab notebook.

Parameters
  • BVPs (list of float32 ndarray) – windowed BPM signal as a list of length num_windows of float32 ndarray with shape [num_estimators, window_frames].

  • window (int) – the index of the window to plot.

  • fps (float) – frames per seconds.

  • minHz (float) – frequency in Hz used to isolate a specific subband [minHz, maxHz] (esclusive).

  • maxHz (float) – frequency in Hz used to isolate a specific subband [minHz, maxHz] (esclusive).

pyVHR.plot.visualize.visualize_landmarks_list(image_file_name=None, landmarks_list=None)

This method create a plotly plot for visualizing a list of facial landmarks on a given image. This is useful for studying and analyzing the available facial points of MediaPipe (https://google.github.io/mediapipe/solutions/face_mesh.html). This method must be called inside a Jupyter notebook or a Colab notebook.

Parameters
  • image_file_name (str) – image file name or path (preferred png or jpg).

  • landmarks_list (list) – list of positive integers between 0 and 467 that identify patches centers (landmarks).

pyVHR.plot.visualize.visualize_multi_est_BPM_vs_BPMs_list(multi_est_BPM, BPMs_list)

This method create a plotly plot for visualizing a multi-estimator BPM signal and a list of BPM signals. This is usefull when comparing Patches BPMs vs Holistic and Ground Truth BPMs. This method must be called inside a Jupyter notebook or a Colab notebook.

Parameters
  • multi_est_BPM (list) – multi-estimator BPM signal is a list that contains two elements [mul-est-BPM, times]; the first contains BPMs as a list of length num_windows of float32 ndarray with shape [num_estimators, ], the second is a float32 1D ndarray that contains the time in seconds of each BPM.

  • BPMs_list (list) – The BPM signals is a 2D list structured as [[BPM_list, times, name_tag], …]. The first element is a float32 ndarray that contains the BPM signal, the second element is a float32 1D ndarray that contains the time in seconds of each BPM, the third element is a string that is used in the plot’s legend.

pyVHR.plot.visualize.visualize_windowed_sig(windowed_sig, window)

This method create a plotly plot for visualizing a window of a windowed signal. This method must be called inside a Jupyter notebook or a Colab notebook.

Parameters
  • windowed_sig (list of float32 ndarray) – windowed signal as a list of length num_windows of float32 ndarray with shape [num_estimators, rgb_channels, window_frames].

  • window (int) – the index of the window to plot.

Module contents