DAI-Lab / SteganoGAN

SteganoGAN is a tool for creating steganographic images using adversarial training.
MIT License
305 stars 85 forks source link

It returns "ERROR: Failed to find message.", but I have encode message in the image. #65

Open zhoufengfan opened 4 years ago

zhoufengfan commented 4 years ago

Description

Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen.

What I Did

`import os from steganogan import SteganoGAN

class DemoInGithub: def init(self): self.img_path = r"D:\lena_rgb_used_for_testing_steganogan.jpg" self.output_img_path = r"D:\lena_rgb_used_for_testing_steganogan_outputted.jpg" self.steganogan = SteganoGAN.load(architecture='dense')

def add_wartmark(self, msg_to_hide):
    os.system("steganogan encode " + self.img_path + " " + msg_to_hide)

def read_wartmark(self):
    os.system("steganogan decode " + self.img_path)

def add_wartmark_demo_in_github(self):
    self.steganogan.encode(self.img_path, self.output_img_path, 'This is a super secret message!')

def read_wartmark_demo_in_github(self):
    self.steganogan.decode(self.output_img_path)

if name == 'main': demo_in_github = DemoInGithub()

demo_in_github.add_wartmark("111111222222222333333qqqqqqqqwwwwwweeeeee")

# demo_in_github.read_wartmark()
# demo_in_github.add_wartmark_demo_in_github()
demo_in_github.read_wartmark_demo_in_github()

`

Paste (all) the command(s) you ran and the output.
If there was a crash, please include the traceback here.
zhoufengfan commented 4 years ago

It's all the output. You can review it.

rainyear commented 4 years ago

Same for me, I used the command line.

goforself commented 3 years ago

Has anyone solved it?could you help me?

river-huang commented 3 years ago

th problem from utils,the RSCODE can encode messages but often fails to decode them

------------------ 原始邮件 ------------------ 发件人: "DAI-Lab/SteganoGAN" <notifications@github.com>; 发送时间: 2021年1月19日(星期二) 中午11:31 收件人: "DAI-Lab/SteganoGAN"<SteganoGAN@noreply.github.com>; 抄送: "Subscribed"<subscribed@noreply.github.com>; 主题: Re: [DAI-Lab/SteganoGAN] It returns "ERROR: Failed to find message.", but I have encode message in the image. (#65)

Has anyone solved it?could you help me?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

river-huang commented 3 years ago

you can change another api

---Original--- From: "Czdlx"<notifications@github.com> Date: Tue, Jan 19, 2021 11:31 AM To: "DAI-Lab/SteganoGAN"<SteganoGAN@noreply.github.com>; Cc: "Subscribed"<subscribed@noreply.github.com>; Subject: Re: [DAI-Lab/SteganoGAN] It returns "ERROR: Failed to find message.", but I have encode message in the image. (#65)

Has anyone solved it?could you help me?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

goforself commented 3 years ago

excuse me,how did you change the RS code in the end? l fail to run the bytearray_to_test() function

------------------ 原始邮件 ------------------ 发件人: "DAI-Lab/SteganoGAN" <notifications@github.com>; 发送时间: 2021年1月19日(星期二) 晚上10:37 收件人: "DAI-Lab/SteganoGAN"<SteganoGAN@noreply.github.com>; 抄送: "陈自东"<2434416944@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [DAI-Lab/SteganoGAN] It returns "ERROR: Failed to find message.", but I have encode message in the image. (#65)

you can change another api

---Original--- From: "Czdlx"<notifications@github.com&gt; Date: Tue, Jan 19, 2021 11:31 AM To: "DAI-Lab/SteganoGAN"<SteganoGAN@noreply.github.com&gt;; Cc: "Subscribed"<subscribed@noreply.github.com&gt;; Subject: Re: [DAI-Lab/SteganoGAN] It returns "ERROR: Failed to find message.", but I have encode message in the image. (#65)

Has anyone solved it?could you help me?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

khangt1k25 commented 3 years ago

Same for me, Have anyone resolve this?

prot3in commented 3 years ago

hello,i met the same problem.But,when i change the steganogan's version to 0.1.0, all the problems disapeared.

spitzblattr commented 1 year ago

hello, my version is 0.1.3 The image format you encode must be the same as the format of your train dataset For example, if you train your network with .png files, then you must encode a png format file, or it will not find message And for me, if I don't use my trained model but use the pretrained models instead, the decoder will never find message and I don't know why

xbtzpx commented 1 year ago

您好,我遇到了同样的问题。但是,当我将 steganogan 的版本更改为 0.1.0 时,所有问题都消失了。

How do I change the version? Will the decoder work after the change?

xbtzpx commented 1 year ago

您好,我的版本是 0.1.3 编码的图像格式必须与训练数据集的格式相同 例如,如果您使用 .png 文件训练网络,则必须对 png 格式文件进行编码,否则它将找不到消息 对我来说,如果我不使用经过训练的模型,而是使用预训练的模型, 解码器永远不会找到消息,我不知道为什么

您好,我的版本是 0.1.3 编码的图像格式必须与训练数据集的格式相同 例如,如果您使用 .png 文件训练网络,则必须对 png 格式文件进行编码,否则它将找不到消息 对我来说,如果我不使用经过训练的模型,而是使用预训练的模型, 解码器永远不会找到消息,我不知道为什么

Hello, does your decoder work? Do you train encoders and decoders yourself?