paraphernalia.torch.siren module

Generate images using a network with sin activation functions.

See https://vsitzmann.github.io/siren/

class Siren(omega=5.0, features=64, hidden_layers=8, start=None, **kwargs)[source]

Siren image generator.

Parameters
  • size – Target size (square for now)

  • omega (Optional[float]) – Fudge factor/weight multiplier. High (around 30) is good for image fitting. Lower values seem better for CLIP-guided generation. Defaults to 5.0.

  • features (Optional[int]) – [description]. Defaults to 64.

  • hidden_layers (int, optional) – [description]. Defaults to 8.

  • device ([type], optional) – [description]. Defaults to None.

  • start (Optional[PIL.Image.Image]) –

Base class for (image) generators.

Parameters
  • batch_size (int, optional) – The number of images per batch. Defaults to 1.

  • size (Union[int, Tuple[int, int]], optional) – The size of the image either a (width, height) tuple or a single size for a square image. Defaults to 512.

  • quantize (int, optional) – Model-specific quantizing. Defaults to 1.

  • device (Optional[Union[str, torch.device]], optional) – The device name or device on which to run. Defaults to None.

  • omega (Optional[float]) –

  • features (Optional[int]) –

  • hidden_layers (Optional[int]) –

  • start (Optional[PIL.Image.Image]) –

Raises

ValueError – if any parameter is invalid

forward(size=None)[source]

Generate an image of the (optionally) specified size.

Parameters

size ([type], optional) – [description]. Defaults to None.

Returns

An image batch tensor

Return type

Tensor