Git Product home page Git Product logo

image-filters's Introduction

Image Filters package

Package contents

This package provides image filters with different implementations and associated test functions to assert the correctess of them.

The provided filters are:

  • grayscale color2gray
  • sepia color2sepia

Each filter is implemented with:

  • python
  • numpy
  • numba

Filters can be accessed as: {implementation}_{filter}.py

The package offeres also a function to make a timing report of the different implementations of a filter: make_reports in in3110_instapy/timing.py, highlighting the performance of numpy and numba with respect to python.

Installation

To install the package, run the following command: pip install in3110_instapy

Note: if you encounter weird output like Successfully built UNKNOWN, this could be due to out-of-date setuptools and/or a bug in pip’s build isolation. First, make sure to update pip:

python3 -m pip install --upgrade setuptools pip # you may want to add --user

Then, if that still doesn’t work you may need to add --no-build-isolation to your pip install command:

python3 -m pip install --no-build-isolation in3110_instapy

If this succeeded, you should be able to pass the package tests:

python3 -m pytest -v test/test_package.py

Now you can use functions and modules from the package, by importing what you need.

Usage

To use the filters, call the functions indicating your image path and set the desired arguments:

python3 -m in3110_instapy <arguments>

where <arguments> are:

positional arguments:
  file                  The filename to apply filter to

options:
  -h, --help            show this help message and exit
  -o OUT, --out OUT     The output filename
  -g, --gray            Select gray filter
  -se, --sepia          Select sepia filter
  -sc SCALE, --scale SCALE
                        Scale factor to resize image
  -i {python,numba,numpy,cython}, --implementation {python,numba,numpy,cython}
                        The implementation
  -r, --runtime         Track the average runtime spent on the task with the chosen implementation
  -k  KTUNE, --ktune    Tune the sepia filter by changing the k value

image-filters's People

Watchers

Cristina 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.