sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib package

Submodules

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util module

Miscellaneous utility classes and functions.

class sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.EasyDict[source]

Bases: dict

Convenience class that behaves like a dict but allows access with the attribute syntax.

class sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.Logger(file_name: str = None, file_mode: str = 'w', should_flush: bool = True)[source]

Bases: object

Redirect stderr to stdout, optionally print stdout to a file, and optionally force flushing on both stdout and the file.

close() None[source]

Flush, close possible files, and remove stdout/stderr mirroring.

flush() None[source]

Flush written text to both stdout and a file, if open.

write(text: str | bytes) None[source]

Write text to stdout (and a file) and optionally flush.

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.ask_yes_no(question: str) bool[source]

Ask the user the question until the user inputs a valid answer.

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.call_func_by_name(*args, func_name: str = None, **kwargs) Any[source]

Finds the python object with the given name and calls it as a function.

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.construct_class_by_name(*args, class_name: str = None, **kwargs) Any[source]

Finds the python class with the given name and constructs it with the given arguments.

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.copy_files_and_create_dirs(files: List[Tuple[str, str]]) None[source]

Takes in a list of tuples of (src, dst) paths and copies files. Will create all necessary directories.

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.format_time(seconds: int | float) str[source]

Convert the seconds to human readable string with days, hours, minutes and seconds.

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.get_dtype_and_ctype(type_obj: Any) Tuple[dtype, Any][source]

Given a type name string (or an object having a __name__ attribute), return matching Numpy and ctypes types that have the same size in bytes.

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.get_module_dir_by_obj_name(obj_name: str) str[source]

Get the directory path of the module containing the given object name.

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.get_module_from_obj_name(obj_name: str) Tuple[ModuleType, str][source]

Searches for the underlying module behind the name to some python object. Returns the module and the object name (original name with module part removed).

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.get_obj_by_name(name: str) Any[source]

Finds the python object with the given name.

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.get_obj_from_module(module: ModuleType, obj_name: str) Any[source]

Traverses the object name and returns the last (rightmost) python object.

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.get_top_level_function_name(obj: Any) str[source]

Return the fully-qualified name of a top-level function.

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.is_pickleable(obj: Any) bool[source]
sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.is_top_level_function(obj: Any) bool[source]

Determine whether the given object is a top-level function, i.e., defined at module scope using ‘def’.

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.is_url(obj: Any, allow_file_urls: bool = False) bool[source]

Determine whether the given object is a valid URL string.

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.list_dir_recursively_with_ignore(dir_path: str, ignores: List[str] = None, add_base_to_relative: bool = False) List[Tuple[str, str]][source]

List all files recursively in a given directory while ignoring given file and directory names. Returns list of tuples containing both absolute and relative paths.

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.make_cache_dir_path(*paths: str) str[source]
sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.open_url(url: str, cache_dir: str = None, num_attempts: int = 10, verbose: bool = True, return_filename: bool = False, cache: bool = True) Any[source]

Download the given URL and return a binary-mode file object to access the data.

sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.set_cache_dir(path: str) None[source]
sketchkit.stylization.brushstrokesengine.thirdparty.stylegan2_ada_pytorch.dnnlib.util.tuple_product(t: Tuple) Any[source]

Calculate the product of the tuple elements.

Module contents