AdvSteg
stegobox.codec.AdvSteg
Bases: BaseCodec
Source code in stegobox/codec/advsteg/advsteg.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
|
__init__(image_size=109, output_size=64, msg_length=100, weights_path='ckpt/advsteg/weights.pt', cuda=False, verbose=True)
Generating Steganographic Images via Adversarial Training (NIPS 2017).
Link to paper: Generating Steganographic Images via Adversarial Training - Abstract.
Trained on the entire CelebA dataset for 500 epochs. Pre-trained weights support
encoding payload of up to 100 bits. To train your own model, use the train.py
script. For more details:
- Check out my reproduction of the original paper in PyTorch: spencerwooo/advsteg-pytorch.
- For reference, the original author's TensorFlow implementation: jhayes14/advsteg.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_size |
int
|
Input image size. Defaults to 109. |
109
|
output_size |
int
|
Output generated image size. Defaults to 64. |
64
|
msg_length |
int
|
Length of encoded payload. Defaults to 100. |
100
|
weights_path |
str
|
Path to weights. Defaults to "ckpt/advsteg/weights.pt". |
'ckpt/advsteg/weights.pt'
|
cuda |
bool
|
Whether to use GPU or not. Defaults to False. |
False
|
verbose |
bool
|
Verbose logging enabled or not. Defaults to True. |
True
|
Source code in stegobox/codec/advsteg/advsteg.py
encode(carrier, payload)
Encode payload into carrier image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
carrier |
Image
|
Carrier image in PIL format. |
required |
payload |
str
|
Payload string, up to |
required |
Returns:
Type | Description |
---|---|
Image
|
Encoded stego image in PIL format. |
Source code in stegobox/codec/advsteg/advsteg.py
decode(carrier)
Decode payload from carrier image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
carrier |
Image
|
Stego image in PIL format. |
required |
Returns:
Type | Description |
---|---|
str
|
Decoded payload string. |