日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python 速度 memmap_使用python测量文件的读写速度

發布時間:2024/9/15 python 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python 速度 memmap_使用python测量文件的读写速度 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我目前正在使用python來讀寫大型圖像(使用OpenCV和numpy的memmap函數)。具體地說,我正在制作圖像金字塔。在

在python中,可以監視文件的當前讀寫速度嗎?一、 e.類似移動平均值(MB/秒)。在

我不認為這很重要,但我的代碼中最重要的部分是:for y in range(ysize):

#Open a previously defined temp image file

bigIMG = np.memmap('tempfile.bin', dtype='uint8', mode='r+', shape=(ysize,xsize,3))

#Grap a chunk of the full image, save it, shrink it,

#and put it into the next lower level of the pyramid

for x in range(xsize):

chunk = bigIMG[y*block:(y+1)*block,x*block:(x+1)*block]

cv2.imwrite('+str(x)+"_"+str(y)+".png",chunk)

down = cv2.resize(chunk,None,fx=0.5, fy=0.5, interpolation = cv2.INTER_LINEAR)

smallerIMG[(y*block)/2:((y+1)*block)/2,(x*block)/2:((x+1)*block)/2] = down

#Flush changes to HDD

del smallerIMG

如你所見,我正在從硬盤上寫和讀很多數據,我想監控這些操作的性能。在

謝謝!在

總結

以上是生活随笔為你收集整理的python 速度 memmap_使用python测量文件的读写速度的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。