Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RRobert92 committed Jul 8, 2024
1 parent 2ed9314 commit 9c5c750
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tardis_em/cnn/utils/build_cnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def __init__(
self.sigmoid = sigmoid

self.patch_sizes = [img_patch_size]
self.update_patch_size(img_patch_size)
self.update_patch_size(img_patch_size, self.sigmoid)
self.build_cnn_model()

def update_patch_size(self, img_patch_size, sigmoid):
Expand Down
5 changes: 5 additions & 0 deletions tardis_em/utils/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,11 @@ def postprocess_CNN(self, id_name: str):
)
else:
if not self.output_format.startswith("return"):
self.log_prediction.append(f"Semantic Prediction: {i[:-self.in_format]}"
f" | Number of pixels: {np.sum(self.image)}")
with open(join("Predictions", "prediction_log.txt"), "w") as f:
f.write(" \n".join(self.log_prediction))

tif.imwrite(
join(self.am_output, f"{id_name[:-self.in_format]}_CNN.tif"),
self.image,
Expand Down

0 comments on commit 9c5c750

Please sign in to comment.