steganogan package

Top-level package for SteganoGAN.

class steganogan.SteganoGAN(data_depth, encoder, decoder, critic, cuda=False, verbose=False, log_dir=None, **kwargs)[source]

Bases: object

decode(image)[source]
encode(cover, output, text)[source]

Encode an image. :param cover: Path to the image to be used as cover. :type cover: str :param output: Path where the generated image will be saved. :type output: str :param text: Message to hide inside the image. :type text: str

fit(train, validate, epochs=5)[source]

Train a new model with the given ImageLoader class.

classmethod load(architecture=None, path=None, cuda=True, verbose=False)[source]

Loads an instance of SteganoGAN for the given architecture (default pretrained models) or loads a pretrained model from a given path.

Parameters
  • architecture (str) – Name of a pretrained model to be loaded from the default models.

  • path (str) – Path to custom pretrained model. *Architecture must be None.

  • cuda (bool) – Force loaded model to use cuda (if available).

  • verbose (bool) – Force loaded model to use or not verbose.

save(path)[source]

Save the fitted model in the given path. Raises an exception if there is no model.

set_device(cuda=True)[source]

Sets the torch device depending on whether cuda is avaiable or not.