Closed Georgefwt closed 11 months ago
Hi! Nice catch, I think you are right.
Actually, another potential issue could be that because np.array(img1)
is np.uint8
, it might cause overflow/underflow when adding noise, so I think it might be better to convert it to np.int16
first and cast it back like: img1 = Image.fromarray(np.clip(np.array(img1, dtype=np.int16) + g_noise, 0, 255).astype(np.uint8))
.
What do you think?
Exactly, that's what I'm talking about. Maybe the result in the paper should be updated? I think the score will be better.
Agree! We will update the number in the next arXiv version. Thank you once again!
https://github.com/YuxinWenRick/tree-ring-watermark/blob/1e40351b8260f1464a35258c8e03c8182909074c/optim_utils.py#L73
type of
g_noise
andnp.array(img1)
is alreadynp.uint8
, sonp.clip
won't have any effect.