{ "info": { "author": "Sky Zhang", "author_email": "sky.atomse@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Operating System :: MacOS", "Operating System :: Microsoft", "Operating System :: Microsoft :: Windows :: Windows NT/2000", "Operating System :: POSIX", "Operating System :: POSIX :: BSD", "Operating System :: POSIX :: BSD :: FreeBSD", "Operating System :: POSIX :: BSD :: NetBSD", "Operating System :: POSIX :: BSD :: OpenBSD", "Operating System :: POSIX :: Linux", "Operating System :: POSIX :: SunOS/Solaris", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation" ], "description": "# AIFashion python sdk\n\n[AF Open API](https://developer.aifashion.com)\n\n\n\u672c\u9879\u76ee\u662fAIFashion\u00ae HTTP API\u7684\u4e00\u4e2a\u5c01\u88c5\uff0c\u65e8\u5728\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u7b80\u6d01\u9ad8\u6548\u7684SDK\u3002\n\u8be5SDK\u53ef\u4ee5\u81ea\u52a8\u5b8c\u6210\u8eab\u4efd\u8ba4\u8bc1\u3001\u8bbf\u95ee\u4ee4\u724c\u83b7\u53d6\u3001\u4ee4\u724c\u81ea\u52a8\u66f4\u65b0\uff0c\u5e76\u63d0\u4f9b\u5404\u4e2a\u529f\u80fd\u7684\u63a5\u53e3\u3002\n\n\n\n## ID \u4e0e Secret\n\n\n\u60a8\u9700\u8981\u9996\u5148\u8bbf\u95eeAIFashion\u00ae\u7684[\u63a7\u5236\u9762\u677f](https://console.aifashion.com)\uff0c\u6ce8\u518c\u5e76\u767b\u9646\uff0c\n\u521b\u5efa\u4e00\u4e2a\u5408\u9002\u7684\u5e94\u7528\u5e76\u83b7\u53d6\u5e94\u7528\u7684ID\u548cSecret\n\n\n\n## \u5b89\u88c5\n\n\n\u60a8\u53ef\u4ee5\u901a\u8fc7pip\u6307\u4ee4\u5b8c\u6210\u5b89\u88c5\n\n\n`pip install aifashion_sdk`\n\n\n## \u4f7f\u7528\n\n\u901a\u8fc7python\u8c03\u7528aifashion\u5305\uff0c\u7ed9\u5b9a ID \u548c Scret \u5373\u53ef\u4f7f\u7528\n\n```python\nimport aifashion\n\nclient_id = 'XXXXX'\nclient_secret = 'YYYYY'\naf = aifashion.AIFashionFunctions(client_id=client_id, client_secret=client_secret)\n\n```\n\n\u6216\u8005\u60a8\u53ef\u4ee5\u4fdd\u5b58\u5728yaml\u6587\u4ef6\u4e2d\uff0c\u5e76\u901a\u8fc7`client_filename`\u53c2\u6570\u4f20\u9012\u6587\u4ef6\u540d\n\n```yaml\nclient_id: XXXXX\nclient_secret: YYYYY\n```\n\n\n```python\nimport aifashion\n\nclient_filename = 'ZZZZ.yml'\naf = aifashion.AIFashionFunctions(client_filename=client_filename)\n\n```\n\n\n\u63a5\u4e0b\u6765\u60a8\u53ef\u4ee5\u8c03\u7528\u76f8\u5e94\u7684\u51fd\u6570\u83b7\u53d6\u8bc6\u522b\u7684\u7ed3\u679c\n\n\n\n```python\n# if image_url is given\nimage_url = 'some url here'\naf.a_function(image_url=image_url)\n\n# if image_filename is given\nimage_filename = 'some filename here'\naf.a_function(image_fname=image_filename)\n\n# if image_base64 string is given\nimage_base64 = 'some base64 here'\naf.a_function(image_base64=image_base64)\n```\n\n\u4f8b\u5982\uff1a\n\n```python\n>>> af.fahsion_tagging(image_url='https://images.aifashion.com/01/0f/c7/010fc7622b1b75f7d580137636f25d88.jpg')\n{'image': {'height': 640, 'id': '010fc7622b1b75f7d580137636f25d88', 'url': 'https://images.aifashion.com/01/0f/c7/010fc7622b1b75f7d580137636f25d88.jpg', 'width': 640}, 'object': {'category': '\u7bb1\u5305', 'category_id': 501, 'confidence': 0.9646803140640259, 'region': {'x1': 0.07128814697265624, 'x2': 0.9111869812011719, 'y1': 0.041831283569335936, 'y2': 0.9469302368164062}}, 'request_id': '855be4d7-7896-4428-bcf1-507a89a835c5#359895', 'tags': [{'key': '\u98ce\u683c', 'values': [{'confidence': 0.26829038772796976, 'value': '\u97e9\u7248'}]}, {'key': '\u6b3e\u5f0f', 'values': [{'confidence': 0.7964576377930703, 'value': '\u5355\u80a9\u5305'}]}, {'key': '\u5927\u5c0f', 'values': [{'confidence': 0.5306223626645841, 'value': '\u5c0f'}]}, {'key': '\u56fe\u6848', 'values': [{'confidence': 0.44190941484801455, 'value': '\u7eaf\u8272'}]}, {'key': '\u9002\u7528\u573a\u666f', 'values': [{'confidence': 0.959326524265762, 'value': '\u4f11\u95f2'}]}, {'key': '\u95ed\u5408\u65b9\u5f0f', 'values': [{'confidence': 0.6383202888420646, 'value': '\u62c9\u94fe'}]}, {'key': '\u5f62\u72b6', 'values': [{'confidence': 0.44122126961424496, 'value': '\u6a2a\u6b3e\u65b9\u5f62'}]}, {'key': '\u6027\u522b', 'values': [{'confidence': 1.0, 'value': '\u901a\u7528'}]}, {'key': '\u4e8c\u7ea7\u7c7b\u522b', 'values': [{'confidence': 0.81, 'value': '\u630e\u5305'}]}]}\n\n>>> af.color_analysis(image_fname=\"dress.jpeg\")\n{'colors': [{'name_en': 'AntiqueWhite', 'name_zh': '\u6d45\u6a59\u8272', 'percentage': 0.1646513949747629, 'rgb': '#F6EBDD'}, {'name_en': 'DimGray', 'name_zh': '\u9ed1\u7070\u8272', 'percentage': 0.388586906280622, 'rgb': '#5B575A'}, {'name_en': 'Salmon', 'name_zh': '\u897f\u74dc\u7ea2', 'percentage': 0.16732301662136928, 'rgb': '#E8696D'}, {'name_en': 'DarkSalmon', 'name_zh': '\u897f\u74dc\u7ea2', 'percentage': 0.23548634607206909, 'rgb': '#EF9E97'}, {'name_en': 'SaddleBrown', 'name_zh': '\u6df1\u68d5\u8272', 'percentage': 0.04395233605117681, 'rgb': '#5B231C'}], 'image': {'height': 640, 'id': '010fc7622b1b75f7d580137636f25d88', 'url': 'https://images.aifashion.com/01/0f/c7/010fc7622b1b75f7d580137636f25d88.jpg', 'width': 640}, 'object': {'category': '\u77ed\u88d9', 'category_id': 301, 'confidence': 0.8859304785728455, 'region': {'x1': 0.06238516420125961, 'x2': 0.9350795149803162, 'y1': 0.019997864961624146, 'y2': 0.9653385281562805}}, 'request_id': '855be4d7-7896-4428-bcf1-507a89a835c5#359896'}\n\n>>> af.clothes_detect(image_fname=\"red_dress.jpeg\")\n{'image': {'height': 541, 'id': '2755c68dfc1b44301219bc9f399b3148', 'url': 'https://images.aifashion.com/27/55/c6/2755c68dfc1b44301219bc9f399b3148.jpg', 'width': 500}, 'objects': [{'category': '\u8fde\u8863\u88d9', 'category_id': 302, 'confidence': 0.9999842643737793, 'region': {'x1': 0.15614866256713866, 'x2': 0.8775624847412109, 'y1': 0.22497901348686994, 'y2': 0.9921972458030277}}], 'request_id': '5ec403e2-d5f1-4dc3-aa51-0109c6e43b56#363567'}\n```\n\n\n\n# AIFashion python sdk\n\n[AF Open API](https://developer.aifashion.com)\n\nThis project is a wrap of url API provided by AIFashion company.\nIt can automatically process authorization, and renew token when it is expiring. \nAll functions are provided as a function within a object, which is very convenient.\n\n\n\n## ID & Secret\n\n\nYou need to visit [console](https://console.aifashion.com) to regist an account at first,\nlogin and create application to get the ID & Secret. \n\n\n\n## Installation\n\n\nYou can use pip to install this sdk\n\n`pip install aifashion_sdk`\n\n\n## Usage\n\nUse AIFashion python sdk with\n\n```python\nimport aifashion\n\nclient_id = 'XXXXX'\nclient_secret = 'YYYYY'\naf = aifashion.AIFashionFunctions(client_id=client_id, client_secret=client_secret)\n\n```\n\nor you can store the ID & Secret in a yaml file\n\n\n```python\nimport aifashion\n\nclient_filename = 'ZZZZ.yml'\naf = aifashion.AIFashionFunctions(client_filename=client_filename)\n\n```\n\n\nThen you can call the functions inside af object, a typical calling is like this\n\n\n```python\n# if image_url is given\nimage_url = 'some url here'\naf.a_function(image_url=image_url)\n\n# if image_filename is given\nimage_filename = 'some filename here'\naf.a_function(image_fname=image_filename)\n\n# if image_base64 string is given\nimage_base64 = 'some base64 here'\naf.a_function(image_base64=image_base64)\n```\n\ne.g.\n\n```python\n>>> af.fahsion_tagging(image_url='https://images.aifashion.com/01/0f/c7/010fc7622b1b75f7d580137636f25d88.jpg')\n{'image': {'height': 640, 'id': '010fc7622b1b75f7d580137636f25d88', 'url': 'https://images.aifashion.com/01/0f/c7/010fc7622b1b75f7d580137636f25d88.jpg', 'width': 640}, 'object': {'category': '\u7bb1\u5305', 'category_id': 501, 'confidence': 0.9646803140640259, 'region': {'x1': 0.07128814697265624, 'x2': 0.9111869812011719, 'y1': 0.041831283569335936, 'y2': 0.9469302368164062}}, 'request_id': '855be4d7-7896-4428-bcf1-507a89a835c5#359895', 'tags': [{'key': '\u98ce\u683c', 'values': [{'confidence': 0.26829038772796976, 'value': '\u97e9\u7248'}]}, {'key': '\u6b3e\u5f0f', 'values': [{'confidence': 0.7964576377930703, 'value': '\u5355\u80a9\u5305'}]}, {'key': '\u5927\u5c0f', 'values': [{'confidence': 0.5306223626645841, 'value': '\u5c0f'}]}, {'key': '\u56fe\u6848', 'values': [{'confidence': 0.44190941484801455, 'value': '\u7eaf\u8272'}]}, {'key': '\u9002\u7528\u573a\u666f', 'values': [{'confidence': 0.959326524265762, 'value': '\u4f11\u95f2'}]}, {'key': '\u95ed\u5408\u65b9\u5f0f', 'values': [{'confidence': 0.6383202888420646, 'value': '\u62c9\u94fe'}]}, {'key': '\u5f62\u72b6', 'values': [{'confidence': 0.44122126961424496, 'value': '\u6a2a\u6b3e\u65b9\u5f62'}]}, {'key': '\u6027\u522b', 'values': [{'confidence': 1.0, 'value': '\u901a\u7528'}]}, {'key': '\u4e8c\u7ea7\u7c7b\u522b', 'values': [{'confidence': 0.81, 'value': '\u630e\u5305'}]}]}\n\n>>> af.color_analysis(image_fname=\"dress.jpeg\")\n{'colors': [{'name_en': 'AntiqueWhite', 'name_zh': '\u6d45\u6a59\u8272', 'percentage': 0.1646513949747629, 'rgb': '#F6EBDD'}, {'name_en': 'DimGray', 'name_zh': '\u9ed1\u7070\u8272', 'percentage': 0.388586906280622, 'rgb': '#5B575A'}, {'name_en': 'Salmon', 'name_zh': '\u897f\u74dc\u7ea2', 'percentage': 0.16732301662136928, 'rgb': '#E8696D'}, {'name_en': 'DarkSalmon', 'name_zh': '\u897f\u74dc\u7ea2', 'percentage': 0.23548634607206909, 'rgb': '#EF9E97'}, {'name_en': 'SaddleBrown', 'name_zh': '\u6df1\u68d5\u8272', 'percentage': 0.04395233605117681, 'rgb': '#5B231C'}], 'image': {'height': 640, 'id': '010fc7622b1b75f7d580137636f25d88', 'url': 'https://images.aifashion.com/01/0f/c7/010fc7622b1b75f7d580137636f25d88.jpg', 'width': 640}, 'object': {'category': '\u77ed\u88d9', 'category_id': 301, 'confidence': 0.8859304785728455, 'region': {'x1': 0.06238516420125961, 'x2': 0.9350795149803162, 'y1': 0.019997864961624146, 'y2': 0.9653385281562805}}, 'request_id': '855be4d7-7896-4428-bcf1-507a89a835c5#359896'}\n\n>>> af.clothes_detect(image_fname=\"red_dress.jpeg\")\n{'image': {'height': 541, 'id': '2755c68dfc1b44301219bc9f399b3148', 'url': 'https://images.aifashion.com/27/55/c6/2755c68dfc1b44301219bc9f399b3148.jpg', 'width': 500}, 'objects': [{'category': '\u8fde\u8863\u88d9', 'category_id': 302, 'confidence': 0.9999842643737793, 'region': {'x1': 0.15614866256713866, 'x2': 0.8775624847412109, 'y1': 0.22497901348686994, 'y2': 0.9921972458030277}}], 'request_id': '5ec403e2-d5f1-4dc3-aa51-0109c6e43b56#363567'}\n```\n\n\n\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": "", "keywords": "", "license": "MIT License", "maintainer": "Sky Zhang", "maintainer_email": "sky.atomse@gmail.com", "name": "aifashion-sdk", "package_url": "https://pypi.org/project/aifashion-sdk/", "platform": "Linux", "project_url": "https://pypi.org/project/aifashion-sdk/", "project_urls": null, "release_url": "https://pypi.org/project/aifashion-sdk/1.2.0/", "requires_dist": [ "requests (>=2.22.0)", "PyYAML (>=5.1.1)", "sphinx ; extra == 'docs'", "sphinxcontrib-programoutput ; extra == 'docs'", "sphinx-rtd-theme ; extra == 'docs'", "numpydoc ; extra == 'docs'", "pytest (>=4.0) ; extra == 'tests'", "pytest-cov ; extra == 'tests'" ], "requires_python": ">=3", "summary": "AIFashion\u00ae Python SDK", "version": "1.2.0" }, "last_serial": 5549529, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "5ed690f15e1a8ac670f75784b007cfdc", "sha256": "b6263ccd8c561018d36302437d296de0339a2c374a639b6588ac328b1711d3e2" }, "downloads": -1, "filename": "aifashion_sdk-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5ed690f15e1a8ac670f75784b007cfdc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3", "size": 15400, "upload_time": "2019-07-09T06:47:44", "url": "https://files.pythonhosted.org/packages/0c/08/c0347ecd2cf5f3d6021246349b09756813801eb3884ca444b9976146bd25/aifashion_sdk-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c7b95c415f1fca114914a8d209392d1e", "sha256": "f8b573ee1046751a6bc466fbc9029b58724b302cbc2f808df60497614fd2566a" }, "downloads": -1, "filename": "aifashion_sdk-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c7b95c415f1fca114914a8d209392d1e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 13708, "upload_time": "2019-07-09T06:47:48", "url": "https://files.pythonhosted.org/packages/03/e2/f33425fc31daa002b19112ce60ac99d3000bffa5d7815a518f2b203e5b8f/aifashion_sdk-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "7cc19724313c8b5aa66cfb205bf190ba", "sha256": "c650d2dd21127d80faa093ca041f580ee150ba3984debd5eb0081a6b36e340fc" }, "downloads": -1, "filename": "aifashion_sdk-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7cc19724313c8b5aa66cfb205bf190ba", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3", "size": 16583, "upload_time": "2019-07-11T02:30:33", "url": "https://files.pythonhosted.org/packages/3f/5c/9844cff9ea94bb4a6fcf8db4976c44841c72509fda7420dfc6b8470aa159/aifashion_sdk-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6909922ed69b5209af5578eae40a622b", "sha256": "4f59604d41704ec6e3c0b2ff33f7b7c1cb3ac6670aeadb5ea8cac39a416c7673" }, "downloads": -1, "filename": "aifashion_sdk-1.1.0-py3.6.egg", "has_sig": false, "md5_digest": "6909922ed69b5209af5578eae40a622b", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": ">=3", "size": 27193, "upload_time": "2019-07-11T02:30:35", "url": "https://files.pythonhosted.org/packages/15/4c/eaf531ca4bd46a5c085e27826d3e43bf0fd2bd9b857eacc9ffe00fc563cf/aifashion_sdk-1.1.0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "7e118836aaac6ac1f58efad8f7ce4499", "sha256": "0a4d010144f25cdcd3fde6857f878f855e84c2570bd735f24d6f275454b192b4" }, "downloads": -1, "filename": "aifashion_sdk-1.1.0.tar.gz", "has_sig": false, "md5_digest": "7e118836aaac6ac1f58efad8f7ce4499", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 15064, "upload_time": "2019-07-11T02:30:38", "url": "https://files.pythonhosted.org/packages/c2/85/d97cff867b251d7b27d3866c7eceba43e179aacdc682af56e8b338e47d4a/aifashion_sdk-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "8a716a21bc1b0d4b55138b140c52377a", "sha256": "ab244e51d0a46f9412cc60ff3669532a59d15925828bbe6e522c706a86f046f6" }, "downloads": -1, "filename": "aifashion_sdk-1.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8a716a21bc1b0d4b55138b140c52377a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3", "size": 16386, "upload_time": "2019-07-18T07:39:51", "url": "https://files.pythonhosted.org/packages/fb/20/ea6aeccd5e9df003e8a3bd571be809b68e1e29bf5723ec33ce107b03909b/aifashion_sdk-1.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "16d789adb1b8ca6e5df28be86cf931c8", "sha256": "5244db698f884d06260f74d8834ffbfb867d5a9acdb4493564ee640400405da7" }, "downloads": -1, "filename": "aifashion_sdk-1.2.0.tar.gz", "has_sig": false, "md5_digest": "16d789adb1b8ca6e5df28be86cf931c8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 15092, "upload_time": "2019-07-18T07:39:53", "url": "https://files.pythonhosted.org/packages/4e/b0/7e648b984f98e2bf4dc48a506d5ba2f6259ed781fc61694f7b12543b5fad/aifashion_sdk-1.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8a716a21bc1b0d4b55138b140c52377a", "sha256": "ab244e51d0a46f9412cc60ff3669532a59d15925828bbe6e522c706a86f046f6" }, "downloads": -1, "filename": "aifashion_sdk-1.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8a716a21bc1b0d4b55138b140c52377a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3", "size": 16386, "upload_time": "2019-07-18T07:39:51", "url": "https://files.pythonhosted.org/packages/fb/20/ea6aeccd5e9df003e8a3bd571be809b68e1e29bf5723ec33ce107b03909b/aifashion_sdk-1.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "16d789adb1b8ca6e5df28be86cf931c8", "sha256": "5244db698f884d06260f74d8834ffbfb867d5a9acdb4493564ee640400405da7" }, "downloads": -1, "filename": "aifashion_sdk-1.2.0.tar.gz", "has_sig": false, "md5_digest": "16d789adb1b8ca6e5df28be86cf931c8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 15092, "upload_time": "2019-07-18T07:39:53", "url": "https://files.pythonhosted.org/packages/4e/b0/7e648b984f98e2bf4dc48a506d5ba2f6259ed781fc61694f7b12543b5fad/aifashion_sdk-1.2.0.tar.gz" } ] }