{ "info": { "author": "Oleg Poyaganov", "author_email": "oleg@prisma-ai.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Programming Language :: Python :: 2.7", "Topic :: Scientific/Engineering", "Topic :: Software Development" ], "description": "Convert Torch7 models into Apple CoreML format.\n===============================================\n\nThis tool helps convert Torch7 models into `Apple\nCoreML `__ format\nwhich can then be run on Apple devices.\n\n.. figure:: https://github.com/prisma-ai/torch2coreml/raw/master/screenshot.jpg\n :alt: fast-neural-style example app\n\n fast-neural-style example app screenshot\n\nInstallation\n------------\n\n.. code:: bash\n\n pip install -U torch2coreml\n\nIn order to use this tool you need to have these installed: \\* Xcode 9\n\\* python 2.7\n\nIf you want to run tests, you need MacOS High Sierra 10.13 installed.\n\nDependencies\n------------\n\n- coremltools (0.6.2+)\n- PyTorch\n\nHow to use\n----------\n\nUsing this library you can implement converter for your own model types.\nAn example of such a converter is located at\n\"example/fast-neural-style/convert-fast-neural-style.py\". To implement\nconverters you should use single function \"convert\" from torch2coreml:\n\n.. code:: python\n\n from torch2coreml import convert\n\nThis function is simple enough to be self-describing:\n\n.. code:: python\n\n def convert(model,\n input_shapes,\n input_names=['input'],\n output_names=['output'],\n mode=None,\n image_input_names=[],\n preprocessing_args={},\n image_output_names=[],\n deprocessing_args={},\n class_labels=None,\n predicted_feature_name='classLabel',\n unknown_layer_converter_fn=None)\n\nParameters\n~~~~~~~~~~\n\n| **model**: Torch7 model (loaded with PyTorch) \\| str\n| A trained Torch7 model loaded in python using PyTorch or path to file\n with model (\\*.t7).\n\n**input\\_shapes**: list of tuples Shapes of the input tensors.\n\n| **mode**: str ('classifier', 'regressor' or None)\n| Mode of the converted coreml model:\n| 'classifier', a NeuralNetworkClassifier spec will be constructed.\n| 'regressor', a NeuralNetworkRegressor spec will be constructed.\n\n| **preprocessing\\_args**: dict\n| 'is\\_bgr', 'red\\_bias', 'green\\_bias', 'blue\\_bias', 'gray\\_bias',\n 'image\\_scale' keys with the same meaning as\n https://apple.github.io/coremltools/generated/coremltools.models.neural\\_network.html#coremltools.models.neural\\_network.NeuralNetworkBuilder.set\\_pre\\_processing\\_parameters\n\n| **deprocessing\\_args**: dict\n| Same as 'preprocessing\\_args' but for deprocessing.\n\n| **class\\_labels**: A string or list of strings.\n| As a string it represents the name of the file which contains the\n classification labels (one per line). As a list of strings it\n represents a list of categories that map the index of the output of a\n neural network to labels in a classifier.\n\n| **predicted\\_feature\\_name**: str\n| Name of the output feature for the class labels exposed in the Core ML\n model (applies to classifiers only). Defaults to 'classLabel'\n\n| **unknown\\_layer\\_converter\\_fn**: function with signature:\n| (builder, name, layer, input\\_names, output\\_names)\n| builder: object - instance of NeuralNetworkBuilder class\n| name: str - generated layer name\n| layer: object - PyTorch (python) object for corresponding layer\n| input\\_names: list of strings\n| output\\_names: list of strings\n| Returns: list of strings for layer output names\n| Callback function to handle unknown for torch2coreml layers\n\nReturns\n~~~~~~~\n\nmodel: A coreml model.\n\nCurrently supported\n-------------------\n\nModels\n~~~~~~\n\nOnly Torch7 \"nn\" module is supported now.\n\nLayers\n~~~~~~\n\nList of Torch7 layers that can be converted into their CoreML\nequivalent:\n\n1. Sequential\n2. ConcatTable\n3. SpatialConvolution\n4. ELU\n5. ReLU\n6. SpatialBatchNormalization\n7. Identity\n8. CAddTable\n9. SpatialFullConvolution\n10. SpatialSoftMax\n11. SpatialMaxPooling\n12. SpatialAveragePooling\n13. View\n14. Linear\n15. Tanh\n16. MulConstant\n17. SpatialZeroPadding\n18. SpatialReflectionPadding\n19. Narrow\n20. SpatialUpSamplingNearest\n21. SplitTable\n\nLicense\n-------\n\nCopyright (c) 2017 Prisma Labs, Inc. All rights reserved.\n\nUse of this source code is governed by the `MIT\nLicense `__ that can be found in\nthe LICENSE.txt file.\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/prisma-ai/torch2coreml/", "keywords": "coreml machinelearning ml coremltools torch converter neural", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "torch2coreml", "package_url": "https://pypi.org/project/torch2coreml/", "platform": "", "project_url": "https://pypi.org/project/torch2coreml/", "project_urls": { "Homepage": "https://github.com/prisma-ai/torch2coreml/" }, "release_url": "https://pypi.org/project/torch2coreml/0.2.0/", "requires_dist": [ "coremltools (>=0.6.2)", "torch" ], "requires_python": "==2.7.*", "summary": "Convert Torch7 models into Apple CoreML format.", "version": "0.2.0" }, "last_serial": 3151195, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "fa733634760faa4ecc35e3adbabd0e8b", "sha256": "7858a7dcee06fdd077e9bf7a2fc673213988785815b69576c669263ecb6d8090" }, "downloads": -1, "filename": "torch2coreml-0.0.2-py2.7-none-any.whl", "has_sig": false, "md5_digest": "fa733634760faa4ecc35e3adbabd0e8b", "packagetype": "bdist_wheel", "python_version": "py2.7", "requires_python": "==2.7.*", "size": 11380, "upload_time": "2017-08-29T18:47:36", "url": "https://files.pythonhosted.org/packages/60/f9/71fbc1dd608707edf1d66e67d34a7ec39ba22d73db0957a9c5cd2ee4f7a2/torch2coreml-0.0.2-py2.7-none-any.whl" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "c11034f5ef6d5b326194ddc3ab7959f2", "sha256": "565adff52865d6bf5424403e7caff96fb00ac53d69d556142e541a68defe33ec" }, "downloads": -1, "filename": "torch2coreml-0.0.3-py2.7-none-any.whl", "has_sig": false, "md5_digest": "c11034f5ef6d5b326194ddc3ab7959f2", "packagetype": "bdist_wheel", "python_version": "py2.7", "requires_python": "==2.7.*", "size": 11605, "upload_time": "2017-08-30T19:14:42", "url": "https://files.pythonhosted.org/packages/f7/f9/0e62b97b2eb0a09c1675dd6d5bfba5069bd6a6841c71cbb8775291db52bf/torch2coreml-0.0.3-py2.7-none-any.whl" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "12beb250223c9369f22bd09c6a0c8262", "sha256": "27b3c6e262856d5d0f884e06fa21966c42a4fd78b6ee618ebc742c144666e098" }, "downloads": -1, "filename": "torch2coreml-0.0.4-py2.7-none-any.whl", "has_sig": false, "md5_digest": "12beb250223c9369f22bd09c6a0c8262", "packagetype": "bdist_wheel", "python_version": "py2.7", "requires_python": "==2.7.*", "size": 11682, "upload_time": "2017-08-30T20:38:39", "url": "https://files.pythonhosted.org/packages/dc/32/c1f55e5c7119eeff9608b313ab77e26aa4b5acff98d5ae9c2b34085c3100/torch2coreml-0.0.4-py2.7-none-any.whl" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "e4282f17fa1d9d4438404a8f5f259662", "sha256": "b4b3d80c5b545226d9e18804f5cdada0dec166dd4a7b1c7cbedfe15064e1b8df" }, "downloads": -1, "filename": "torch2coreml-0.0.5-py2.7-none-any.whl", "has_sig": false, "md5_digest": "e4282f17fa1d9d4438404a8f5f259662", "packagetype": "bdist_wheel", "python_version": "py2.7", "requires_python": "==2.7.*", "size": 10874, "upload_time": "2017-08-31T16:38:51", "url": "https://files.pythonhosted.org/packages/92/bb/4d8981acbeac0b49df503568a470262ac5c7ef29811e9ee7166c68b18a0e/torch2coreml-0.0.5-py2.7-none-any.whl" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "e59885d22ae4b6941514e3d6ca553ced", "sha256": "c5443fffd0a657a64c69e021bf7c76ab2f2e8a4bf6f4b715456ecd4cf8d9755a" }, "downloads": -1, "filename": "torch2coreml-0.0.6-py2.7-none-any.whl", "has_sig": false, "md5_digest": "e59885d22ae4b6941514e3d6ca553ced", "packagetype": "bdist_wheel", "python_version": "py2.7", "requires_python": "==2.7.*", "size": 10873, "upload_time": "2017-08-31T17:43:32", "url": "https://files.pythonhosted.org/packages/68/97/69ffeee86a115bae3917d503401d937c5fa454f40552e55947234ccd311d/torch2coreml-0.0.6-py2.7-none-any.whl" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "e0fe7472343cc6017f5d31f5d23264c3", "sha256": "1da45ab0ef30bf0a2bcc4a567b3decee66159453a776fecf4266829579ba9d8b" }, "downloads": -1, "filename": "torch2coreml-0.1.0-py2.7-none-any.whl", "has_sig": false, "md5_digest": "e0fe7472343cc6017f5d31f5d23264c3", "packagetype": "bdist_wheel", "python_version": "py2.7", "requires_python": "==2.7.*", "size": 11495, "upload_time": "2017-09-01T19:35:27", "url": "https://files.pythonhosted.org/packages/09/81/a75047e73d0753f0b3b13bbdcf99355800c67afd539399b9ae103fb252f9/torch2coreml-0.1.0-py2.7-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "a3acf80c8b5bfe874a6c12d0ba259df3", "sha256": "86f748be0b889f0952cfa1e850f20c74bdcc034bb7c5c477bc5f40d9d8f790e5" }, "downloads": -1, "filename": "torch2coreml-0.2.0-py2.7-none-any.whl", "has_sig": false, "md5_digest": "a3acf80c8b5bfe874a6c12d0ba259df3", "packagetype": "bdist_wheel", "python_version": "py2.7", "requires_python": "==2.7.*", "size": 12162, "upload_time": "2017-09-05T18:33:16", "url": "https://files.pythonhosted.org/packages/4b/f1/4d16dd03c483ce63e05f15b1b3bc6024abd6d6fe6636b53c060397cdf197/torch2coreml-0.2.0-py2.7-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a3acf80c8b5bfe874a6c12d0ba259df3", "sha256": "86f748be0b889f0952cfa1e850f20c74bdcc034bb7c5c477bc5f40d9d8f790e5" }, "downloads": -1, "filename": "torch2coreml-0.2.0-py2.7-none-any.whl", "has_sig": false, "md5_digest": "a3acf80c8b5bfe874a6c12d0ba259df3", "packagetype": "bdist_wheel", "python_version": "py2.7", "requires_python": "==2.7.*", "size": 12162, "upload_time": "2017-09-05T18:33:16", "url": "https://files.pythonhosted.org/packages/4b/f1/4d16dd03c483ce63e05f15b1b3bc6024abd6d6fe6636b53c060397cdf197/torch2coreml-0.2.0-py2.7-none-any.whl" } ] }