tensorflow-records


Nametensorflow-records JSON
Version 0.1.13 PyPI version JSON
download
home_pageNone
SummarySimple standard + tools for I/O of TFRecords
upload_time2024-08-16 13:38:58
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TFRecords

> Simple standard + tools for I/O of TFRecords

```
pip install tensorflow-records
```

## I/O

```python
import tensorflow as tf
import tf.records as tfr

image = tf.ones([1024, 768, 3], dtype=tf.uint8)
label = tf.constant('cat')

spec = tfr.spec(
  image=tfr.Tensor([1024, 768, 3], dtype='int'),
  label='string'
)

serialized = tfr.serialize(spec, image=x, label=y)
# b'\n+\n\x10\n\x05label\x12\x07\n\x05\n\x03cat\n\x17\n\x05image\x1...'

tfr.parse(spec).sample(tf.constant(serialized))
# { 'image': <tf.Tensor: shape=(1024, 768, 3) ...>, 'label': <tf.Tensor: shape=() ...> }


# or you can parse multiple at once
tfr.parse(spec).batch(tf.constant([serialized, serialized]))
# { 'image': <tf.Tensor: shape=(2, 1024, 768, 3) ...>, 'label': <tf.Tensor: shape=(2,) ...> }
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "tensorflow-records",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Marcel Claramunt <marcel@moveread.com>",
    "download_url": "https://files.pythonhosted.org/packages/a2/c2/a367bcff983b7ecc6a0ef349aca0b57337f77e55ead2fdf3724d8a579652/tensorflow_records-0.1.13.tar.gz",
    "platform": null,
    "description": "# TFRecords\n\n> Simple standard + tools for I/O of TFRecords\n\n```\npip install tensorflow-records\n```\n\n## I/O\n\n```python\nimport tensorflow as tf\nimport tf.records as tfr\n\nimage = tf.ones([1024, 768, 3], dtype=tf.uint8)\nlabel = tf.constant('cat')\n\nspec = tfr.spec(\n  image=tfr.Tensor([1024, 768, 3], dtype='int'),\n  label='string'\n)\n\nserialized = tfr.serialize(spec, image=x, label=y)\n# b'\\n+\\n\\x10\\n\\x05label\\x12\\x07\\n\\x05\\n\\x03cat\\n\\x17\\n\\x05image\\x1...'\n\ntfr.parse(spec).sample(tf.constant(serialized))\n# { 'image': <tf.Tensor: shape=(1024, 768, 3) ...>, 'label': <tf.Tensor: shape=() ...> }\n\n\n# or you can parse multiple at once\ntfr.parse(spec).batch(tf.constant([serialized, serialized]))\n# { 'image': <tf.Tensor: shape=(2, 1024, 768, 3) ...>, 'label': <tf.Tensor: shape=(2,) ...> }\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Simple standard + tools for I/O of TFRecords",
    "version": "0.1.13",
    "project_urls": {
        "repo": "https://github.com/moveread/tensorflow-ocr.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7e5732b87fd576855322487af31381384f1dd0d2982f2a974f78b46a1389d6c2",
                "md5": "cd97d93fdd467fe46b835cc5be53886e",
                "sha256": "a8a84524eea54167131b18efb12343bb346774756ad25c58386bc16f4c88dce2"
            },
            "downloads": -1,
            "filename": "tensorflow_records-0.1.13-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cd97d93fdd467fe46b835cc5be53886e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 6305,
            "upload_time": "2024-08-16T13:38:56",
            "upload_time_iso_8601": "2024-08-16T13:38:56.461843Z",
            "url": "https://files.pythonhosted.org/packages/7e/57/32b87fd576855322487af31381384f1dd0d2982f2a974f78b46a1389d6c2/tensorflow_records-0.1.13-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a2c2a367bcff983b7ecc6a0ef349aca0b57337f77e55ead2fdf3724d8a579652",
                "md5": "bc0b0786908273c27624547240efa9db",
                "sha256": "69c895182fa672bd2bf96fef1b5e55ae77363d2e15e6585e863b6e47b2691aec"
            },
            "downloads": -1,
            "filename": "tensorflow_records-0.1.13.tar.gz",
            "has_sig": false,
            "md5_digest": "bc0b0786908273c27624547240efa9db",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 5025,
            "upload_time": "2024-08-16T13:38:58",
            "upload_time_iso_8601": "2024-08-16T13:38:58.483846Z",
            "url": "https://files.pythonhosted.org/packages/a2/c2/a367bcff983b7ecc6a0ef349aca0b57337f77e55ead2fdf3724d8a579652/tensorflow_records-0.1.13.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-16 13:38:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "moveread",
    "github_project": "tensorflow-ocr",
    "github_not_found": true,
    "lcname": "tensorflow-records"
}
        
Elapsed time: 0.80810s