voc2coco
voc2coco copied to clipboard
Convert from 1-based index to 0-based index
In line 80 and line 81, I am not sure whether we should use width = (x_max-1) - (x_min - 1) = x_max - x_min for getting the 0-based index width of coco style. However, you only -1 for x_min, I am not sure whether we should also - 1 for x_mmax? Is it correct? Original:
xmin = int(get_and_check(bndbox, 'xmin', 1).text) - 1
ymin = int(get_and_check(bndbox, 'ymin', 1).text) - 1
xmax = int(get_and_check(bndbox, 'xmax', 1).text)
ymax = int(get_and_check(bndbox, 'ymax', 1).text)
Corrected:
xmin = int(get_and_check(bndbox, 'xmin', 1).text) - 1
ymin = int(get_and_check(bndbox, 'ymin', 1).text) - 1
xmax = int(get_and_check(bndbox, 'xmax', 1).text) - 1
ymax = int(get_and_check(bndbox, 'ymax', 1).text) - 1
为什么xmin与ymin要减1呢?如果都不减也能使长和宽不变呢 @XudongWang12Sigma
我也想问一下为什么xmin和ymin要减1呢?