C++:如何使用C++读取npy文件
1..npy文件是numpy专用的二进制文件;一般只能用python才能打开;2.如果想用C++打开:(1)可以先用python打开,然后保存成txt:detection_file = './detections/MOT16_POI_test/MOT16-06.npy'detections = Noneif detection_file is not None:de...
·
1..npy文件是numpy专用的二进制文件;
一般只能用python才能打开;
2.如果想用C++打开:
(1)可以先用python打开,然后保存成txt:
detection_file = './detections/MOT16_POI_test/MOT16-06.npy'
detections = None
if detection_file is not None:
detections = np.load(detection_file) # .npy文件
np.savetxt('detections.txt', detections, fmt='%0.18f')
print(detections)
(2)github上有一个开源程序,可以实现C++打开npy文件;
地址:https://github.com/rogersce/cnp
里面有示例;
更多推荐


所有评论(0)