cfzd / Ultra-Fast-Lane-Detection

Ultra Fast Structure-aware Deep Lane Detection (ECCV 2020)
MIT License
1.82k stars 493 forks source link

when I make a custom dataset #254

Closed han1222 closed 3 years ago

han1222 commented 3 years ago

Thank you for sharing your great work.

I have a question.

in constant.py

culane_row_anchor = [121, 131, 141, 150, 160, 170, 180, 189, 199, 209, 219, 228, 238, 248, 258, 267, 277, 287]

in culane datasets.

240.573 590 257.848 580 275.127 570 292.409 560 309.699 550 327.126 540 344.433 530 361.753 520 379.085 510 396.56 500 413.925 490 431.309 480 448.714 470 467.012 460 484.586 450 502.935 440 520.431 430 538.821 420 557.229 410 575.653 400 593.868 390 612.315 380 630.77 370 649.232 360 667.698 350 686.165 340 704.416 330 722.879 320 741.337 310 759.788 300 778.228 290

1146.04 590 1133.33 580 1120.99 570 1108.67 560 1097.02 550 1084.72 540 1073.22 530 1060.98 520 1049.07 510 1037.67 500 1025.92 490 1014.6 480 1003.34 470 992.112 460 980.928 450 969.781 440 958.669 430 947.589 420 936.959 410 925.929 400 914.917 390 904.651 380 893.66 370 882.768 360 871.781 350 861.521 340 850.519 330 839.503 320 828.468 310 818.147 300 807.161 290

1660.47 470 1616.64 460 1573.83 450 1532 440 1490.15 430 1447.33 420 1404.49 410 1361.64 400 1318.78 390 1275.9 380 1232.02 370 1187.15 360 1142.25 350 1096.34 340 1050.83 330 1002.88 320 953.887 310 901.854 300 847.714 290

I think y-axis value has some rules. for example 590 580 570 .... , 290 470 460 450 ..... 290 . I mean culane datasets are configured to decrease the y-axis value by 10.

  1. I am trying to make custom datasets. I wonder I should make a lane point with anchor range or It doesn't matter to make a lane datasets.

culane_row_anchor = [121, 131, 141, 150, 160, 170, 180, 189, 199, 209, 219, 228, 238, 248, 258, 267, 277, 287] isn't same dataset y-value.

  1. Do I have to make the y-axis value decrease by 10 when I create the dataset?

Thank you in advance.

cfzd commented 3 years ago

@han1222

  1. The CULane dataset is indeed configured to decrease the y-axis value by 10
  2. You can configure your dataset's anchor range arbitrarily
  3. The setting of row_anchor mainly affects two things:
    • The performance/complexity trade-off. The more anchors you have, the more complex the model is. But more anchors could potentially improve the performance and vice versa.
    • Model's ROI: Say you have a dataset that has annotations ranging from 100 to 900, while the row anchor is set from 100 to 500, then the part from 500 to 900 will be simply ignored by the model.
han1222 commented 3 years ago

Thank you for your answer

  1. Does y-axis values is must have same decrease value? I mean when I make a custom dataset, should I point y-value regularly? example by all 5 decrease.

  2. if y-axis value decrease by 10 in dataset , then is anchor height 10?

  3. model resize image with 288 800 I wonder but culane dataset and other dataset image size aren't 288800. Does it not affect any result? how about making a custom datasets after resizing image to 288800 size ? what is different making a custom datasets with original image size without resizing (288800)

  4. when lane is only one (special case). my custom dataset usually has one lane (ex) inner boundary) but culane dataset has coupled lane. If I make a single lane dataset and train with the dataset. Does it work ? how do you think about it?

  5. how to change row_anchor in constant.py? Is there any formula to convert row anchor value? I mean that original resolution isn't 288*800 but when we run demo row anchor value is within 288 but result video is original size.

Thank you for your help.

cfzd commented 3 years ago

@han1222

  1. The y-axis values don't need to be evenly spaced. Since our method uses the segmentation format of lanes during training, you can annotate your datasets arbitrarily as long as the segmentation map of lanes is continuous.
  2. In fact, the anchor is a "scan line", it has no height property.
  3. The image size would not affect our model, you can set it to any size you want. The only thing you need to do is to make the input dimension of FC layers match your size.
  4. Of course it could work.
  5. The meaning of row anchor is the row indices at the 288x800 size. The corresponding row indices at the original resolution are simply multiplied by the resize factor. For example, row anchors like [20,40] in a height of 288 are equal to [40,80] in a height of 576 (288x2).
han1222 commented 3 years ago

for last question 5.

124

In this issue, you said that linear scale doesn't work and "the previous method is not exactly correct. I will make a refactor of the row anchor system to support different resolutions."

I am still confused about row_anchor scope about resolution.

I wonder which one is right , Does linear scale still work?

cfzd commented 3 years ago

@han1222 Yes, it works. Moreover, you might need to disable these lines of code for different resolution training: https://github.com/cfzd/Ultra-Fast-Lane-Detection/blob/f58fcd5f58511159ebfd06e60c7e221558075703/data/dataset.py#L115-L117

han1222 commented 3 years ago
  1. even though I used 1032772 resolution image as input and I resized 288800 (I do not modified it , code will resize as I know.), shoud I commet out 3 lines and replaced it with smape_tmp=row_anchor ??

  2. actually I already tested with this method. but there is no visualization point at all. but loss is look like 0.0xxx

  3. when I don't comment out these three lines, 3,4 points come out but it's position is varying depends on anchor_row.

  4. configs/culane.py

    TRAIN

    epoch = 50 batch_size = 16 #32 optimizer = 'SGD' #['SGD','Adam'] learning_rate = 0.1 weight_decay = 1e-4 momentum = 0.9

scheduler = 'multi' #['multi', 'cos'] steps = [25,38] gamma = 0.1 warmup = 'linear' warmup_iters = 695

NETWORK

use_aux = True griding_num = 200 backbone = '18'

this setting isn't same your paper. Do you recommend this configure to train my own custom dataset and also culane dataset ?

  1. I am tryting to detect wall instead of line detecting. with your algorithms so I make a dataset for wall detector as one single line detector

Does it unfit to your algorithms ?

sorry for many questions. and really appreciate it for your quick answer.

  1. if I train with A set row_anchor should I use A set row_anchor ?

  2. I used 1032772 input but resize 288800 so Is my row_achor [161, 168, 176, 183, 191, 198, 205, 213, 220, 228, 235, 243, 250, 258, 265, 273, 280, 287] with below code ?

[code ] for i in range(1,19): lineId = int(288-(i-1)20/772288) print(lineId)

  1. loss don't decrease under 0.1 , What should be the loss value to be considered normal learning? https://www.dropbox.com/s/jnnfny78r2gx5gx/Screenshot%20from%202021-09-09%2019-38-56.png?dl=0
cfzd commented 3 years ago

@han1222

  1. If your size is 288x800, then no modification is needed.
  2. As long as the objects can be described as lines (no matter they are lanes, railways, electric wires, or walls in your case), our method could detect them.
  3. According to your log, it seems the network learns well (accs and ious are high). But I recommend you conduct visualization on the training set.
    • If the visualization on the training set is bad (good metrics but bad visualization), then it could be because :
      • the data is not correctly provided for training
      • the visualization code is not correct
    • If the visualization on the training set is good, but the visualization on the val/test set is bad. Then it could be some reason like generalization problems (I noticed the training set is relatively small, only several hundred images).
han1222 commented 3 years ago

Thank you so much !