zhou13 / lcnn

LCNN: End-to-End Wireframe Parsing
MIT License
494 stars 94 forks source link

Some confusion about the paper and code #56

Closed Hui-Yao closed 2 years ago

Hui-Yao commented 2 years ago

Hello, thanks for your great work of this paper and this repo. I have read the paper and code(include wireframe.py) for several times, but i still have some questions: (1) what`s the meaning of n_jtyp(n_type) in code? I guess it is the number of type of junction, and i found it always is 1 in the code.

(2) what is the meaning of feat? You said the feat is the hard-encoded feature in the anwser of another issue, but i still cant understand it physical meaning.

(3)what is the meaning of jcs ? _jcs = [xy[i, score[i] > 0.03] for i in range(ntype)] # 留下score大于0.03的点, jcs中点的数量小于或等于K

(4) The head for predicting junction heatmap J and offset map O, it`s output shape is (1, 5, 128, 128), and the first two channels of dim 2 are allocated to jmap, but only the second channel is supervised with the cross entropy loss, so can i drop the first cahnnel and change the output shape of that head from (1, 5, 128, 128) to (1, 4, 128, 128 )?

(5)for the LoI pooling: p = p[:, 0:1, :] * self.lambda + p[:, 1:2, :] (1 - self.lambda) - 0.5 LoI turns a line represented by 2 endpoints to 32 uniform sampling points by using the equation _new_point = p1 + (p2 - p1)ratio_ but whta`s the meaning of -0.5?

Looking forward to your reply. :)

zhou13 commented 2 years ago
  1. It is not used in this project but in https://github.com/zhou13/shapeunity. Reserved for C-Junction and T-Junction.
  2. It is defined at https://github.com/zhou13/lcnn/blob/e07e48b98d9c5b067a63d48445e757c2460ba4b6/lcnn/models/line_vectorizer.py#L231 I don't know how to explain it further.
  3. It is the junctions wholse score > 0.03.
  4. This is similar to 1. Reserved for C-Junction and T-Junction.
  5. Subpixel offset compensation.
Hui-Yao commented 2 years ago

@zhou13 Thanks for you reply. (1)Does the variable feat represent some imformation(such as Inclination degree) forcibly injected into the feature? Or how should i understand the role of feat?

 feat = torch.cat(
 [
   xyu / 128 * M.use_cood,     # uv coordinate of endpoint 1 of the chosen lines, shape of (num_chosen_line, 2)
   xyv / 128 * M.use_cood,     # uv coordinate of endpoint 2 of the chosen lines, shape of (num_chosen_line, 2)
   u2v * M.use_slop,           # Inclination degree(tan)  , shape of (num_chosen_line, 2)
   (u[:, None] > K).float(),   # whether the index of chosen enpoint is greater than K, shape of (num_chosen_line, 1)
   (v[:, None] > K).float(),   # K is defined as K = min(int(N * 2 + 2), max_K) durning training
],  
   dim=1, )    # feat.shape = (num_chosen_line, 8)

(2) Can you explain about the subpixel offset compensation briefly, or just send me a web link abot it? I cant search useful information about that concept on Baidu and Google.

Thanks again!

zhou13 commented 2 years ago
  1. Yes. There is a section in the appendix of the paper describing it.
  2. 0.5 offset is there because of my definition of the coordinate of the image. You need to define whether the center of the pixel is at (0, 0) or (0.5, 0.5).
Hui-Yao commented 2 years ago

@zhou13 Thanks very much, and have a good day !