Ze-Yang / Lane-Detection-with-ERFNet

Paddle Implementation for 2020 China Hualu Cup Data Lake Algorithm Competition co-hosted with Baidu AI (1st Place for Lane Detection Track) 2020中国华录杯·数据湖算法大赛(百度AI协办)—车道线识别赛道
Apache License 2.0
63 stars 15 forks source link

Wrong Shape #1

Open GuoQuanhao opened 3 years ago

GuoQuanhao commented 3 years ago

can not get the right shape, I set 512x512

parser.add_argument('--img_height', default=512, type=int, help='height of input images')
parser.add_argument('--img_width', default=512, type=int, help='width of input images')

I found my input size has been changed image

image

Ze-Yang commented 3 years ago

By default, we first cut out the upper 1/3 part of the input image. Then we randomly resize the width of the image to 1x~1.2x of img_width with the aspect ratio unchanged. After that, the image will be cropped to the target size of (img_height, img_width).

Note that the target size should be divisible by 8 since there are 3 downsampling modules in the encoder. We recommend you to check with the image size as well as the size of the label map along with the transformation step by step to figure out what the problem is.

Hope that it helps, thanks.

ascetic-monk commented 3 years ago

The prepross procedure can be concluded as follows:

  1. cut the sky( the above 1/3 of the image)
  2. resize the image to the (araw_height, araw_width), where a can be calcluated by a=r*target_width/raw_width, and r is a random figure in the range 1~1.2
  3. crop the image to the (target_height, target_width) and normalize.

in our dataset, our target image size is 1024*384(after the sky-cutting). as what you have been described, the image would be resize to 1~1.2x``512*192, and then crop to 512*512, but 192<512 and no padding used in our code, so the error occur.

we recommand that you keep the ratio of the height and weight of the raw image(after skt-cutting) or verify the code about transforms, for example, resize the raw image larger.