Skip to content

Fix i,j typos, update readme #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ predictions_smooth = predict_img_with_smooth_windowing(
subdivisions=2, # Minimal amount of overlap for windowing. Must be an even number.
nb_classes=nb_classes,
pred_func=(
lambda img_batch_subdiv: model.predict(image_to_neural_input(img_batch_subdiv))
lambda img_batch_subdiv: model.predict(img_batch_subdiv)
)
)

Expand Down
4 changes: 2 additions & 2 deletions smooth_tiled_predictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _windowed_subdivs(padded_img, window_size, subdivisions, nb_classes, pred_fu

for i in range(0, padx_len-window_size+1, step):
subdivs.append([])
for j in range(0, padx_len-window_size+1, step):
for j in range(0, pady_len-window_size+1, step):
patch = padded_img[i:i+window_size, j:j+window_size, :]
subdivs[-1].append(patch)

Expand Down Expand Up @@ -209,7 +209,7 @@ def _recreate_from_subdivs(subdivs, window_size, subdivisions, padded_out_shape)
a = 0
for i in range(0, padx_len-window_size+1, step):
b = 0
for j in range(0, padx_len-window_size+1, step):
for j in range(0, pady_len-window_size+1, step):
windowed_patch = subdivs[a, b]
y[i:i+window_size, j:j+window_size] = y[i:i+window_size, j:j+window_size] + windowed_patch
b += 1
Expand Down