examples icon indicating copy to clipboard operation
examples copied to clipboard

Fix Pascal Conversion

Open akindofyoga opened this issue 3 years ago • 0 comments

Data exported from CVAT to the Pascal VOC format does not have the truncated, difficult, or pose fields. It also specifies coordinates using float values instead of ints.

This code was casting obj['bndbox']['xmin'] to a float in one location, and then an int in another. The cast to an int would cause an error when obj['bndbox']['xmin'] contained a float value. This change rounds the float value, which makes the cast to an int successful. It does not change the code's behavior when obj['bndbox']['xmin'] has an int value.

This change does not affect behavior when the difficult, truncated, and pose fields are specified. However, it makes the code work correctly for files that do not contain these fields.

akindofyoga avatar Sep 13 '22 16:09 akindofyoga