Skip to content

Commit 5c9c7f5

Browse files
committed
Merge branch 'cleanup-comments'
* Branch commit log: src/embed.py: remove comment, convolutional codes add key randomization src/extract.py: remove outdated todo / debug comments tests/gen-tests-mk: remove comment about lengthy rescaling tests/Makefile: remove old todo comments Signed-off-by: Tim Janik <timj@gnu.org>
2 parents 46b5362 + 4ff5cdf commit 5c9c7f5

File tree

4 files changed

+2
-14
lines changed

4 files changed

+2
-14
lines changed

src/embed.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ def command_add (input_img, output_img, message_hex, strength, args):
122122
Ldim = m_enc.shape[0]
123123
assert Ldim * Ldim == Lm
124124
dprint ("m (needs encoding):", "size=%d" % Lm, m_enc.shape, m_enc.min(), '...', m_enc.max());
125-
# TODO: Key-Randomize message bit positions in watermark
126125

127126
# generate random matrix `r` (bp_r)
128127
Lr, bp_r = common.make_wm_pattern (config.DEFAULT_KEY)

src/extract.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def estimate_watermark (face_J, orig_J, strength, window):
4848
J_delta = face_J - J_mean # J´ = J - µ
4949
else:
5050
J_delta = face_J - orig_J
51-
# TODO: ensure J_delta always != 0
5251
dprint ("J_delta:", J_delta.shape, J_delta.min(), '...', J_delta.max())
5352
if config.will_plot ('MSCN'): # MSCN = Mean Substracted Contrast Normalization
5453
show (J=face_J, J_mean=J_mean, J_var=J_var, J_delta=J_delta)
@@ -115,7 +114,7 @@ def find_peaks (S2_uni, S2j, window):
115114
S2M_mean = common.local_mean (S2M_uni, window) # µ_S´ = local mean of S´
116115
dprint ("S2M_mean:", S2M_mean.shape, S2M_mean.min(), '...', S2M_mean.max())
117116
S2M_std = np.std (S2M_uni) # standard deviation of S´ - "σ²_S´"
118-
dprint ("S2M_std:", S2M_std.shape, S2M_std.min(), '...', S2M_std.max()) # TODO: useless
117+
dprint ("S2M_std:", S2M_std.shape, S2M_std.min(), '...', S2M_std.max())
119118
S2M_var = S2M_std ** 2 # global variance of S´ - "σ²_S´"
120119
# S2M_var = common.local_variance (S2M_uni, S2M_uni.shape) # global variance of S´ - "σ²_S´"
121120
# dprint ("S2M_var:", S2M_var.shape, S2M_var.min(), '...', S2M_var.max())
@@ -507,7 +506,7 @@ def watermark_from_grid (grid, uz, LR, Ldim, Lwu, face_J, orig_J, wmasked_up, W_
507506
# skip decoding step if minimum ws_score is not reached
508507
wmi = None
509508
if ws_score >= min_ws_score:
510-
wmi = pixels_to_watermark (ws_Y, ws_score, conv_decoder, args) # TODO: when this becomes too expensive, run once per grid list
509+
wmi = pixels_to_watermark (ws_Y, ws_score, conv_decoder, args)
511510
# add statistics
512511
wmi['regularity'] = grid.features['regularity']
513512
wmi['coverage'] = coverage
@@ -836,7 +835,6 @@ def watermark_from_grid_lists (grid_lists, face_J, orig_J, W_est, wmasked, S2_xp
836835
wmi_time = args.startup_time
837836

838837
# Detect lists of grids with decreasing regularity
839-
# TODO: for testing we use either peaks2grid or cornersync, but for the final version we should use both
840838
for grid_list in grid_lists:
841839
# peaks2grid can send us empty grid lists?
842840
if len (grid_list) < 1:
@@ -876,6 +874,3 @@ def watermark_from_grid_lists (grid_lists, face_J, orig_J, W_est, wmasked, S2_xp
876874

877875
done = best_jsd > jsd_window_threshold or done_expecting
878876
return wmi_list, done
879-
# TODO: Xsum = Bsum ^ m_enc
880-
# TODO: dprint ("Xsum:", Xsum.shape, Xsum.min(), '...', Xsum.max())
881-
# TODO: show (title = "Summarized Top 8", Ysum=Ysum, Bsum=Bsum, m=m_enc, xor=Xsum)

tests/Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,3 @@ clean-reports:
182182
rm -f *.tmp *.svg $(RESULT_REPORTS) report.md
183183
clean: clean-attack clean-extract clean-reports
184184
rm -rf ../tests/wmarked/ ../tests/inputs/
185-
186-
# TODO: json: prefix imagewmark get results with image file name
187-
# TODO: json: add filename field
188-
# TODO: json: add single 'watermark' and 'confidence' field
189-
# TODO: add timings, PSNR

tests/gen-tests-mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ def main():
176176
dstname = os.path.join (inputsdir, imgname)
177177
rw, rh = resolutions2d[imgidx]
178178
target_sizes.append ((imgname, f"{rw}x{rh}"))
179-
# TODO: rescale if image is beyond 2k, for now always link
180179
if symlink (src_image_path, dstname):
181180
eprint (" SYMLINK", dstname, "->", src_image_path, f"(target size: {rw}x{rh})")
182181
else:

0 commit comments

Comments
 (0)