在用python对文本数据进行处理时,读alfw的人脸检测框,标注的数据是float类型,像
image00188.jpg 33.000000 168.000000 112.000000 112.000000
倘若直接int转换会报错,可以使用 string 里面的atof 先将字符串转为浮点数,再用int 转换,
[int(s.atof(rr)) for rr in line.split(' ')[1:5]]
在用python对文本数据进行处理时,读alfw的人脸检测框,标注的数据是float类型,像
image00188.jpg 33.000000 168.000000 112.000000 112.000000
倘若直接int转换会报错,可以使用 string 里面的atof 先将字符串转为浮点数,再用int 转换,
[int(s.atof(rr)) for rr in line.split(' ')[1:5]]