There seems to be a bug where an item in the ObjectsList randomly is an int instead of numpy.int32.
This seems to happen with some images but not others.
This seems to be happening in the score_objects function, which I've modified here to output the types.
def score_objects(l):
# Translate the object list from image_detect.py
# TODO: decied if image_detect should actually return this dict instead of
# a list.
# [top, left, bottom, right, mid_v, mid_h, label, scores]
for a in l:
print (a,type(a))
return {'object': l[6], 'score': l[7],
'top': l[0].item(),
'left': l[1].item(),
'bottom': l[2].item(),
'right': l[3].item(),
'mid_v': l[4].item(),
'mid_h': l[5].item(),
}
Funnily enough I'm not always seeing this printed output, but that's possibly due to some docker shit as I'm watching the docker-compose up console output, though docker logs seems to suffer the same issue.
There seems to be a bug where an item in the
ObjectsList
randomly is anint
instead ofnumpy.int32
.This seems to happen with some images but not others.
This seems to be happening in the
score_objects
function, which I've modified here to output the types.Funnily enough I'm not always seeing this printed output, but that's possibly due to some docker shit as I'm watching the
docker-compose up
console output, thoughdocker logs
seems to suffer the same issue.Next line is possibly the culprate:
TODO: Code this in a better way to avoid this shit.