Misc.

packnet_sfm.utils.misc.filter_dict(dictionary, keywords)[source]

Returns only the keywords that are part of a dictionary

Parameters
  • dictionary (dict) – Dictionary for filtering

  • keywords (list of str) – Keywords that will be filtered

Returns

keywords – List containing the keywords that are keys in dictionary

Return type

list of str

packnet_sfm.utils.misc.make_list(var, n=None)[source]

Wraps the input into a list, and optionally repeats it to be size n

Parameters
  • var (Any) – Variable to be wrapped in a list

  • n (int) – How much the wrapped variable will be repeated

Returns

var_list – List generated from var

Return type

list

packnet_sfm.utils.misc.same_shape(shape1, shape2)[source]

Checks if two shapes are the same

Parameters
  • shape1 (tuple) – First shape

  • shape2 (tuple) – Second shape

Returns

flag – True if both shapes are the same (same length and dimensions)

Return type

bool