Library for creating data input pipeline in pure Tensorflow 2.x
Project description
Chitra
Library for creating data input pipeline in pure Tensorflow 2.x
.
Install
pip install chitra
How to use
Loading data for image classification
import tensorflow as tf
import chitra
from chitra.dataloader import Clf, show_batch
path = '/Users/aniketmaurya/Pictures/cats'
clf_dl = Clf()
data = clf_dl.from_folder(path)
print('class names:', clf_dl.CLASS_NAMES)
show_batch(data, 6, (6, 6))
class names: (b'whitecat', b'blackcat')
model = tf.keras.applications.ResNet50(include_top=False,
weights='imagenet',
input_shape=(160, 160, 3),
classes=2)
# for e in data.batch(4): print(e)
img = chitra.image.read_image('/Users/aniketmaurya/Pictures/cats/whitecat/wcat1.jpg')
img.shape
TensorShape([683, 1024, 3])
chitra.image.resize_image(img, (160, 160)).shape
TensorShape([160, 160, 3])
Project details
Release history Release notifications | RSS feed
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.2.tar.gz
(10.2 kB
view hashes)
Built Distribution
chitra-0.0.2-py3-none-any.whl
(9.6 kB
view hashes)