{ "info": { "author": "Pavel Yakubovskiy", "author_email": "qubvel@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "\n[![PyPI version](https://badge.fury.io/py/image-classifiers.svg)](https://badge.fury.io/py/image-classifiers) [![Build Status](https://travis-ci.com/qubvel/classification_models.svg?branch=master)](https://travis-ci.com/qubvel/classification_models) \n# Classification models Zoo - Keras (and TensorFlow Keras)\nTrained on [ImageNet](http://www.image-net.org/) classification models. \nThe library is designed to work both with [Keras](https://keras.io/) and [TensorFlow Keras](https://www.tensorflow.org/guide/keras). See example below.\n\n## Important!\nThere was a huge library update **05 of August**. Now classification-models works with both frameworks: `keras` and `tensorflow.keras`.\nIf you have models, trained before that date, to load them, please, use `image-classifiers` (PyPI package name) of 0.2.2 version. You can roll back using `pip install -U image-classifiers==0.2.2`.\n\n### Architectures: \n- [VGG](https://arxiv.org/abs/1409.1556) [16, 19]\n- [ResNet](https://arxiv.org/abs/1512.03385) [18, 34, 50, 101, 152]\n- [ResNeXt](https://arxiv.org/abs/1611.05431) [50, 101]\n- [SE-ResNet](https://arxiv.org/abs/1709.01507) [18, 34, 50, 101, 152]\n- [SE-ResNeXt](https://arxiv.org/abs/1709.01507) [50, 101]\n- [SE-Net](https://arxiv.org/abs/1709.01507) [154]\n- [DenseNet](https://arxiv.org/abs/1608.06993) [121, 169, 201]\n- [Inception ResNet V2](https://arxiv.org/abs/1602.07261)\n- [Inception V3](http://arxiv.org/abs/1512.00567)\n- [Xception](https://arxiv.org/abs/1610.02357)\n- [NASNet](https://arxiv.org/abs/1707.07012) [large, mobile]\n- [MobileNet](https://arxiv.org/pdf/1704.04861.pdf)\n- [MobileNet v2](https://arxiv.org/abs/1801.04381)\n\n### Specification \nThe top-k accuracy were obtained using center single crop on the \n2012 ILSVRC ImageNet validation set and may differ from the original ones. \nThe input size used was 224x224 (min size 256) for all models except:\n - NASNetLarge 331x331 (352)\n - InceptionV3 299x299 (324)\n - InceptionResNetV2 299x299 (324)\n - Xception 299x299 (324) \n\nThe inference \\*Time was evaluated on 500 batches of size 16. \nAll models have been tested using same hardware and software. \nTime is listed just for comparison of performance.\n\n| Model |Acc@1|Acc@5|Time*|Source|\n|-----------------|:---:|:---:|:---:|------|\n|vgg16 |70.79|89.74|24.95|[keras](https://github.com/keras-team/keras-applications)|\n|vgg19 |70.89|89.69|24.95|[keras](https://github.com/keras-team/keras-applications)|\n|resnet18 |68.24|88.49|16.07|[mxnet](https://github.com/Microsoft/MMdnn)|\n|resnet34 |72.17|90.74|17.37|[mxnet](https://github.com/Microsoft/MMdnn)|\n|resnet50 |74.81|92.38|22.62|[mxnet](https://github.com/Microsoft/MMdnn)|\n|resnet101 |76.58|93.10|33.03|[mxnet](https://github.com/Microsoft/MMdnn)|\n|resnet152 |76.66|93.08|42.37|[mxnet](https://github.com/Microsoft/MMdnn)|\n|resnet50v2 |69.73|89.31|19.56|[keras](https://github.com/keras-team/keras-applications)|\n|resnet101v2 |71.93|90.41|28.80|[keras](https://github.com/keras-team/keras-applications)|\n|resnet152v2 |72.29|90.61|41.09|[keras](https://github.com/keras-team/keras-applications)|\n|resnext50 |77.36|93.48|37.57|[keras](https://github.com/keras-team/keras-applications)|\n|resnext101 |78.48|94.00|60.07|[keras](https://github.com/keras-team/keras-applications)|\n|densenet121 |74.67|92.04|27.66|[keras](https://github.com/keras-team/keras-applications)|\n|densenet169 |75.85|92.93|33.71|[keras](https://github.com/keras-team/keras-applications)|\n|densenet201 |77.13|93.43|42.40|[keras](https://github.com/keras-team/keras-applications)|\n|inceptionv3 |77.55|93.48|38.94|[keras](https://github.com/keras-team/keras-applications)|\n|xception |78.87|94.20|42.18|[keras](https://github.com/keras-team/keras-applications)|\n|inceptionresnetv2|80.03|94.89|54.77|[keras](https://github.com/keras-team/keras-applications)|\n|seresnet18 |69.41|88.84|20.19|[pytorch](https://github.com/Cadene/pretrained-models.pytorch)|\n|seresnet34 |72.60|90.91|22.20|[pytorch](https://github.com/Cadene/pretrained-models.pytorch)|\n|seresnet50 |76.44|93.02|23.64|[pytorch](https://github.com/Cadene/pretrained-models.pytorch)|\n|seresnet101 |77.92|94.00|32.55|[pytorch](https://github.com/Cadene/pretrained-models.pytorch)|\n|seresnet152 |78.34|94.08|47.88|[pytorch](https://github.com/Cadene/pretrained-models.pytorch)|\n|seresnext50 |78.74|94.30|38.29|[pytorch](https://github.com/Cadene/pretrained-models.pytorch)|\n|seresnext101 |79.88|94.87|62.80|[pytorch](https://github.com/Cadene/pretrained-models.pytorch)|\n|senet154 |81.06|95.24|137.36|[pytorch](https://github.com/Cadene/pretrained-models.pytorch)|\n|nasnetlarge |**82.12**|**95.72**|116.53|[keras](https://github.com/keras-team/keras-applications)|\n|nasnetmobile |74.04|91.54|27.73|[keras](https://github.com/keras-team/keras-applications)|\n|mobilenet |70.36|89.39|15.50|[keras](https://github.com/keras-team/keras-applications)|\n|mobilenetv2 |71.63|90.35|18.31|[keras](https://github.com/keras-team/keras-applications)|\n\n\n### Weights\n| Name |Classes | Models |\n|-------------------------|:--------:|:---------:|\n|'imagenet' |1000 |all models |\n|'imagenet11k-place365ch' |11586 |resnet50 |\n|'imagenet11k' |11221 |resnet152 |\n\n\n### Installation\n\nRequirements:\n- Keras >= 2.2.0 / TensorFlow >= 1.12\n- keras_applications >= 1.0.7\n\n###### Note\n This library does not have TensorFlow in a requirements for installation. \n Please, choose suitable version (\u2018cpu\u2019/\u2019gpu\u2019) and install it manually using \n official Guide (https://www.tensorflow.org/install/).\n\nPyPI stable package:\n```bash\n$ pip install image-classifiers==0.2.2\n```\n\nPyPI latest package:\n```bash\n$ pip install image-classifiers==1.0.0b1\n```\n\nLatest version:\n```bash\n$ pip install git+https://github.com/qubvel/classification_models.git\n```\n\n### Examples \n\n##### Loading model with `imagenet` weights:\n\n```python\n# for keras\nfrom classification_models.keras import Classifiers\n\n# for tensorflow.keras\n# from classification_models.tfkeras import Classifiers\n\nResNet18, preprocess_input = Classifiers.get('resnet18')\nmodel = ResNet18((224, 224, 3), weights='imagenet')\n```\n\nThis way take one additional line of code, however if you would \nlike to train several models you do not need to import them directly, \njust access everything through `Classifiers`.\n\nYou can get all model names using `Classifiers.models_names()` method.\n\n##### Inference example:\n\n```python\nimport numpy as np\nfrom skimage.io import imread\nfrom skimage.transform import resize\nfrom keras.applications.imagenet_utils import decode_predictions\nfrom classification_models.keras import Classifiers\n\nResNet18, preprocess_input = Classifiers.get('resnet18')\n\n# read and prepare image\nx = imread('./imgs/tests/seagull.jpg')\nx = resize(x, (224, 224)) * 255 # cast back to 0-255 range\nx = preprocess_input(x)\nx = np.expand_dims(x, 0)\n\n# load model\nmodel = ResNet18(input_shape=(224,224,3), weights='imagenet', classes=1000)\n\n# processing image\ny = model.predict(x)\n\n# result\nprint(decode_predictions(y))\n```\n\n##### Model fine-tuning example:\n```python\nimport keras\nfrom classification_models.keras import Classifiers\n\nResNet18, preprocess_input = Classifiers.get('resnet18')\n\n# prepare your data\nX = ...\ny = ...\n\nX = preprocess_input(X)\n\nn_classes = 10\n\n# build model\nbase_model = ResNet18(input_shape=(224,224,3), weights='imagenet', include_top=False)\nx = keras.layers.GlobalAveragePooling2D()(base_model.output)\noutput = keras.layers.Dense(n_classes, activation='softmax')(x)\nmodel = keras.models.Model(inputs=[base_model.input], outputs=[output])\n\n# train\nmodel.compile(optimizer='SGD', loss='categorical_crossentropy', metrics=['accuracy'])\nmodel.fit(X, y)\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": "https://github.com/qubvel/classification_models", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "image-classifiers", "package_url": "https://pypi.org/project/image-classifiers/", "platform": "", "project_url": "https://pypi.org/project/image-classifiers/", "project_urls": { "Homepage": "https://github.com/qubvel/classification_models" }, "release_url": "https://pypi.org/project/image-classifiers/1.0.0/", "requires_dist": [ "keras-applications (<=1.0.8,>=1.0.7)", "scikit-image ; extra == 'tests'", "pytest ; extra == 'tests'" ], "requires_python": ">=3.0.0", "summary": "Image classification models. Keras.", "version": "1.0.0" }, "last_serial": 5927728, "releases": { "0.1.0rc0": [ { "comment_text": "", "digests": { "md5": "f2df8e3d21fb108b4072bba453ae3240", "sha256": "51eaab498a68168f6dbd85f6088cb033658226995e3e467cc465ecc45c340d36" }, "downloads": -1, "filename": "image_classifiers-0.1.0rc0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f2df8e3d21fb108b4072bba453ae3240", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.0.0", "size": 12451, "upload_time": "2018-12-21T09:41:47", "url": "https://files.pythonhosted.org/packages/55/10/80588eb0b79b51d0eb31f47896e8b4f9588f0328cbb44f4abfb5e6a1b8be/image_classifiers-0.1.0rc0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ad55c2d02bcb89c57672710afa633766", "sha256": "296a81db1e02e08ce1642a1153e5c113da1a7aa73fa8f7e9da15b39d82037467" }, "downloads": -1, "filename": "image_classifiers-0.1.0rc0.tar.gz", "has_sig": false, "md5_digest": "ad55c2d02bcb89c57672710afa633766", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0.0", "size": 8867, "upload_time": "2018-12-21T09:41:49", "url": "https://files.pythonhosted.org/packages/cb/1d/64133e814e9f18c58fba4f5226ea562caca5a3c85af5e98faa919ee9b5be/image_classifiers-0.1.0rc0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "cbba207c672ee6a454a11babec6d0dba", "sha256": "89c862834da893ce64bb8728e472df3dbec2cb662d0c12ab29d9a0ff2082df90" }, "downloads": -1, "filename": "image_classifiers-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "cbba207c672ee6a454a11babec6d0dba", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.0.0", "size": 76463, "upload_time": "2019-01-17T20:17:20", "url": "https://files.pythonhosted.org/packages/de/32/a1e74e03f74506d1e4b46bb2732ca5a7b18ac52a36b5e3547e63537ce74c/image_classifiers-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0a902f53b558cf39b3c9b8f1b6d53797", "sha256": "2a0fffb91ea3943a7b7e198c4e207e11a71fd45776cacb3d54852d4f27706242" }, "downloads": -1, "filename": "image_classifiers-0.2.0.tar.gz", "has_sig": false, "md5_digest": "0a902f53b558cf39b3c9b8f1b6d53797", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0.0", "size": 45948, "upload_time": "2019-01-17T20:17:21", "url": "https://files.pythonhosted.org/packages/95/b5/ad75eb085acb0f4c442fc995c23c752321fe353d69abf6459990139415df/image_classifiers-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "36989e41221094f41da424034058acf4", "sha256": "f92255b2e4ab528403551495c72f6ee67bfb23f9ae609300170fda5d0322f4b7" }, "downloads": -1, "filename": "image_classifiers-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "36989e41221094f41da424034058acf4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.0.0", "size": 20680, "upload_time": "2019-04-18T10:18:44", "url": "https://files.pythonhosted.org/packages/e2/8e/001d6e0af6fa062823cd183f66dd35cab7223371698fd0e6d4d4f74e3a3c/image_classifiers-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c5b2932f064273191d7aeb9ef58ab7d9", "sha256": "eb44e021a4565b6e9645e83c070cb3fc689022781eae6f65818585a90182a4b6" }, "downloads": -1, "filename": "image_classifiers-0.2.1.tar.gz", "has_sig": false, "md5_digest": "c5b2932f064273191d7aeb9ef58ab7d9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0.0", "size": 15869, "upload_time": "2019-04-18T10:18:46", "url": "https://files.pythonhosted.org/packages/05/7f/3b834671a5cea3d6da995900ddfbdc34fcadf051a00e32180cadf79a8b48/image_classifiers-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "f29ef786f48f08fac65b5744d6113a89", "sha256": "fdd7ca9f4e6fe2b4ee2f796a7b858840ca117df226648c7e45b15ebfbcf04df6" }, "downloads": -1, "filename": "image_classifiers-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f29ef786f48f08fac65b5744d6113a89", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.0.0", "size": 72993, "upload_time": "2019-05-23T14:03:22", "url": "https://files.pythonhosted.org/packages/8d/7f/31234ee4bc8243f9e8b59b827e8a61436d7269cf75936b0aecc48a08f06c/image_classifiers-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ed1dbdccc04a5573132184cf99ee29f8", "sha256": "cb6c11ff804f8472c91b960068f532ec6d80a973b1309809daf04e2313d7ad78" }, "downloads": -1, "filename": "image_classifiers-0.2.2.tar.gz", "has_sig": false, "md5_digest": "ed1dbdccc04a5573132184cf99ee29f8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0.0", "size": 43383, "upload_time": "2019-05-23T14:03:25", "url": "https://files.pythonhosted.org/packages/e7/39/03e7844d99e2a47c2f6b26d9086f393a4a115950e7de35e7f9a5bf946df1/image_classifiers-0.2.2.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "fedd8f4ef0525aa52893cfb675922739", "sha256": "6030bdfd1bc334a4e9d018e8962fbe9c8deba3257dc21c237032ff1590da2b98" }, "downloads": -1, "filename": "image_classifiers-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "fedd8f4ef0525aa52893cfb675922739", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.0.0", "size": 19951, "upload_time": "2019-10-04T10:27:26", "url": "https://files.pythonhosted.org/packages/81/98/6f84720e299a4942ab80df5f76ab97b7828b24d1de5e9b2cbbe6073228b7/image_classifiers-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "64847c2f9807a4e656860bc6425be2e3", "sha256": "62022c0ff919d8ba5e3ffb7958b7db916e102e3e65c47c71cf8717ced43c0e4c" }, "downloads": -1, "filename": "image_classifiers-1.0.0.tar.gz", "has_sig": false, "md5_digest": "64847c2f9807a4e656860bc6425be2e3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0.0", "size": 18195, "upload_time": "2019-10-04T10:27:28", "url": "https://files.pythonhosted.org/packages/83/89/cf76a884d63477fc0e964d3494e65095272af60c48ee72b2c74b96da92c7/image_classifiers-1.0.0.tar.gz" } ], "1.0.0b1": [ { "comment_text": "", "digests": { "md5": "b33afecefd4bc07f729b8b022784baf2", "sha256": "dfd2923ddb953d067ea242950dc0c235425b1cb198e627a02026b795b71a0ab2" }, "downloads": -1, "filename": "image_classifiers-1.0.0b1.tar.gz", "has_sig": false, "md5_digest": "b33afecefd4bc07f729b8b022784baf2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0.0", "size": 18161, "upload_time": "2019-08-06T08:39:04", "url": "https://files.pythonhosted.org/packages/d0/15/c51837c7009063ab9e4d3654eb32a92838fe515023cc7862e06857c9d19b/image_classifiers-1.0.0b1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fedd8f4ef0525aa52893cfb675922739", "sha256": "6030bdfd1bc334a4e9d018e8962fbe9c8deba3257dc21c237032ff1590da2b98" }, "downloads": -1, "filename": "image_classifiers-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "fedd8f4ef0525aa52893cfb675922739", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.0.0", "size": 19951, "upload_time": "2019-10-04T10:27:26", "url": "https://files.pythonhosted.org/packages/81/98/6f84720e299a4942ab80df5f76ab97b7828b24d1de5e9b2cbbe6073228b7/image_classifiers-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "64847c2f9807a4e656860bc6425be2e3", "sha256": "62022c0ff919d8ba5e3ffb7958b7db916e102e3e65c47c71cf8717ced43c0e4c" }, "downloads": -1, "filename": "image_classifiers-1.0.0.tar.gz", "has_sig": false, "md5_digest": "64847c2f9807a4e656860bc6425be2e3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0.0", "size": 18195, "upload_time": "2019-10-04T10:27:28", "url": "https://files.pythonhosted.org/packages/83/89/cf76a884d63477fc0e964d3494e65095272af60c48ee72b2c74b96da92c7/image_classifiers-1.0.0.tar.gz" } ] }