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

How to Debug with pycharm #16

Open
2873238593 opened this issue May 25, 2021 · 5 comments
Open

How to Debug with pycharm #16

2873238593 opened this issue May 25, 2021 · 5 comments

Comments

@2873238593
Copy link

Hi, very excellent work. Thanks for the code, it's very helpful and instructive!I want to study your code structure, but I don't know how to use pycharm to debug your code.

@mboudiaf
Copy link
Owner

Hey,
Thanks for your interest, and happy the code helps you :D I am not a Pycharm user myself unfortunately, but I know you could use pdb package to go into debug mode. I encourage you to have a look at #15 to setup pdb. Let me know if you need further help.
Best !

@2873238593
Copy link
Author

Thank you for your reply. Secondly, I noticed that you used compute FB, using the features and gt of query set, which means that the FB of each segmentation is known, and the network is used to process new images in the end. For features without gt, the segmentation effect will be greatly reduced. How do you solve this problem?

@mboudiaf
Copy link
Owner

mboudiaf commented Jun 5, 2021

Hi, the FB segmentation is not known in advance in our main method (otherwise there would be no point in developing a method at all). Please have a look at issue #10 , and particularly my answer #10 (comment) which should answer your question (if I understood it correctly). If it's still not clear, do not hesitate to ask me further clarification.

@2873238593
Copy link
Author

Thank you for your reply. I noticed that in the part of RePRI, you used gt_q of query set to get the high-level feature map of the downsampling , and then passed the valid pixels which you said that is not 255 in get_entropies to get d_KL, cond_entropies and marginal, which are all related to valid_pixels , can you tell me why you use gt_q for this part?

@mboudiaf
Copy link
Owner

mboudiaf commented Jun 9, 2021

Please reference precise lines of the code so that I can help you better (copy the permalink of the line you're referring to in your comment). I'm really not sure I understand the question right now. As you said, there is no gt_q involved in computing the loss functions, only for the valid pixels. gt_q is only used for the following purposes:

  1. Computing the valid_pixels in several parts of the code
  2. Computing the Foreground/Background parameter self.FB_param in the case of the oracle method
    self.FB_param = oracle_FB_param
  3. Computing the cross-entropy ce_q for metric visualization purposes only
    ce_q = self.get_ce(proba_q, valid_pixels_q, one_hot_gt_q)

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

No branches or pull requests

2 participants