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

About cv2.canny #3

Open
Liqq1 opened this issue Feb 12, 2022 · 4 comments
Open

About cv2.canny #3

Liqq1 opened this issue Feb 12, 2022 · 4 comments

Comments

@Liqq1
Copy link

Liqq1 commented Feb 12, 2022

Hello! I have some questions about cv2.canny module.
What is the function of "cv2. Canny"module in the figure? This step is not in the MSRF-Net, and I don't see a place in the Shape Stream Block where I can input it.
I am looking forward hearing from you!
34F52168-B5F9-4226-A924-2865A8061916

@amlarraz
Copy link
Owner

Hi!

cv2.Canny reefers to the canny function in opencv.
It is only neccesary for the "Shape Stream" which is feeded by x13, x23, x33, x44 and also with the original image with Canny applied. The objective of the shape Stream is to reproduce the canny image using the original canny image combined with the multiscale features. I think the shape stream block is an additional regulatization method. You can read more about this here.

In the code you can see Canny in the following lines:

  • Dataset line 85 -87 and 91
  • Model line 374 and 400
  • Loss in class CombinedLoss (line 132)

You can also see that in the train, validation and test code.

@Liqq1
Copy link
Author

Liqq1 commented Feb 16, 2022

Thank you for your reply~
After I looked at the code, I relearned it. I wonder if it can be understood as follows: MSRF-Net does not have a Canny operation in Figure 1, but it does in Figure 2. As a result, the network in Figure 2 will have an additional concat operation in Shape Stream.

image

image

@amlarraz
Copy link
Owner

Mmmmm I think the figure 1 doesn't have Canny operation because this operation isn't part of the model but part of the data to feed the model (and also to compute loss). Yep, maybe I shouldn't have added canny in the model architecture draw...

@Liqq1
Copy link
Author

Liqq1 commented Feb 16, 2022

I mean that I think we can just use x13, X23, X33, x44 to get what we want without concatenating the edges of the original image;Maybe I was wrong about that:-(

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