Skip to content

Latest commit

 

History

History
137 lines (80 loc) · 2.51 KB

File metadata and controls

137 lines (80 loc) · 2.51 KB

Utils

Waifu2x Index / Waifu2x / Utils

Auto-generated documentation for waifu2x.utils module.

Namespace

Show source in utils.py:13

Namespace representing a series of key value pairs. Similar to argparse.Namespace.

Signature

class Namespace:
    def __init__(self, kwargs: dict[str, Any]) -> None: ...

Namespace().repr

Show source in utils.py:25

Get a string representation of a namespace.

Returns

Type: str representation of a namespace

Signature

def __repr__(self) -> str: ...

Namespace().str

Show source in utils.py:33

Get a string representation of a namespace.

Returns

Type: str representation of a namespace

Signature

def __str__(self) -> str: ...

Namespace().append

Show source in utils.py:40

Append a new value and update the internal rep.

Arguments

  • key str - key to store a new value at
  • value Any - corresponding value

Signature

def append(self, key: str, value: Any) -> None: ...

get_config

Show source in utils.py:50

Signature

def get_config(base, model, train: bool = True) -> Namespace: ...

See also

load_filelist

Show source in utils.py:104

Get a list of files given a directory.

Arguments

  • directory str - path to a directory
  • shuffle bool - use random.shuffle to change the order of returned files, defaults to False

Returns

Type: list[str] list of file paths

Signature

def load_filelist(directory: str, shuffle: bool = False) -> list[str]: ...

set_random_seed

Show source in utils.py:90

Set a seed given an iv and a gpu index (note -1 is 'no gpu').

Arguments

  • seed float - seed/ iv for random
  • gpu int - gpu index (-1 is no gpu), defaults to -1

Signature

def set_random_seed(seed: float, gpu: int = -1) -> None: ...