Skip to main content

Image preprocessor for convolutional neural networks

Project description

Image Preprocessor

Simple image preprocessor I made while working on my first Keras binary classification convolutional neural network. Converts images from specified directories into NumPy arrays. Its functionality will be expanded out of necessity.

Installation

Install through pip as shown:

pip install image-preprocessor

Example usage

from image_preprocessor import ImagePreprocessor

# Vehicle-label correlations
vehicle_types = {
    0 : 'boat',
    1 : 'car',
    2 : 'motorcycle',
    3 : 'plane'
}

# Create the ImagePreprocessor object
ip = ImagePreprocessor(
    pixels=64,
    normalization=255,
    training_threshold=0.7,
    resize_method='square resize',
    color_mode='L'
)

# Prepare the images in select directories
package = ip.preprocess_dirs(
    paths=['images/boat', 'images/car', 'images/motorcycle', 'images/plane'],
    labels=[0, 1, 2, 3],
    partition=True
)

# Go on and do your neural network stuff 
train_features = package['TRAIN_IMAGES']
train_labels = package['TRAIN_LABELS']
test_features = package['TEST_IMAGES']
test_labels = package['TEST_LABELS']

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

image-preprocessor-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

image_preprocessor-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file image-preprocessor-0.1.0.tar.gz.

File metadata

  • Download URL: image-preprocessor-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.4.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.8

File hashes

Hashes for image-preprocessor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7bf9be0c454da3e5c7cfab988dbd24f9c72fda7a6965e42249dbed0f27975e87
MD5 20e4f5e63e14cd4961b7b86b09d5cacf
BLAKE2b-256 18d199f0b11699aacd49e19d56eb4bddc819e189edddbed785c03761197f32a2

See more details on using hashes here.

File details

Details for the file image_preprocessor-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: image_preprocessor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.4.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.8

File hashes

Hashes for image_preprocessor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b98bb9e6941d71c3a75d8826a21dc3ce0239d027858fccceb62f9029bc7b4f2
MD5 05b6ab35f8c85f935c5a3af3e314670d
BLAKE2b-256 bbdb1977dcf1d2b0521b486ec0461004edf618d9bb8b95d18a3866f43d518414

See more details on using hashes here.

Supported by

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