Utilities to simplify working with TFRecord files and TensorFlow's data pipeline API
Project description
# TFRecordUtils
Making life easier for working with TFRecord files and TensorFlow's data pipeline API.
## Installation
```
pip install tfrecordutils
```
### HOWTO
### Create a TFRecord file from a directory of images
* crops images by default to 500x500, but you can override this
```
jpg_glob = './jpg/*.jpg'
tfrecord_file = 'images.tfrecords'
TFRecordUtils.jpgToTFRecord(jpg_glob)
```
### HOWTO
### Get an image batch iterator from a TFRecord file
```
tfrecord_file = 'images.tfrecords'
with tf.Session() as sess:
iterator = TFRecordUtils.get_image_batch_iterator(sess, tfrecord_file)
batch = sess.run(iterator)
print(batch.shape)
```
Making life easier for working with TFRecord files and TensorFlow's data pipeline API.
## Installation
```
pip install tfrecordutils
```
### HOWTO
### Create a TFRecord file from a directory of images
* crops images by default to 500x500, but you can override this
```
jpg_glob = './jpg/*.jpg'
tfrecord_file = 'images.tfrecords'
TFRecordUtils.jpgToTFRecord(jpg_glob)
```
### HOWTO
### Get an image batch iterator from a TFRecord file
```
tfrecord_file = 'images.tfrecords'
with tf.Session() as sess:
iterator = TFRecordUtils.get_image_batch_iterator(sess, tfrecord_file)
batch = sess.run(iterator)
print(batch.shape)
```
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
tfrecordutils-0.1.4.tar.gz
(2.7 kB
view details)
File details
Details for the file tfrecordutils-0.1.4.tar.gz
.
File metadata
- Download URL: tfrecordutils-0.1.4.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5be4ab35fff97f3027bcb0229e43dad2f00665c9c2a752c66bfa9e5a0387a2a3 |
|
MD5 | f04cd578b833ad012dda7399b6323be3 |
|
BLAKE2b-256 | d44125b5abe2a5b8c933e88b4b076590dad826e4085b8a7915f13092c0b2f745 |