jin-s13 / xtcocoapi

Extended COCO-API
Other
63 stars 24 forks source link

fix int overflow on windows #27

Closed irexyc closed 2 years ago

irexyc commented 2 years ago

np.ones((T, G), dtype=int) will create int32 ndarray on my machine.

while gt[m]['id'] have big integer number like 900100410650 which exceeds the range of int32

# https://github.com/jin-s13/xtcocoapi/blob/master/xtcocotools/cocoeval.py#L428-L429
gtm = np.ones((T, G), dtype=int) * -1
dtm = np.ones((T, D), dtype=int) * -1

# https://github.com/jin-s13/xtcocoapi/blob/master/xtcocotools/cocoeval.py#L456
dtm[tind, dind]  = gt[m]['id']
jin-s13 commented 2 years ago

Looks good to me.