Utils#

Functions:

get_max_n_jobs()

rtype:

int

get_filepaths(dir_path)

Gets paths of all image files in the dir_path recursively.

deep_update_dict(d, u)

Updates nested dictionary

get_is_issue_colname(issue_type)

rtype:

str

get_score_colname(issue_type)

rtype:

str

update_df(df, new_df[, overwrite])

Updates df with columns of new_df (must have same number of rows).

cleanvision.utils.utils.get_max_n_jobs()[source]#
Return type:

int

cleanvision.utils.utils.get_filepaths(dir_path)[source]#
Gets paths of all image files in the dir_path recursively.

All image files with extension in TYPES are allowed. Returns a sorted list of sorted filepaths

Parameters:

dir_path (str) – Path to the dir containing image files, can be relative or absolute path

Returns:

Sorted list of image filepaths, note that all paths in this list are absolute paths

Return type:

List[str]

cleanvision.utils.utils.deep_update_dict(d, u)[source]#

Updates nested dictionary

Parameters:
  • d (dict) – dictionary to update

  • u (dict) – Updates

Returns:

Updated dictionary

Return type:

dict

cleanvision.utils.utils.get_is_issue_colname(issue_type)[source]#
Return type:

str

cleanvision.utils.utils.get_score_colname(issue_type)[source]#
Return type:

str

cleanvision.utils.utils.update_df(df, new_df, overwrite=True)[source]#

Updates df with columns of new_df (must have same number of rows). New columns in new_df not present in df are appended as extra columns. Columns in df that are present in new_df have their values overwritten if overwrite==True.

Return type:

DataFrame