Logging

class packnet_sfm.utils.logging.AvgMeter(n_max=100)[source]

Bases: object

Average meter for logging

get()[source]

Get current average

get_and_reset()[source]

Gets current average and resets

reset()[source]

Reset meter

packnet_sfm.utils.logging.pcolor(string, color, on_color=None, attrs=None)[source]

Produces a colored string for printing

Parameters
  • string (str) – String that will be colored

  • color (str) – Color to use

  • on_color (str) – Background color to use

  • attrs (list of str) – Different attributes for the string

Returns

string – Colored string

Return type

str

packnet_sfm.utils.logging.prepare_dataset_prefix(config, n)[source]

Concatenates dataset path and split for metrics logging

Parameters
  • config (CfgNode) – Dataset configuration

  • n (int) – Dataset index for multiple datasets

Returns

prefix – Dataset prefix for metrics logging

Return type

str

packnet_sfm.utils.logging.s3_url(config)[source]

Generate the s3 url where the models will be saved

Parameters

config (CfgNode) – Model configuration

Returns

url – String containing the URL pointing to the s3 bucket

Return type

str