f = open(datapath,"r")
a = f.readline()
x = a.split()
x = [int(x) for x in x if x]
bbox = np.stack(x).astype(np.float32)
首先,读取4位坐标(x y w h)
再把读取的坐标按空格分开
然后转为list数组
最后转为numpy格式
f = open(datapath,"r")
a = f.readline()
x = a.split()
x = [int(x) for x in x if x]
bbox = np.stack(x).astype(np.float32)
首先,读取4位坐标(x y w h)
再把读取的坐标按空格分开
然后转为list数组
最后转为numpy格式