{ "info": { "author": "Clemens Wolff", "author_email": "clewolff@microsoft.com", "bugtrack_url": null, "classifiers": [], "description": ".. image:: https://travis-ci.org/CatalystCode/py_custom_vision_client.svg?branch=master\n :target: https://travis-ci.org/CatalystCode/py_custom_vision_client\n\n.. image:: https://img.shields.io/pypi/v/custom_vision_client.svg\n :target: https://pypi.python.org/pypi/custom_vision_client/\n\npy_custom_vision_client\n=======================\n\nThis repository contains a simple Python client for the `Custom Vision Service `_.\n\nUsage\n`````\n\n.. sourcecode :: py\n\n # first, train a model\n\n from custom_vision_client import TrainingClient, TrainingConfig\n\n azure_region = \"southcentralus\"\n training_key = \"my-training-key\" # from settings pane on customvision.ai\n\n training_client = TrainingClient(TrainingConfig(azure_region, training_key))\n project_id = training_client.create_project(\"my-project-name\").Id\n\n training_client.create_tag(project_id, \"Cat\")\n training_client.create_tag(project_id, \"Dog\")\n\n training_client.add_training_images(project_id, [\"kitten.jpg\"], \"Cat\")\n training_client.add_training_images(project_id, [\"akita.png\", \"spitz.png\"], \"Dog\")\n training_client.add_training_images(project_id, [\"best-animal-pals.jpg\"], \"Cat\", \"Dog\")\n\n model_id = training_client.trigger_training(project_id).Id\n\n # then, use the model to predict:\n\n from custom_vision_client import PredictionClient, PredictionConfig\n\n azure_region = \"southcentralus\"\n prediction_key = \"my-prediction-key\" # from settings pane on customvision.ai\n\n prediction_client = PredictionClient(PredictionConfig(azure_region, project_id, prediction_key))\n\n predictions = prediction_client.classify_image(\"cat.jpg\", model_id) # could also be a url to a file\n best_prediction = max(predictions, key=lambda _: _.Probability)\n print(best_prediction.Tag)\n\nCommand-line interface\n``````````````````````\n\nYou can also interact with the Custom Vision Service via a command-line interface:\n\n.. sourcecode :: sh\n\n # first, train a model\n python3 -m custom_vision_client.training \\\n --key=\"my-training-key\" \\\n --projectname=\"my-project-name\" \\\n --imagesroot=\"/path/to/images\"\n\n # then, use the model to predict:\n python3 -m custom_vision_client.prediction \\\n --key=\"my-prediction-key\" \\\n --projectid=\"my-project-id-from-training\" \\\n --modelid=\"my-model-id-from-training\" \\\n --image=\"path-or-url-to-image\"\n\nThe command-line interface assumes that your training images are organized in folders\nsuch that every folder contains all the training images for that label:\n\n.. sourcecode :: sh\n\n /path/to/images\n \u251c\u2500\u2500 label_one\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 image_1.jpg\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 image_2.png\n \u2502\u00a0\u00a0 \u2514\u2500\u2500 image_3.png\n \u2514\u2500\u2500 label_two\n \u251c\u2500\u2500 image_4.jpg\n \u2514\u2500\u2500 image_5.jpg\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/CatalystCode/py_custom_vision_client", "keywords": "", "license": "License :: OSI Approved :: MIT License", "maintainer": "", "maintainer_email": "", "name": "custom_vision_client", "package_url": "https://pypi.org/project/custom_vision_client/", "platform": "", "project_url": "https://pypi.org/project/custom_vision_client/", "project_urls": { "Homepage": "https://github.com/CatalystCode/py_custom_vision_client" }, "release_url": "https://pypi.org/project/custom_vision_client/0.0.8/", "requires_dist": null, "requires_python": "", "summary": "A client for the Microsoft Azure Custom Vision Service", "version": "0.0.8" }, "last_serial": 3335479, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "417edc1ba253cdcdafbd032865fd2dd3", "sha256": "8c296b1e95ea4fdcc4491ad7916ff63b172bfbf18559c1991f629afc553fa0b2" }, "downloads": -1, "filename": "custom_vision_client-0.0.1.tar.gz", "has_sig": false, "md5_digest": "417edc1ba253cdcdafbd032865fd2dd3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3990, "upload_time": "2017-06-01T12:29:20", "url": "https://files.pythonhosted.org/packages/66/ff/f0ad60b406110e725983aa5180a324a4bff17da02c45ae701ac8cf9521dc/custom_vision_client-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "6f01fff05506716e2537dccfa9ebe3cb", "sha256": "e367aa9fe9156262e591707b41fb5f4042bd1895b91b1b1ecce8f51de6b32a9a" }, "downloads": -1, "filename": "custom_vision_client-0.0.2.tar.gz", "has_sig": false, "md5_digest": "6f01fff05506716e2537dccfa9ebe3cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4013, "upload_time": "2017-06-01T12:34:55", "url": "https://files.pythonhosted.org/packages/4e/f0/8030a4edb32a02fc1b962ec8735711731c2f62d45ae704d9241160a9bcd6/custom_vision_client-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "f32651d7b6f8aa346553a3d387af7f75", "sha256": "5066650bee116079b14e115689227a9fcae6fc6230da12e866b2490be61cd4dd" }, "downloads": -1, "filename": "custom_vision_client-0.0.3.tar.gz", "has_sig": false, "md5_digest": "f32651d7b6f8aa346553a3d387af7f75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4178, "upload_time": "2017-10-12T17:34:12", "url": "https://files.pythonhosted.org/packages/ec/f2/45e81facbb93ff3079ee3e2e71ad962ff3d498f1a7c7d5fa684bb3f61b8f/custom_vision_client-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "1ccc8eab9cf361467d96538a9583e3f6", "sha256": "13cfc8e10500d38adfafb25e7d4a4383016a840a1fb78e1cb23e22b268c4706a" }, "downloads": -1, "filename": "custom_vision_client-0.0.4.tar.gz", "has_sig": false, "md5_digest": "1ccc8eab9cf361467d96538a9583e3f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4170, "upload_time": "2017-10-12T17:38:58", "url": "https://files.pythonhosted.org/packages/0f/e2/5ec890c20b97706eb4f3ce30a22ae3f5a9a270e0eed87978d7e9d76e25dd/custom_vision_client-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "b0a6b858a746c53349e70b2cb8f30db9", "sha256": "c6de1c5323b078ad0e123d266f8c152790b3d167d517510b9732ece574468c35" }, "downloads": -1, "filename": "custom_vision_client-0.0.5.tar.gz", "has_sig": false, "md5_digest": "b0a6b858a746c53349e70b2cb8f30db9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4383, "upload_time": "2017-10-16T12:54:19", "url": "https://files.pythonhosted.org/packages/b1/f7/d31f2ba3ad8a006123dfdee539f129749fde8299fafb4d4a98459207dcb2/custom_vision_client-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "3c27d585db7228134289f9592666df8e", "sha256": "18102c4335f0aa951b84ddfc141d269414250ab63ae899d97751a68eb8151a68" }, "downloads": -1, "filename": "custom_vision_client-0.0.6.tar.gz", "has_sig": false, "md5_digest": "3c27d585db7228134289f9592666df8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4747, "upload_time": "2017-10-16T14:17:43", "url": "https://files.pythonhosted.org/packages/74/99/3ad5b247d07a3359def7f324ebab83a2ae540fa2107280c1322eaa3fea0c/custom_vision_client-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "152fb1e592c8dcbe8c433c73beacb044", "sha256": "16c822c315b5748c6e0197d7028f119798840a861094ca96e121767781a4d2cf" }, "downloads": -1, "filename": "custom_vision_client-0.0.7.tar.gz", "has_sig": false, "md5_digest": "152fb1e592c8dcbe8c433c73beacb044", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4754, "upload_time": "2017-10-23T16:48:48", "url": "https://files.pythonhosted.org/packages/d5/c7/33a9464b105ee963cbde09bfb0bea67ea1ca4d54315103e695b3db657b4f/custom_vision_client-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "d73433975cb2acb2dc7ece001ba9525f", "sha256": "f6d1f0405b63621a10853da1a1b4b93f54a300837178c7ddf68fc95ca2635483" }, "downloads": -1, "filename": "custom_vision_client-0.0.8.tar.gz", "has_sig": false, "md5_digest": "d73433975cb2acb2dc7ece001ba9525f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5649, "upload_time": "2017-11-15T15:13:46", "url": "https://files.pythonhosted.org/packages/4d/22/b8ec33004828550f44e7ba8fab243aba518972fdc7cf6e2dfff476274feb/custom_vision_client-0.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d73433975cb2acb2dc7ece001ba9525f", "sha256": "f6d1f0405b63621a10853da1a1b4b93f54a300837178c7ddf68fc95ca2635483" }, "downloads": -1, "filename": "custom_vision_client-0.0.8.tar.gz", "has_sig": false, "md5_digest": "d73433975cb2acb2dc7ece001ba9525f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5649, "upload_time": "2017-11-15T15:13:46", "url": "https://files.pythonhosted.org/packages/4d/22/b8ec33004828550f44e7ba8fab243aba518972fdc7cf6e2dfff476274feb/custom_vision_client-0.0.8.tar.gz" } ] }