[
{
'topleft':{
'x':34,
'y':13
},
'confidence':0.17681329,
'bottomright':{
'x':398,
'y':347
},
'label':'person'
},
{
'topleft':{
'x':29,
'y':48
},
'confidence':0.107129775,
'bottomright':{
'x':399,
'y':351
},
'label':'car'
},
{
'topleft':{
'x':20,
'y':85
},
'confidence':0.22963998,
'bottomright':{
'x':376,
'y':350
},
'label':'cat'
},
{
'topleft':{
'x':0,
'y':2
},
'confidence':0.12423642,
'bottomright':{
'x':372,
'y':356
},
'label':'sheep'
},
{
'topleft':{
'x':20,
'y':12
},
'confidence':0.26517922,
'bottomright':{
'x':378,
'y':349
},
'label':'dog'
}
]
This is an array of object from that was returned from TensorFlow. However, while trying to convert to a JSON object using json.dumps
, I got this error TypeError: 0.17681329 is not JSON serializable
I have tried to use simplejson and got Float32 is not serializable. How can I convert this array of objects to be JSON serializable?