Skip to content
Merged
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
21 changes: 18 additions & 3 deletions src/neuron_proofreader/merge_proofreading/merge_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ def read_superchunk(self, nodes):
center = (start + shape // 2).astype(int)
superchunk = self.img_reader.read(center, shape)
superchunk = np.minimum(superchunk, self.brightness_clip)
#superchunk = img_util.normalize(superchunk)
return superchunk, start.astype(int)

def is_near_leaf(self, node, threshold=20):
Expand Down Expand Up @@ -502,8 +501,20 @@ def _get_batch(self, nodes, img, offset):
batch = np.empty((len(nodes), 2,) + self.patch_shape)
for i, center in enumerate(patch_centers):
s = img_util.get_slices(center, self.patch_shape)
batch[i, 0, ...] = img[s]
<<<<<<< HEAD
batch[i, 0, ...] = img_util.normalize(img[s])
batch[i, 1, ...] = label_mask[s]
=======
try:
batch[i, 0, ...] = img[s]
batch[i, 1, ...] = label_mask[s]
except:
print("center:", center)
print("img.shape:", img.shape)
print("\noffset:", offset)
print("patch_centers:", patch_centers)
stop
>>>>>>> 6c98e4d1a99e00129c798e43efaf78a9563a4de7
return nodes, torch.tensor(batch, dtype=torch.float)

def _get_multimodal_batch(self, nodes, img, offset):
Expand All @@ -516,7 +527,11 @@ def _get_multimodal_batch(self, nodes, img, offset):
point_clouds = np.empty((len(nodes), 3, 3600), dtype=np.float32)
for i, (node, center) in enumerate(zip(nodes, patch_centers)):
s = img_util.get_slices(center, self.patch_shape)
patches[i, 0, ...] = np.normalize(img[s])
<<<<<<< HEAD
patches[i, 0, ...] = img_util.normalize(img[s])
=======
patches[i, 0, ...] = img[s]
>>>>>>> 6c98e4d1a99e00129c798e43efaf78a9563a4de7
patches[i, 1, ...] = label_mask[s]

subgraph = self.graph.get_rooted_subgraph(
Expand Down
Loading