{ "info": { "author": "John Stowers, Santi Villalba", "author_email": "john@loopbio.com, santi@loopbio.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Scientific/Engineering", "Topic :: Software Development" ], "description": "IMGStore - Houses Your Video And Data\n=====================================\n\nImgstore is a container for video frames and metadata. It allows efficient storage and seeking\nthrough recordings from hours to weeks in duration. It supports compressed and uncompressed formats.\n\nImgstore allows reading (and writing) videos recorded with\nloopbio's [Motif](http://loopbio.com/recording/) recording system.\n\n## Introduction\n\n### The Concept\n\nVideo data is broken into chunks, which can be individual video files `VideoImgStore`, or\na directory full of images `DirectoryImgStore`. The format of the chunks determines if the store is\ncompressed, uncompressed, lossless or lossy.\n\n### Basic API\n\nThere are only a few public API entry points exposed (most operations are\ndone on `ImgStore` objects (see writing and reading examples below).\n\n * `new_for_filename(path)` - Open a store for reading\n * `new_for_format(format, path, **kwargs)`\n * Open a store for writing\n * You also need to pass `imgshape=` and `imgdtype`\n * Note: `imgshape` is the array shape, i.e. `(h,w,d)` and not `(w,h)`\n * `get_supported_formats()` - list supports formats (remember to test after install)\n * `extract_only_frame(path, frame_index)` - extract a single frame at given *index* from file\n\n## Example: Write a store\n\n```python\nimport imgstore\nimport numpy as np\nimport cv2\nimport time\n\nheight = width = 500\nblank_image = np.zeros((height,width,3), np.uint8)\n\nstore = imgstore.new_for_format('npy', # numpy format (uncompressed raw image frames)\n mode='w', basedir='mystore',\n imgshape=blank_image.shape, imgdtype=blank_image.dtype,\n chunksize=1000) # 1000 files per chunk (directory)\n\nfor i in range(40):\n img = blank_image.copy()\n cv2.putText(img,str(i),(0,300), cv2.FONT_HERSHEY_SIMPLEX, 4, 255)\n store.add_image(img, i, time.time())\n\nstore.close()\n```\n\nYou can also add additional (JSON serialable) data at any time, and this will be stored\nwith a reference to the current `frame_number` so that it can be retrieved\nand easily combined later.\n\n```python\nstore.add_extra_data(temperature=42.5, humidity=12.4)\n```\n\n\n## Example: Read a store\n\n```python\nfrom imgstore import new_for_filename\n\nstore = new_for_filename('mystore/metadata.yaml')\n\nprint 'frames in store:', store.frame_count\nprint 'min frame number:', store.frame_min\nprint 'max frame number:', store.frame_max\n\n# read first frame\nimg, (frame_number, frame_timestamp) = store.get_next_image()\nprint 'framenumber:', frame_number, 'timestamp:', frame_timestamp\n\n# read last frame\nimg, (frame_number, frame_timestamp) = store.get_image(store.frame_max)\nprint 'framenumber:', frame_number, 'timestamp:', frame_timestamp\n```\n\n## Extracting frames: frame index vs frame number\n\nStores maintain two separate and distinct concepts, 'frame number', which\nis any integer value associated with a single frame, and 'frame index', which is numbered\nfrom 0 to the number of frames in the store. This difference is visible in the API with\n\n```python\nclass ImgStore\n def get_image(self, frame_number, exact_only=True, frame_index=None):\n pass\n```\n\nwhere 'frame index' OR 'frame number' can be passed.\n\n## Extracting Metadata or Extra data\n\nTo get all the image metadata at once you can call `ImgStore.get_frame_metadata()`\nwhich will return a dictionary containing all `frame_number` and `frame_time`stamps.\n\nTo retrieve a pandas DataFrame of all extra data and associated `frame_number`\nand `frame_time`stamps call `ImgStore.get_extra_data()`\n\n# Command line tools\n\nSome simple tools for creating, converting and viewing imgstores are provided\n\n* `imgstore-view /path/to/store`\n * view an imgstore\n* `imgstore-save --format 'avc1/mp4' --source /path/to/input.mp4 /path/to/store/to/save`\n * `--source` if omitted will be the first webcam\n* `imgstore-test`\n * run extensive tests to check opencv build has mp4 support and trustworthy encoding/decoding\n\n# Install\n\n*IMGStore* depends on reliable OpenCV builds, and built with mp4/h264 support for\nwriting mp4s. Loopbio provides [reliable conda OpenCV builds](http://blog.loopbio.com/conda-packages.html)\nin our conda channel, and we recommend using these.\n\nOnce you have a conda environment with a recent and reliable OpenCV build, you can install IMGStore from pip\n\n`$ pip install imgstore`\n\nAfter installing imgstore from any location, you should check it's tests pass to guarantee that\nyou have a trustworthy OpenCV version\n\n## Installing from source and with all dependencies\n\n * git clone this repository\n * `conda env create -f environment.yml`\n\nIf you are on MacOSX\n * `conda env create -f environment-mac.yml`\n\n## Installing only IMGStore and using system dependencies\n\nWe recommend installing *IMGStore* **dependencies** using the conda package manager, however\nit is possible to create a virtual env which uses your system OpenCV install. \n\n```sh\n# generate virtual env\nvirtualenv ~/.envs/imgstore --system-site-packages\n# activate the virtual env\nsource ~/.envs/imgstore/bin/activate\n# install imgstore\npip install imgstore\n```\n\nNote: If you install in this manner you have to ensure that opencv is correct\nand has the required functionality (such as mp4 write support if required). Remember\nto run the tests `imgstore-test` after installing.\n\n## Post install testing\n\nYou should always run the command `imgstore-test` after installing imgstore. If your\nenvironment is working correctly you should see a lot of text printed, followed by the\ntext `==== 66 passed, ..... ======`\n\n#### Release Checklist\n\n* test with GPL opencv/ffmpeg\n* test with LGPL opencv/ffmpeg\n* test with Python2.7 and Python3\n* `git clean -dfx`\n* `python setup.py sdist bdist_wheel`\n* `twine upload --repository-url https://test.pypi.org/legacy/ dist/*`\n* (test with pip, new env)\n * `pip install --index-url https://test.pypi.org/simple/ imgstore`\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/loopbio/imgstore", "keywords": "", "license": "BSD 3 clause", "maintainer": "", "maintainer_email": "", "name": "imgstore", "package_url": "https://pypi.org/project/imgstore/", "platform": "", "project_url": "https://pypi.org/project/imgstore/", "project_urls": { "Homepage": "https://github.com/loopbio/imgstore" }, "release_url": "https://pypi.org/project/imgstore/0.2.3/", "requires_dist": [ "numpy", "pandas", "pyyaml", "pytz", "tzlocal", "python-dateutil", "bloscpack; extra == 'bloscpack'" ], "requires_python": "", "summary": "IMGStore houses your video frames", "version": "0.2.3" }, "last_serial": 4795217, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "8fac17459bdc512ec224d5f844119c01", "sha256": "266d532dcfda2ba1bcf2fe5212d2c8abc048e3dd49842c55e96c40429c40b0d9" }, "downloads": -1, "filename": "imgstore-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8fac17459bdc512ec224d5f844119c01", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 886512, "upload_time": "2017-05-29T11:20:18", "url": "https://files.pythonhosted.org/packages/07/5c/1eeb2f765eef29dcb4135d08c3f114aea815a5372ca5566628d44b2fc8a1/imgstore-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "19995f298d4f961ed78d4d254b7bf04b", "sha256": "e9299a32e30d33b66244bc115e82fe4bcfea8ab81ead00b925474de255540a00" }, "downloads": -1, "filename": "imgstore-0.1.1.tar.gz", "has_sig": false, "md5_digest": "19995f298d4f961ed78d4d254b7bf04b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 886555, "upload_time": "2017-05-29T11:33:53", "url": "https://files.pythonhosted.org/packages/2b/89/e67d9a7218fa819aaf9cc026e5c288838067578249a59e9f066f4e11f080/imgstore-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "41ab6ae5e909b3c26f531561492c53df", "sha256": "bc8988c7c14f71720056380771199c277dfd8052544681438f0f4cc5f21c7ce6" }, "downloads": -1, "filename": "imgstore-0.1.2.tar.gz", "has_sig": false, "md5_digest": "41ab6ae5e909b3c26f531561492c53df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 886766, "upload_time": "2017-05-29T12:18:04", "url": "https://files.pythonhosted.org/packages/0d/64/9057373cff169afc2c1879ed72ed82aa3433f50cd19b3f000e183aff274c/imgstore-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "fa05e093a16714bc7d299b642fee6654", "sha256": "e3c3d92712133cb8ee3ca599c61cc5ccd1c77a28f8e6adc5b35dcb77795c06d0" }, "downloads": -1, "filename": "imgstore-0.1.3.tar.gz", "has_sig": false, "md5_digest": "fa05e093a16714bc7d299b642fee6654", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 886907, "upload_time": "2017-05-29T12:28:59", "url": "https://files.pythonhosted.org/packages/37/5b/dc19498d9d718c941c907ae24dc7a3129c44812337cb8c9b8343c3f656e8/imgstore-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "b06a362be34160c9f3e4f1cc0ffdf5b5", "sha256": "585048d0f2e2960a06d8c651f2f37c7932ddf5e69e43a2d6dac17c424419edd5" }, "downloads": -1, "filename": "imgstore-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b06a362be34160c9f3e4f1cc0ffdf5b5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 897194, "upload_time": "2018-09-26T09:55:07", "url": "https://files.pythonhosted.org/packages/c5/e1/8055c143a027a445033a48e4dc2865155c8cdadfb3294a02b9a16ec91f67/imgstore-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bb21b821ce6146c08175fd434a1bb226", "sha256": "1c3fccc45ccb6e83472d7c6436bc23c243830d7d7ffad68c63f7c066ba87922c" }, "downloads": -1, "filename": "imgstore-0.2.0.tar.gz", "has_sig": false, "md5_digest": "bb21b821ce6146c08175fd434a1bb226", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 895794, "upload_time": "2018-09-26T09:55:11", "url": "https://files.pythonhosted.org/packages/48/14/85a2e6c54de47df2398eab46e19c8b540c0a0f6af68831af06a7cab38ba7/imgstore-0.2.0.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "9729ea9647a8af54a81dc9252ac841f7", "sha256": "f11b07ecfc8d49963b590bafb65856029a8c2037d14a791e9d9c0fb5a059ef67" }, "downloads": -1, "filename": "imgstore-0.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9729ea9647a8af54a81dc9252ac841f7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 902124, "upload_time": "2019-02-08T11:46:37", "url": "https://files.pythonhosted.org/packages/06/0d/e943d6e8bd93bb558eb6d39de3403a4721e2c41b2c62e6f2aeb93759e1a9/imgstore-0.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c5c10ef92d6918aa423b18c289b4965c", "sha256": "9fb68cd6c346a0d10585b27b1ad367f532c2fa415096306ef04e78f2881f397c" }, "downloads": -1, "filename": "imgstore-0.2.3.tar.gz", "has_sig": false, "md5_digest": "c5c10ef92d6918aa423b18c289b4965c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 899024, "upload_time": "2019-02-08T11:46:40", "url": "https://files.pythonhosted.org/packages/d5/1c/819e4c67fd665faf091565e6b34fd399df68a25e0e28d29d9c0de3bdd1cc/imgstore-0.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9729ea9647a8af54a81dc9252ac841f7", "sha256": "f11b07ecfc8d49963b590bafb65856029a8c2037d14a791e9d9c0fb5a059ef67" }, "downloads": -1, "filename": "imgstore-0.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9729ea9647a8af54a81dc9252ac841f7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 902124, "upload_time": "2019-02-08T11:46:37", "url": "https://files.pythonhosted.org/packages/06/0d/e943d6e8bd93bb558eb6d39de3403a4721e2c41b2c62e6f2aeb93759e1a9/imgstore-0.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c5c10ef92d6918aa423b18c289b4965c", "sha256": "9fb68cd6c346a0d10585b27b1ad367f532c2fa415096306ef04e78f2881f397c" }, "downloads": -1, "filename": "imgstore-0.2.3.tar.gz", "has_sig": false, "md5_digest": "c5c10ef92d6918aa423b18c289b4965c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 899024, "upload_time": "2019-02-08T11:46:40", "url": "https://files.pythonhosted.org/packages/d5/1c/819e4c67fd665faf091565e6b34fd399df68a25e0e28d29d9c0de3bdd1cc/imgstore-0.2.3.tar.gz" } ] }