facebook360_dep
Facebook360 Depth Estimation Pipeline
Public Member Functions | Public Attributes | List of all members
depth_estimation.DepthEstimation Class Reference

Public Member Functions

def __init__ (self, parent)
 
def add_data_type_validators (self)
 
def setup_farm (self)
 
def initialize_paths (self)
 
def update_noise_detail (self, noise, detail)
 
def update_fg_masks_thresholds (self, blur, closing, thresh)
 
def switch_ui_elements_for_processing (self, state)
 
def update_frame_names (self)
 
def sync_with_s3 (self)
 
def on_process_finished (self, exitCode, exitStatus, p_id)
 
def setup_logs (self)
 
def set_default_top_level_paths (self, mkdirs=False)
 
def update_thresholds_color_variance (self)
 
def update_thresholds_fg_mask (self)
 
def run_thresholds_after_wait (self, type)
 
def save_flag_file (self)
 
def retrieve_missing_flagfiles (self)
 
def add_default_flags (self)
 
def update_flagfile_edit (self, flagfile_fn, switch_to_flag_tab=True)
 
def get_color_frames (self, color_type, suffix)
 
def get_files (self, tag)
 
def update_buttons (self, gb)
 
def update_bg_checkbox (self)
 
def refresh_data (self)
 
def setup_project (self, mkdirs=False, run_thresholds=True)
 
def refresh (self)
 
def update_thresholds (self, type)
 
def on_changed_slider (self, slider, value)
 
def run_thresholds (self, type)
 
def on_terminate_cluster (self)
 
def run_process (self)
 
def cancel_process (self)
 
def reset_run_button_text (self)
 
def update_run_button_text (self)
 
def on_changed_flagfile_edit (self)
 
def on_ec2_dashboard (self)
 
def get_logs (self)
 
def setup_flags (self)
 
def replace_with_host_path (self, flags, fields)
 
def update_flags_from_data (self, flags)
 
def update_data_from_flags (self, flags)
 
def update_data_or_flags (self, flagfile_fn, flagfile_from_data, switch_to_flag_tab=False)
 
def update_flagfile (self, flagfile_fn)
 
def on_changed_dropdown (self, gb, dd)
 
def on_changed_line_edit (self, gb, le)
 
def on_state_changed_partial_360 (self, state)
 
def on_state_changed_recompute (self)
 
def on_state_changed_use_bg (self, state)
 
def on_changed_preview (self)
 
def update_frame_range_dropdowns (self)
 
def on_state_changed_farm (self, state)
 
def populate_dropdowns (self, gb)
 
def setup_data (self)
 
def setup_thresholds (self)
 
def setup_thresholds_color_variance (self)
 
def setup_thresholds_fg_masks (self)
 
def disable_tab_if_no_data (self)
 

Public Attributes

 parent
 
 tag
 
 dlg
 
 aws_staging_ip
 
 log_reader
 
 output_dirs
 

Detailed Description

Tab in UI responsible for depth estimates on video frames.

Attributes:
    aws_staging_ip (str): IP of the staging machine (used for starting the Kubernetes cluster).
    dlg (App(QDialog)): Main dialog box for the app initialized by QT.
    is_farm (bool): Whether or not this is a farm render.
    is_refreshing_data (bool): Whether or not the data is currently being updated.
    log_reader (LogReader(QtCore.QObject)): Object to interact with UI logging system.
    output_dirs (list[str]): List of directories where outputs will be saved.
    parent (App(QDialog)): Object corresponding to the parent UI element.
    path_rig_json (str): Path to the rig JSON.
    tag (str): Semantic name for the tab.

Constructor & Destructor Documentation

◆ __init__()

def depth_estimation.DepthEstimation.__init__ (   self,
  parent 
)
Initializes the DepthEstimation tab.

Args:
    parent (App(QDialog)): Object corresponding to the parent UI element.

Member Function Documentation

◆ add_data_type_validators()

def depth_estimation.DepthEstimation.add_data_type_validators (   self)
Adds validators for UI elements.

