Giter Club home page Giter Club logo

imread_benchmark's Introduction

各種ライブラリの画像読み込み速度比較

各種ライブラリで画像を読み込む速度を比較するコード。

  • cv2.imread
  • PIL.Image.open
  • imageio.imread
  • skimage.io.imread

(後ろ二つはバックエンドがPillowとかだったりするけど一応。)

インターフェースは以下に統一して計測。

  • 入力: pathlib.Path
  • 出力: float32のndarray。shapeは(height, width, RGB)。値は[0, 255]。エラー時はNone。

実行結果例

環境によって結構変わるのであくまでも例。(しかも結構ぶれる。。)

Linuxで普通のPillowな環境

================================ img.gif ================================
imread_opencv  : 16.9
imread_pillow  :  8.4
imread_imageio : 43.0
imread_skimage : 10.6
================================ img.jpg ================================
imread_opencv  : 17.9
imread_pillow  : 31.0
imread_imageio : 31.3
imread_skimage : 31.1
================================ img.png ================================
imread_opencv  : 36.7
imread_pillow  : 22.4
imread_imageio : 22.0
imread_skimage : 23.1

個人的に一番よく使うJPEGでOpenCVがだいぶ速かった。が…

LinuxでPillow-SIMDな環境

================================ img.gif ================================
imread_opencv  : 17.6
imread_pillow  :  8.9
imread_imageio : 43.7
imread_skimage : 10.5
================================ img.jpg ================================
imread_opencv  : 18.4
imread_pillow  : 11.2
imread_imageio : 11.5
imread_skimage : 11.5
================================ img.png ================================
imread_opencv  : 36.3
imread_pillow  : 23.9
imread_imageio : 22.7
imread_skimage : 22.3

Pillow-SIMDにしてみたらもうこれでいいじゃんという感じ。

imread_benchmark's People

Contributors

ak110 avatar

Stargazers

Tomokazu Katayama avatar  avatar KotaYuhara avatar tn1994 avatar こしあん avatar tajima avatar Swall0w avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

wakame1367

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.