{ "info": { "author": "Rehan Durrani", "author_email": "rdurrani@berkeley.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3 :: Only" ], "description": "# ModelZoo\nPython package to query [ModelZoo.Live](https://modelzoo.live)\n\n## API\nFor more specific API details, please check out the docs within the files.\n\n## Examples\n### Initialization\n```python\n# Connects to a ModelZoo instance running at http://modelzoo.url/\nconn = ModelZooConnection(address=\"http://modelzoo.url/\")\n# Authenticate to service. Neccessary to see your token.\nconn.authenticate(\"myemail@me.com\", \"mypassword\")\n```\n### Get Models\n```python\n# Assuming conn initialized previously\nconn.list_all_models()\n```\n### Get Token\n```python\n# Assuming conn initialized previously, and authenticated to server\nconn.get_token()\n```\n### Create User\n```python\n# Assuming conn initialized previously\nconn.create_user(\"mynewemail@me.com\", \"mynewpassword\")\n```\n### Text Inference\n```python\n# Assuming conn initialized previously\nmodel_name = \"MyModelName\"\ninput = [\"Input1\", \"Input2\"]\n\np = conn.text_inference(model_name, input)\n# type(p) = modelzoo.protos.Payload\n```\nIf your model's output is text, you could expect an output formatted like so:\n```python\np = Payload({type: PayloadType.TEXT, text = t})\nt = Text({metadata: {...}, texts: [\"output1\", ...], model_name: \"name\", access_token: \"token\"})\n```\n### Image Inference\n```python\n# Assuming img is your image input.\n# img can be oneof(filename, PIL.Image, image data uri)\nmodel_name = \"MyModelName\"\n\np = conn.image_inference(model_name, img)\n# type(p) = modelzoo.protos.Payload\n```\nIf your model's output is an image, you could expect an output formatted like so:\n```python\np = Payload({type: PayloadType.IMAGE, image = t})\nt = Image({metadata: {...}, image_data_url: \"img_output_uri\", model_name: \"name\", \n access_token: \"token\"})\n```\n#### It is important to note that your model is not constrained to return an output of the same type as its input. \nIt is perfectly valid, for example, for a model to take a text input, and return an image output, or vice versa.\n### Extracting Output for Inference\n```python\n...\n# p is the Payload object returned by\n# oneof(text_inference, image_inference)\nif p.type == PayloadType.TEXT:\n out = sugar.text_input(p.text)\nelif p.type == PayloadType.IMAGE:\n out = sugar.image_input(p.image)\n# out = oneof(List[string], PIL.Image)\n```\n### Post Processing for Inference\n```python\n...\n# p is the Payload object returned by\n# oneof(text_inference, image_inference)\ndef callback(input):\n # Input is oneof(pd.DataFrame, List[string], PIL.Image)\n return output\n\no = conn.process_inference_response(p, callback)\n\n# o == callback(extract(payload))\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/harbor-ml/modelzoo", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "modelzoo", "package_url": "https://pypi.org/project/modelzoo/", "platform": "", "project_url": "https://pypi.org/project/modelzoo/", "project_urls": { "Homepage": "https://github.com/harbor-ml/modelzoo" }, "release_url": "https://pypi.org/project/modelzoo/0.3.3/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Python package for querying ModelZoo.Live", "version": "0.3.3" }, "last_serial": 5987903, "releases": { "0.3.0": [ { "comment_text": "", "digests": { "md5": "42ed18dca7357c0d33e84e81406860f0", "sha256": "35930de23dae6e44a4c6934dfe4851849d46ec1d0f96a39e537bf4b210a8f706" }, "downloads": -1, "filename": "modelzoo-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "42ed18dca7357c0d33e84e81406860f0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 18231, "upload_time": "2019-10-16T00:49:25", "url": "https://files.pythonhosted.org/packages/4b/e6/3cfb56543a09bf319e3e27fd5c96a9f6996b4c4152adf3e2758b842ed289/modelzoo-0.3.0-py3-none-any.whl" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "697ea8ae318a13e4ee8128357f0fbe0d", "sha256": "28ac4faaaf0057212b7389927012fbb8dcce31bfb345b8d481ee90eb53b72a1b" }, "downloads": -1, "filename": "modelzoo-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "697ea8ae318a13e4ee8128357f0fbe0d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 18481, "upload_time": "2019-10-16T01:13:45", "url": "https://files.pythonhosted.org/packages/c2/22/9f76ac7f3912d20fe97a842b3d7d60b280e8bb401bac6264cf3a4ab9862b/modelzoo-0.3.1-py3-none-any.whl" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "3264a022f02b349d5cf33bcc8bdc810e", "sha256": "1d638a3214483673964650bf3d2f2dddd9ed560b8c591148986e4de785fb9289" }, "downloads": -1, "filename": "modelzoo-0.3.2-py3-none-any.whl", "has_sig": false, "md5_digest": "3264a022f02b349d5cf33bcc8bdc810e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 18482, "upload_time": "2019-10-16T01:16:10", "url": "https://files.pythonhosted.org/packages/9e/c6/6fa2d2788e39de1a983c654d420c0459836cd519bcabda32466997250427/modelzoo-0.3.2-py3-none-any.whl" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "8906fe19e7305a3bc455f225102e9250", "sha256": "4199094411618530e001d0ce6782e3d1fd51c86908df0faa01be36463f295c64" }, "downloads": -1, "filename": "modelzoo-0.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "8906fe19e7305a3bc455f225102e9250", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 21429, "upload_time": "2019-10-17T06:33:14", "url": "https://files.pythonhosted.org/packages/28/54/0a8f90e7079aff8ea3349be7ca5ba449a434f8404079941375d2c56392db/modelzoo-0.3.3-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8906fe19e7305a3bc455f225102e9250", "sha256": "4199094411618530e001d0ce6782e3d1fd51c86908df0faa01be36463f295c64" }, "downloads": -1, "filename": "modelzoo-0.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "8906fe19e7305a3bc455f225102e9250", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 21429, "upload_time": "2019-10-17T06:33:14", "url": "https://files.pythonhosted.org/packages/28/54/0a8f90e7079aff8ea3349be7ca5ba449a434f8404079941375d2c56392db/modelzoo-0.3.3-py3-none-any.whl" } ] }