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

里面有示例;

 

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