Git Product home page Git Product logo

accelerating-image-processing's Introduction

accelerating-image-processing

Advanced Scientific Python Programming (ASPP 2024) course project

Description

Current researches in computer vision always require a huge number of high-quality images as base datasets. Before training machine learning models, an important step is to preprocess these high-quality and high-resolution images into small patches and add some noises and blur artifacts to improve the data diversity. However, most preprocessing operations are time-consuming on large size images and sometimes we even need 2-3 days to apply them to large datasets on a remote server.

In this project, I'd like to accelerate the image preprocessing on a large dataset by using Python (with the multiprocessing package) and hopefully we can largely reduce the image preprocessing times.

Code Useage

  1. Put all high-quality images to the images directory.
  2. Run degradation with a single process with python generate_LQ_images.py, you can also repeat the degradation process by specifying the number in the argument: python generate_LQ_images.py 100.
  3. Run multi-process degradation with multiple CPUs with python sync_generate_LQ_images.py, you can also repeat the degradation process by specifying the number in the argument: sync_generate_LQ_images.py 100.
  4. The degraded images will be saved in the output directory.

I tried this code on a Mac M1 computer (8 cores), the single process code takes ~68s for 100 degradations, while the multi-process code only takes ~14s, 5 times faster! And if you run the code on a large server, you can use more cpus to speed up large-scale LQ image generations.

accelerating-image-processing's People

Contributors

algolzw avatar

Stargazers

 avatar

Watchers

 avatar

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.