Skip to main content

A python package to support essential trasformations on image datasets

Project description

Documentation Status codecov Python version Last commit

ImaGenie

imagenie is a Python package for image augmentation and modification, providing a variety of functions to manipulate images for machine learning, computer vision, or creative purposes. Whether you need to flip, scale, convert to grayscale, or blur images, imagenie is your one-stop solution for fast and efficient image manipulation.

Features

  • Flipping: flip(image, direction=0) Flips the input image either horizontally or vertically. Useful for augmenting datasets by introducing mirror-image variations. 0 = horizontal flip, 1 = vertical flip

  • Scaling: scale(image, N) Resizes the input image by a given scale factor N. This is crucial for normalizing or creating variations in image resolution.

  • Blurring: blur(image, stdev=1.0) Applies a Gaussian blur effect to the image. Helps simulate real-world noise or reduce sharpness for specific use cases.

  • Grayscaling: grayscale(image) Converts the image to grayscale. Ideal for models that only require intensity information, excluding color features.

  • Augmenting with a sequence of operations: augment(images, operations) Applies a sequence of user-defined augmentation operations to a list of images. Useful for image generating images for computer vision tasks.

Installation

To install from pypi:

$ pip install imagenie

To build from the github repo follow the following steps: Clone the repository using the following command :

$ git clone https://github.com/UBC-MDS/ImaGenie.git

then navigate to the repository by running the following command

$ cd ImaGenie

Then run the following command:

$ poetry install

Running Test Suite

In the package directory run the following command to run the test suit for this package:

$ pytest

Usage

A few exampls to get you sarted with imagenie:

  1. Import the functions from the package
from imagenie.flip import flip
from imagenie.scale import scale
from imagenie.blur import blur
from imagenie.grayscale import grayscale
from imagenie.augment import augment
  1. Load the images as Numpy arrays
import matplotlib.pyplot as plt
image = plt.imread(IMAGE_PATH)
image2 = plt.imread(IMAGE_PATH)
  1. Leverage imagenie's image modifictaion functions

    • Flip image horizontaly or vertically
    flipped_image = flip(image, direction = 1)
    
    • Scale image by a desrired scaling factore
    scaled_image = scale(image, N = 0.4)
    
    • Blur image with a defined standard deviation
    blurred_image = blur(image, stdev = 2.0)
    
    • Convert RGB to graycsaled images
    grayed_image = grayscale(image)
    

Python Ecosystem Integration

This package fits well within the Python ecosystem by providing functionality for image manipulation and augmentation. There are several popular libraries for image processing, that offer more complex functionalities, but this package provides a simple, user-friendly interface for common operations tailored for specific image manipulation tasks.

Reference for other image processing libraries:

Contributors

  • Agam Sanghera
  • Gurmehak Kaur
  • Yuhan Fan
  • Yichun Liu

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

imagenie was created by Agam Sanghera, Gurmehak Kaur, Yuhan Fan, Yichun Liu. It is licensed under the terms of the MIT license.

Credits

imagenie was created with cookiecutter and the py-pkgs-cookiecutter template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imagenie-1.2.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imagenie-1.2.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file imagenie-1.2.0.tar.gz.

File metadata

  • Download URL: imagenie-1.2.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for imagenie-1.2.0.tar.gz
Algorithm Hash digest
SHA256 00c2f23e1209a448b72694c40a7c293bce16578769edb277fc9109f79e7432e0
MD5 34078e5ae23502daea5c5cf306aee6ae
BLAKE2b-256 0e0aae3174b6788edd276d16e24ddfb80713da6b5e650a01665061f05dfbfd79

See more details on using hashes here.

File details

Details for the file imagenie-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: imagenie-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for imagenie-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c97007cd00e11ff21a37b672005a2510a54509ba0b614e298ae1c8bf147fa9e
MD5 eb6ca27a0d93e8f2479eb3bcb4fc48a8
BLAKE2b-256 7b9455d1817467aa45616b948a6de4c4ef3d80e1b6c190cbc7c8eab757001ac4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page