◆ add_default_flags()

def depth_estimation.DepthEstimation.add_default_flags (   self)
Retrieves the default flags to the local flagfile.

◆ cancel_process()

def depth_estimation.DepthEstimation.cancel_process (   self)
Stops a running process.

◆ disable_tab_if_no_data()

def depth_estimation.DepthEstimation.disable_tab_if_no_data (   self)
Prevents navigation to the tab if the required data is not present.

◆ get_color_frames()

def depth_estimation.DepthEstimation.get_color_frames (   self,
  color_type,
  suffix 
)

◆ get_files()

def depth_estimation.DepthEstimation.get_files (   self,
  tag 
)
Retrieves file names corresponding to the desired attribute.

Args:
    tag (str): Semantic name for the attribute.

Returns:
    list[str]: List of file names.

Raises:
    Exception: If a tag is requested with no associated files.

◆ get_logs()

def depth_estimation.DepthEstimation.get_logs (   self)

◆ initialize_paths()

def depth_estimation.DepthEstimation.initialize_paths (   self)
Initializes paths for scripts and flags.

◆ on_changed_dropdown()

def depth_estimation.DepthEstimation.on_changed_dropdown (   self,
  gb,
  dd 
)
Callback event handler for changed dropdown.

Args:
    gb (QtWidgets.QGroupBox): Group box for the tab.
    dd (QtWidgets.QComboBox): Dropdown UI element.

◆ on_changed_flagfile_edit()

def depth_estimation.DepthEstimation.on_changed_flagfile_edit (   self)
Callback event handler for flagfile edits.

◆ on_changed_line_edit()

def depth_estimation.DepthEstimation.on_changed_line_edit (   self,
  gb,
  le 
)
Callback event handler for changed line edit.

Args:
    gb (QtWidgets.QGroupBox): Group box for the tab.
    le (QtWidgets.QLineEdit): Line edit UI element.

◆ on_changed_preview()

def depth_estimation.DepthEstimation.on_changed_preview (   self)
Callback event handler for changed image previews.

◆ on_changed_slider()

def depth_estimation.DepthEstimation.on_changed_slider (   self,
  slider,
  value 
)
Callback event handler for changes to a slider UI element.

Args:
    slider (QtWidgets.QSlider): Slider UI element.
    value (int/float): Value of the slider element.

◆ on_ec2_dashboard()

def depth_estimation.DepthEstimation.on_ec2_dashboard (   self)

◆ on_process_finished()

def depth_estimation.DepthEstimation.on_process_finished (   self,
  exitCode,
  exitStatus,
  p_id 
)
Callback event handler for a process completing.

Args:
    exitCode (int): Return code from running the process.
    exitStatus (str): Description message of process exit.
    p_id (str): PID of completed process.

◆ on_state_changed_farm()

def depth_estimation.DepthEstimation.on_state_changed_farm (   self,
  state 
)
Callback event handler for changed "AWS" checkbox.

Args:
    state (str): Identifier of the callback state.

◆ on_state_changed_partial_360()

def depth_estimation.DepthEstimation.on_state_changed_partial_360 (   self,
  state 
)
Callback event handler for changed "partial coverage" checkbox.

Args:
    state (str): Identifier of the callback state.

◆ on_state_changed_recompute()

def depth_estimation.DepthEstimation.on_state_changed_recompute (   self)
Callback event handler for changed "recompute" checkbox.

◆ on_state_changed_use_bg()

def depth_estimation.DepthEstimation.on_state_changed_use_bg (   self,
  state 
)
Callback event handler for changed "use background" checkbox.

Args:
    state (str): Identifier of the callback state.

◆ on_terminate_cluster()

def depth_estimation.DepthEstimation.on_terminate_cluster (   self)
Terminates a running cluster.

◆ populate_dropdowns()

def depth_estimation.DepthEstimation.populate_dropdowns (   self,
  gb 
)
Populates the dropdowns in the tab.

Args:
    gb (QtWidgets.QGroupBox): Group box for the tab.

