Skip to main content

A small python image classification package

Project description

Chokkhu

Chokkhu is a deep learning image dataset EDA and preprocessing toolkit designed to prepare train-ready image data for TensorFlow / Keras–based image classification. It helps users analyze datasets, preprocess images, handle class imbalance, and train deep learning models using a clean and reproducible pipeline. The package follows industry-grade Python packaging standards, supports CI/CD pipelines, and works seamlessly in Google Colab and Jupyter Notebook environments.

INSTALLATION (IMPORTANT – FIRST STEP)

pip install chokkhu <<<

TensorFlow is installed automatically as a runtime dependency.

Chokkhu’s main responsibility is data preparation. It performs image exploratory data analysis (EDA), class-wise distribution visualization, image size, aspect ratio, RGB intensity and blur analysis, standard preprocessing (resize to 224×224 and normalization), stratified train/validation/test splitting, and automatic class balancing using data augmentation. After this step, the dataset is fully ready to be used for training any deep learning model.

Complete usage example showing the full workflow in one place:

from Chokkhu.DeepLearningModel.EDA import ImageEDA
from Chokkhu.DeepLearningModel.PreProcessing import ImagePreProcessor

# Dataset EDA
eda = ImageEDA(dataset_path="your_dataset_path")

# Dataset preprocessing
processor = ImagePreProcessor(datapath="your_dataset_path")
(train_X, train_y), (val_X, val_y), (test_X, test_y) = processor.get_data()




After excecuting this, You can train your model like this.







import tensorflow as tf
# Example 1: Custom CNN (from scratch)
custom_model = tf.keras.Sequential([
    tf.keras.layers.Conv2D(32, 3, activation="relu", input_shape=(224,224,3)),
    tf.keras.layers.MaxPooling2D(),
    tf.keras.layers.Conv2D(64, 3, activation="relu"),
    tf.keras.layers.MaxPooling2D(),
    tf.keras.layers.Flatten(),
    tf.keras.layers.Dense(128, activation="relu"),
    tf.keras.layers.Dense(num_classes, activation="softmax")
])

custom_model.compile(
    optimizer="adam",
    loss="sparse_categorical_crossentropy",
    metrics=["accuracy"]
)

custom_model.fit(
    train_X,
    train_y,
    validation_data=(val_X, val_y),
    epochs=10
)




# Example 2: Transfer Learning with ConvNeXt-Tiny (frozen backbone)
import tensorflow as tf
base_model = tf.keras.applications.ConvNeXtTiny(
    weights="imagenet",
    include_top=False,
    input_shape=(224,224,3)
)

base_model.trainable = False

transfer_model = tf.keras.Sequential([
    base_model,
    tf.keras.layers.GlobalAveragePooling2D(),
    tf.keras.layers.Dense(256, activation="relu"),
    tf.keras.layers.Dense(num_classes, activation="softmax")
])

transfer_model.compile(
    optimizer="adam",
    loss="sparse_categorical_crossentropy",
    metrics=["accuracy"]
)

transfer_model.fit(
    train_X,
    train_y,
    validation_data=(val_X, val_y),
    epochs=5
)




# Example 3: Fine-tuning ConvNeXt-Tiny (unfrozen backbone)
import tensorflow as tf
base_model.trainable = True

transfer_model.compile(
    optimizer=tf.keras.optimizers.Adam(1e-5),
    loss="sparse_categorical_crossentropy",
    metrics=["accuracy"]
)

transfer_model.fit(
    train_X,
    train_y,
    validation_data=(val_X, val_y),
    epochs=5
)

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

chokkhu-0.1.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

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

chokkhu-0.1.1-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file chokkhu-0.1.1.tar.gz.

File metadata

  • Download URL: chokkhu-0.1.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for chokkhu-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9cfe982bc5124bf6ba10aa4cce67ce4ca331e9921ba773e7ce5caa829b3f7e72
MD5 f66c92a7a70595af56fb3eb73618bfbd
BLAKE2b-256 e1dc562486f6b1097ac3817235c65ccaaf192b1c5a5bbafd2690e36190677d24

See more details on using hashes here.

File details

Details for the file chokkhu-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: chokkhu-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for chokkhu-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1883cef37a358e7a34bcfde66fc8b9f68f51c12ef51200899611520777528cbb
MD5 3af74981e3d1fec270df4c0e37a73a10
BLAKE2b-256 268a2aad1d839e1cfdf460d43a882912d155b0f61174425128e73507e72a77ae

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