-
Notifications
You must be signed in to change notification settings - Fork 5
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
Unet integration #44
Unet integration #44
Conversation
…ion with only one mask
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @KorenMary, please take a look at my comments, some small changes are needed but all in all it is looking good thanks :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove this? you can add your configs to your gitignore so we you don't accidentaly commit changes to these files when playing around withe the configurations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these changes part of the work for the front-end extension to work with multiple masks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename unet to end-2-end
@@ -45,8 +48,10 @@ def eval(self, img): | |||
:return: mask of the image, list of 2D arrays, or single 3D array (if do_3D=True) labelled image. | |||
:rtype: np.ndarray | |||
""" | |||
return super().eval(x=img, **self.eval_config["segmentor"])[0] # 0 to take only mask |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are changes to CustomCellposeModel
necessary for Unet integration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to tests dir
loss.backward() | ||
optimizer.step() | ||
|
||
self.loss /= len(train_dataloader) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are not adding something to self.loss, only computing loss in the loop
img = img.unsqueeze(1) if img.ndim == 3 else img | ||
# convert to tensor | ||
# img = torch.permute(torch.tensor(img.astype(np.float32)), (2, 0, 1)).unsqueeze(0) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add model.eval or torch.no_grad?
|
||
y_hat = np.stack((y_instances, y_labels)) | ||
|
||
return y_hat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you rename these variables (y_hat, y_instances etc.) to the variable names we used in CellPosePatchCNN, so we are consistent in our naming?
No description provided.