◆ refresh()

def depth_estimation.DepthEstimation.refresh (   self)
Resets the UI tab to its start state.

◆ refresh_data()

def depth_estimation.DepthEstimation.refresh_data (   self)
Updates UI elements to be in sync with data on disk.

◆ replace_with_host_path()

def depth_estimation.DepthEstimation.replace_with_host_path (   self,
  flags,
  fields 
)
Replaces all references to local paths with their default Docker mounted locations.
This is only relevant for SMB (local farm) renders.

Args:
    flags (dict[str, str]): Data where fields are to be replaced.
    fields (list[str]): Names of flags to be updated.

◆ reset_run_button_text()

def depth_estimation.DepthEstimation.reset_run_button_text (   self)

◆ retrieve_missing_flagfiles()

def depth_estimation.DepthEstimation.retrieve_missing_flagfiles (   self)
Copies the missing flagfiles to project for local modification.

◆ run_process()

def depth_estimation.DepthEstimation.run_process (   self)
Runs the default binary associated with the tab.

◆ run_thresholds()

def depth_estimation.DepthEstimation.run_thresholds (   self,
  type 
)
Runs thresholding based on values in the UI and update UI display.

Args:
    type (str): Type of threshold to run (either "color_variance" or "fg_mask").

◆ run_thresholds_after_wait()

def depth_estimation.DepthEstimation.run_thresholds_after_wait (   self,
  type 
)
Computes the threshold and displays after a delay.

Args:
    type (str): Type of threshold to run (either "color_variance" or "fg_mask").

◆ save_flag_file()

def depth_estimation.DepthEstimation.save_flag_file (   self)
Saves flagfile from the UI to disk.

◆ set_default_top_level_paths()

def depth_estimation.DepthEstimation.set_default_top_level_paths (   self,
  mkdirs = False 
)
Defines class referenceable attributes for paths. See common for full set
of definitions.

Args:
    mkdirs (bool, optional): Whether or not to make the defined directories.

◆ setup_data()

def depth_estimation.DepthEstimation.setup_data (   self)
Sets up callbacks and initial UI element statuses.

◆ setup_farm()

def depth_estimation.DepthEstimation.setup_farm (   self)
Sets up a Kubernetes farm for AWS renders.

◆ setup_flags()

def depth_estimation.DepthEstimation.setup_flags (   self)
Sets up the flags according to the corresponding flagfile.

◆ setup_logs()

def depth_estimation.DepthEstimation.setup_logs (   self)
Sets up logging system for dialog on the current tab.

◆ setup_project()

def depth_estimation.DepthEstimation.setup_project (   self,
  mkdirs = False,
  run_thresholds = True 
)
Retrieves any missing flagfiles and sets the default flags for the tab.

Args:
    mkdirs (bool, optional): Whether or not to make the directories where the
outputs are saved by default.
    run_thresholds (bool, optional): Whether or not to run thresholds on start.

◆ setup_thresholds()

def depth_estimation.DepthEstimation.setup_thresholds (   self)
Sets necessary thresholds apps for the tab.

◆ setup_thresholds_color_variance()

def depth_estimation.DepthEstimation.setup_thresholds_color_variance (   self)
Sets color variance thresholds apps for the tab.

◆ setup_thresholds_fg_masks()

def depth_estimation.DepthEstimation.setup_thresholds_fg_masks (   self)
Sets up the default thresholds on foreground masks.

◆ switch_ui_elements_for_processing()

def depth_estimation.DepthEstimation.switch_ui_elements_for_processing (   self,
  state 
)
Switches element interaction when processing.

Args:
    state (bool): State to which elements should be changed to (i.e.
True for enabled, False for disabled)

◆ sync_with_s3()

def depth_estimation.DepthEstimation.sync_with_s3 (   self)
Syncs data available locally with the S3 bucket.

◆ update_bg_checkbox()

def depth_estimation.DepthEstimation.update_bg_checkbox (   self)
Enables background selection if frames are present.

◆ update_buttons()

