Skip to content
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

Closed
wants to merge 11 commits into from
Closed

Unet integration #44

wants to merge 11 commits into from

Conversation

KorenMary
Copy link
Collaborator

No description provided.

@christinab12 christinab12 self-requested a review December 5, 2023 14:28
@KorenMary KorenMary closed this Dec 5, 2023
@KorenMary KorenMary deleted the unet-integration branch December 5, 2023 14:37
Copy link
Collaborator

@christinab12 christinab12 left a 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 :)

Copy link
Collaborator

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

Copy link
Collaborator

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?

Copy link
Collaborator

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
Copy link
Collaborator

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to tests dir

src/server/test/test_integration.py Show resolved Hide resolved
src/server/dcp_server/models.py Show resolved Hide resolved
loss.backward()
optimizer.step()

self.loss /= len(train_dataloader)
Copy link
Collaborator

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)

Copy link
Collaborator

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
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants