Skip to main content

Image utility library for Deep Learning

Project description

Chitra

logo

Image utility library for Deep Learning

What is CHITRA

Chitra (चित्र) is an image utility library for Deep Learning tasks. (It is not image-processing library.)

Chitra reduces image data loading boilerplates for classification and object-detection.

It can also generate bounding-boxes from the annotated dataset.

If you have more use cases please raise an issue with the feature you want.

Installation

Using pip (recommended)

pip install -U chitra

Manually

git clone https://github.com/aniketmaurya/chitra.git

cd chitra

pip install -e .

How to use

Loading data for image classification

import numpy as np
import tensorflow as tf
import chitra
from chitra.dataloader import Clf, show_batch
import matplotlib.pyplot as plt
path = '/Users/aniket/Pictures/data/train'

clf_dl = Clf()
data = clf_dl.from_folder(path, target_shape=(224, 224))

clf_dl.show_batch(8, figsize=(8,8))
CLASSES ENCODED: {'cat': 0, 'dog': 1}

png

for e in data.take(1):
    image = e[0].numpy().astype('uint8')
    label = e[1].numpy()
plt.imshow(image)
<matplotlib.image.AxesImage at 0x7fee1000df10>

png

Visualization

Image annotation

Thanks to fizyr keras-retinanet

from chitra.visualization import draw_annotations
labels = np.array([label])
bbox = np.array([[30, 50, 170, 190]])
label_to_name = lambda x: 'Cat' if x==0 else 'Dog'
draw_annotations(image, ({'bboxes': bbox, 'labels':labels,}), label_to_name=label_to_name)
plt.imshow(image)
<matplotlib.image.AxesImage at 0x7fee0fe37890>

png

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

chitra-0.0.12.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

chitra-0.0.12-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file chitra-0.0.12.tar.gz.

File metadata

  • Download URL: chitra-0.0.12.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7

File hashes

Hashes for chitra-0.0.12.tar.gz
Algorithm Hash digest
SHA256 58accbc12752545cdd40ae70c2112a6bd0ba2dc933957c3d365210302418ac58
MD5 1517d0f6d38fc90863276a422a7a766e
BLAKE2b-256 bc47abbf00a3f2240fff3b6b3b818610545af118b0573aeec9a3b191c5359e6a

See more details on using hashes here.

Provenance

File details

Details for the file chitra-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: chitra-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7

File hashes

Hashes for chitra-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 02a2532399e2ef0a4740c49704240bc5786214f704dfd52005e1b523de685cc5
MD5 10b8e083c9cc72110a131d4b688fb245
BLAKE2b-256 606049de9aa7e7a2edaef211d724f23864bf9a5273d6f51ff114ff21fa0d9b43

See more details on using hashes here.

Provenance

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