def depth_estimation.DepthEstimation.update_buttons (   self,
  gb 
)
Enables buttons and dropdowns according to whether or not data is present.

Args:
    gb (QtWidgets.QGroupBox): Group box for the tab.

◆ update_data_from_flags()

def depth_estimation.DepthEstimation.update_data_from_flags (   self,
  flags 
)
Updates UI elements from the flags.

Args:
    flags (dict[str, _]): Flags corresponding to the tab default binary.

◆ update_data_or_flags()

def depth_estimation.DepthEstimation.update_data_or_flags (   self,
  flagfile_fn,
  flagfile_from_data,
  switch_to_flag_tab = False 
)
Updates the flagfile from the UI elements or vice versa.

Args:
    flagfile_fn (str): Name of the flagfile.
    flagfile_from_data (bool): Whether to load the flagfile from the data (True) or
vice versa (False).
    switch_to_flag_tab (bool, optional): Whether or not to switch tabs after updating.

◆ update_fg_masks_thresholds()

def depth_estimation.DepthEstimation.update_fg_masks_thresholds (   self,
  blur,
  closing,
  thresh 
)
Updates thresholds and display for the foreground masking.

Args:
    blur (int, optional): Gaussian blur radius.
    closing (int, optional): Closure (for sealing holes).
    thresh (int, optional): Threshold applied to segment foreground and background

◆ update_flagfile()

def depth_estimation.DepthEstimation.update_flagfile (   self,
  flagfile_fn 
)
Updates the flagfile from UI elements.

Args:
    flagfile_fn (str): Name of the flagfile.

◆ update_flagfile_edit()

def depth_estimation.DepthEstimation.update_flagfile_edit (   self,
  flagfile_fn,
  switch_to_flag_tab = True 
)
Updates the edit box for the flagfile.

Args:
    flagfile_fn (str): Name of the flagfile.
    switch_to_flag_tab (bool, optional): Whether or not to switch tabs after updating.

◆ update_flags_from_data()

def depth_estimation.DepthEstimation.update_flags_from_data (   self,
  flags 
)
Updates flags from the UI elements.

Args:
    flags (dict[str, _]): Flags corresponding to the tab default binary.

◆ update_frame_names()

def depth_estimation.DepthEstimation.update_frame_names (   self)
Updates dropdowns to account for available frames (on S3 or locally).

◆ update_frame_range_dropdowns()

def depth_estimation.DepthEstimation.update_frame_range_dropdowns (   self)
Updates ranges displayed in dropdowns per available files on disk.

◆ update_noise_detail()

def depth_estimation.DepthEstimation.update_noise_detail (   self,
  noise,
  detail 
)
Updates noise/detail thresholds interaction.

Args:
    noise (float): Noise threshold.
    detail (float): Detail threshold.

◆ update_run_button_text()

def depth_estimation.DepthEstimation.update_run_button_text (   self)
Updates the text of the Run button depending on the existance of a process
running on the cloud

◆ update_thresholds()

def depth_estimation.DepthEstimation.update_thresholds (   self,
  type 
)
Updates flagfile threshold values per UI elements.

Args:
    type (str): Type of threshold to run (either "color_variance" or "fg_mask").

◆ update_thresholds_color_variance()

def depth_estimation.DepthEstimation.update_thresholds_color_variance (   self)
Updates the displayed thresholds for color variance.

◆ update_thresholds_fg_mask()

def depth_estimation.DepthEstimation.update_thresholds_fg_mask (   self)
Updates thresholds and display for the foreground masking using values from UI.

Member Data Documentation

◆ aws_staging_ip

depth_estimation.DepthEstimation.aws_staging_ip

◆ dlg

depth_estimation.DepthEstimation.dlg

◆ log_reader

depth_estimation.DepthEstimation.log_reader

◆ output_dirs

depth_estimation.DepthEstimation.output_dirs

◆ parent

depth_estimation.DepthEstimation.parent

◆ tag

depth_estimation.DepthEstimation.tag

The documentation for this class was generated from the following file: