{ "info": { "author": "Ivan E. Cao-Berg", "author_email": "icaoberg@alumni.cmu.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Programming Language :: Python", "Topic :: Scientific/Engineering :: Bio-Informatics", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Scientific/Engineering :: Mathematics" ], "description": "halcon\n======\n\n.. image:: https://img.shields.io/badge/big%20data-true-blue.svg\n :target: https://en.wikipedia.org/wiki/Big_data\n\n.. image:: https://img.shields.io/github/issues/icaoberg/falcon.svg\n :target: https://github.com/icaoberg/falcon/issues\n\n.. image:: https://img.shields.io/github/forks/icaoberg/falcon.svg\n :target: https://github.com/icaoberg/falcon/network\n\n.. image:: https://img.shields.io/github/stars/icaoberg/falcon.svg\n :target: https://github.com/icaoberg/falcon/stargazers\n\n.. image:: https://img.shields.io/badge/license-GPLv3-blue.svg\n :target: https://raw.githubusercontent.com/icaoberg/falcon/master/LICENSE\n\n.. image:: https://badge.fury.io/py/halcon.svg\n :target: https://badge.fury.io/py/halcon\n\n\nhalcon (falcon in Spanish) is a python implementation of the Feedback Adaptive Loop for\nContent-Based Retrieval (FALCON) algorithm as described in\n\n- Leejay Wu, Christos Faloutsos, Katia P. Sycara, and Terry R. Payne.\n 2000. `FALCON: Feedback Adaptive Loop for Content-Based Retrieval `_. In Proceedings of the 26th International Conference on Very Large Data\n Bases (VLDB '00), Amr El Abbadi, Michael L. Brodie, Sharma\n Chakravarthy, Umeshwar Dayal, Nabil Kamel, Gunter Schlageter, and\n Kyu-Young Whang (Eds.). Morgan Kaufmann Publishers Inc., San\n Francisco, CA, USA, 297-306.\n\nFALCON is, as described in the article abstract, \"a novel method that is\ndesigned to handle disjunctive queries within metric spaces. The user\nprovides weights for positive examples; our system 'learns' the implied\nconcept and returns similar objects.\"\n\nDevelopment branch status\n*************************\n\n.. image:: https://travis-ci.org/icaoberg/falcon.svg?branch=master\n :target: https://travis-ci.org/icaoberg/falcon\n\nMaster branch status\n********************\n\n.. image:: https://travis-ci.org/icaoberg/falcon.svg?branch=master\n :target: https://travis-ci.org/icaoberg/falcon\n\n***************\nPre-Requisites\n***************\n\n- numpy\n- scipy\n- `mpmath `_\n\nTo install the prerequisites in Ubuntu\n\n::\n\n sudo apt-get install update\n sudo apt-get install python-numpy python-scipy\n sudo easy_install pip\n sudo pip install mpmath\n\n***************\nInstallation\n***************\n\nThere are several ways to install halcon. The most common way is to\ndownload the source code, unzip/untar the source code package and run\nthe command\n\n::\n\n sudo python setup.py install\n\nI have plans of submitting this package to the Python Package Index. If\nI do so, then should be able to install it by running the command\n\n::\n\n sudo pip install halcon\n\n**COMMENT**: halcon depends on `numpy `__ and\n`scipy `__. Installing these packages in Windows\nand MacOSX is not a trivial task. For more information refer to the\ndocumentation.\n\n\nIf you wish to install halcon in a virtual enviroment from source code, then you can do\n\n::\n\n virtualenv halcon\n cd falcon\n source ./bin/activate\n pip install numpy\n pip install scipy\n pip install npmath\n\n mkdir src\n cd src\n git clone git@github.com:icaoberg/falcon.git\n cd falcon\n python setup.py install\n\n cd ../../\n deactivate\n\n\nIf you wish to install halcon in a virtual enviroment from [PyPI](https://pypi.python.org/pypi/halcon), then you can do\n\n::\n\n virtualenv halcon\n cd falcon\n source ./bin/activate\n\n pip install numpy\n pip install scipy\n pip install npmath\n pip install halcon\n\n deactivate\n\n**COMMENT**: The previous snippet assumes that you have\n`virtualenv `__ installed in\nyour working system.\n\n***************\nUsage\n***************\n\nThere is only one method that you need to know about\n\n::\n\n halcon.search.query(good_set, candidates, alpha=-5,\n metric='euclidean', normalization='zscore', debug=False)\n\nHere is a brief description of each of the input arguments\n\n- ``good_set`` and ``candidates`` are two lists of lists where each\n member of both lists has the same shape.\n\n``record = [, , ]``\n\nFor example in ``wine.py``, I download a CSV file where the first\n``feature_vector`` looks like this\n\n::\n\n [1,14.23,1.71,2.43,15.6,127,2.8,3.06,.28,2.29,5.64,1.04,3.92,1065]\n\nand then I modify it like this\n\n\n::\n\n good_set = []\n identifier = 'wine00'\n initial_score = 1\n feature_vector = [1,14.23,1.71,2.43,15.6,127,2.8,3.06,.28,2.29,5.64,1.04,3.92,1065]\n good_set.append([identifier, initial_score, feature_vector])\n\n\nFor more information about the definition of the initial score, please\nrefer to the article. In all my examples I use a initial score of 1,\nthat is, all images have the same weight. The identifier should be\nunique (though not enforced), so you can tell images apart. This package\nassumes every object is represented by a\n`feature `__\nvector. Feature calculation goes beyond the scope of this package. There\nare many feature calculation/machine learning packages out there that\nyou might find useful, like `OpenCV `__,\n`mahotas `__ and\n`SLIC `__.\n\n- ``alpha``. For more information about alpha, please refer to the\n article. The recommended value by the paper is -5, which is the\n default value used in this package.\n\n- ``metric``. In the research article, a measure of distance ``d`` is\n used to calculate the distance between two feature vectors. The\n default value is ``euclidean`` (Euclidean distance) and other\n supported metrics are ``cityblock`` (Manhattan distance) and\n ``hamming`` (Hamming distance).\n\n- ``normalization``. Feature normalization option. Default is\n ``zscore``. Alternative option is ``standard``.\n\n- ``debug``. If debug flag is on, then it should print more information\n about the calculation as they happen.\n\n\n***************\nExamples\n***************\n\nFor convenience and testing I included some examples. These examples\ndownload some datasets from the web and use them to trigger a query. The\nonly exception is the random feature vectors example. For example, to\nrun the ``iris`` example simply run in terminal\n\n::\n\n python examples/iris.py\n\nThe examples have a dependency that the package does not, since I use\n`tabulate `__ to pretty print the\nresults from the examples.\n\nIn my humble opinion, the best way to run the examples is using\n`virtualenv `__ -which is what\nI do for `travis `__-. The next\ncommands assume you have virtualenv available.\n\n::\n\n virtualenv halcon --system-site-packages\n . ./halcon/bin/activate\n cd halcon\n mkdir src\n cd src\n pip install numpy\n pip install scipy\n pip install tabulate\n git clone https://github.com/icaoberg/halcon.git\n cd halcon\n python setup.py install\n cd ..\n python examples/iris.py\n\niris.py\n^^^^^^^\n\n::\n\n $ python examples/iris.py\n This example uses the iris dataset from\n Machine Learning Repository\n Center for Machine Learning and Intelligent Systems\n http://archive.ics.uci.edu/ml/datasets/Iris\n I will use the first feature vector as my query image\n [[0, 1, array([ 5.1, 3.5, 1.4, 0.2, 1. ])]]\n And I will use the rest of the feature vectors to find the most similar images\n Now notice that feature vector with iid1 has the same values iid0\n [1, 1, array([ 5.1, 3.5, 1.4, 0.2, 1. ])]\n So I expect that if halcon is working correctly, then iid1 should be the top hit!\n Elapsed time: 0.0221660137177 seconds\n\n Ranking Identifier Class Score\n --------- ------------ --------------- -----------\n 0 1 Iris-setosa 0\n 1 28 Iris-setosa 1.27788e-43\n 2 5 Iris-setosa 2.40121e-40\n 3 29 Iris-setosa 2.40121e-40\n 4 40 Iris-setosa 5.83391e-40\n 5 8 Iris-setosa 7.04398e-39\n 6 18 Iris-setosa 1.1259e-35\n 7 41 Iris-setosa 1.51906e-34\n 8 50 Iris-versicolor 6.99696e-34\n 9 37 Iris-setosa 1.09221e-32\n 10 12 Iris-setosa 1.22203e-32\n 11 49 Iris-setosa 2.05046e-32\n 12 11 Iris-setosa 4.25801e-31\n 13 21 Iris-setosa 6.55842e-31\n 14 47 Iris-setosa 5.54098e-29\n 15 36 Iris-setosa 7.93943e-29\n 16 7 Iris-setosa 2.16985e-28\n 17 20 Iris-setosa 4.23544e-28\n 18 25 Iris-setosa 1.67453e-27\n 19 3 Iris-setosa 2.40919e-27\n\n Do the top results in the list above belong to the same class as the query image?\n If so, then SCORE! It seems to work.\n\nwine.py\n^^^^^^^\n\n::\n\n $ python examples/wine.py\n This example uses the wine dataset from\n Machine Learning Repository\n Center for Machine Learning and Intelligent Systems\n http://archive.ics.uci.edu/ml/datasets/Wine\n I will use the first three feature vectors as my query wine set\n And I will use the rest of the feature vectors to find the most similar images\n Elapsed time: 0.0280928611755 seconds\n\n Ranking Identifier Score\n --------- ------------ -----------\n 0 wine1 0\n 1 wine2 0\n 2 wine3 0\n 3 wine21 2.77663e-05\n 4 wine30 0.000629879\n 5 wine23 0.00252617\n 6 wine49 0.00318536\n 7 wine57 0.00456123\n 8 wine36 0.0152067\n 9 wine39 0.0197516\n 10 wine58 0.0243848\n 11 wine9 0.024467\n 12 wine55 0.045762\n 13 wine24 0.046893\n 14 wine7 0.113906\n 15 wine45 0.188355\n 16 wine27 0.201802\n 17 wine41 0.206469\n 18 wine31 0.288536\n 19 wine56 0.291853\n\n\nhuman_protein_atlas.ipynb\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\nI have included a Jupyter notebook that shows an example using `Subcellular Location Features `_ on some images from the `Human Protein Atlas `_.\n\nUsing the query image\n\n.. image:: https://raw.githubusercontent.com/icaoberg/falcon/master/images/100_A12_1_blue_green.jpg\n :height: 250px\n\nwe queried the content database and determined the most similar image is\n\n.. image:: https://raw.githubusercontent.com/icaoberg/falcon/master/images/100_B12_2_blue_green.jpg\n :height: 250px\n\nDo you think they look similar?\n\n**************\nDocumentation\n**************\n\nDocumentation was written using `Sphinx `__. To\ngenerate documentation use the following commands.\n\nTo generate html\n\n::\n\n cd docs\n make html\n\nTo generate PDF document\n\n::\n\n cd docs\n make latexpdf\n\nTo generate epub document\n\n::\n\n cd docs\n make epub\n\n*********************\nBugs and Questions\n*********************\n\nTo submit bugs about the source code visit\n\n* https://github.com/icaoberg/halcon\n\nTo submit bugs about the documentation visit\n\n* https://github.com/icaoberg/halcon-docs\n\nFor any other inquiries visit those links as well.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/icaoberg/falcon", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "halcon", "package_url": "https://pypi.org/project/halcon/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/halcon/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/icaoberg/falcon" }, "release_url": "https://pypi.org/project/halcon/0.0.21/", "requires_dist": null, "requires_python": null, "summary": "Python implementation of FALCON: Feedback Adaptive Loop for Content-Based Retrieval", "version": "0.0.21" }, "last_serial": 2030313, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "d360b148b694c072f907e3029e27cd49", "sha256": "0c8bf2d525ce6d0d3117fdad51ac7bb1fe6fd8fe29cf962100007d8ec05b04d6" }, "downloads": -1, "filename": "halcon-0.0.1.tar.gz", "has_sig": false, "md5_digest": "d360b148b694c072f907e3029e27cd49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34039, "upload_time": "2014-04-08T05:00:25", "url": "https://files.pythonhosted.org/packages/12/ce/53ea08687962621e56d2ebdaa0a7b59ecdf8b76562069cb3146f8a4bc9a8/halcon-0.0.1.tar.gz" } ], "0.0.2": [], "0.0.21": [ { "comment_text": "", "digests": { "md5": "1bf4776efcacf329cfc8aa1bb797b55e", "sha256": "466f12f35eea1eaec988f3d7832fe0a339fc696352f0283241a839b7f840982d" }, "downloads": -1, "filename": "halcon-0.0.21.tar.gz", "has_sig": false, "md5_digest": "1bf4776efcacf329cfc8aa1bb797b55e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27150, "upload_time": "2016-03-27T21:08:27", "url": "https://files.pythonhosted.org/packages/3c/e6/dcb44a03a6ca69e8c9010790d6215f57b8f8982ed3e75a9696a5f75a0e22/halcon-0.0.21.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1bf4776efcacf329cfc8aa1bb797b55e", "sha256": "466f12f35eea1eaec988f3d7832fe0a339fc696352f0283241a839b7f840982d" }, "downloads": -1, "filename": "halcon-0.0.21.tar.gz", "has_sig": false, "md5_digest": "1bf4776efcacf329cfc8aa1bb797b55e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27150, "upload_time": "2016-03-27T21:08:27", "url": "https://files.pythonhosted.org/packages/3c/e6/dcb44a03a6ca69e8c9010790d6215f57b8f8982ed3e75a9696a5f75a0e22/halcon-0.0.21.tar.gz" } ] }