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.0.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: image-preprocessor-0.0.1.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.0.1.tar.gz
Algorithm Hash digest
SHA256 0ae337a550a0e700a9a5e69049a6b01d253ef94869419fec0418a5462b4e6c8b
MD5 d64fb38b4c3ecfb83c6eda6845ade8e1
BLAKE2b-256 4521300441bb54095eeb37a55e2597048a8b7244875779ea6d53bbd90271749f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: image_preprocessor-0.0.1-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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 512a406442a538532cd436af36e26bd8ceaa688a511a67d42c9836586eb009c4
MD5 246620f517f2d3264cff76a209d3c4bc
BLAKE2b-256 cea1d45832b74dc6a8400b47539de27cc7947df0c9d902e30ad2b307fda49024

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