Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hhatto/otamapy
otama Python Interface
https://github.com/hhatto/otamapy
Last synced: about 1 month ago
JSON representation
otama Python Interface
- Host: GitHub
- URL: https://github.com/hhatto/otamapy
- Owner: hhatto
- License: gpl-3.0
- Created: 2013-02-03T14:23:16.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-05-09T14:51:44.000Z (over 7 years ago)
- Last Synced: 2024-10-03T23:23:41.424Z (about 1 month ago)
- Language: C
- Size: 1.01 MB
- Stars: 11
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
=======
otamapy
=======.. image:: https://travis-ci.org/hhatto/otamapy.png?branch=master
:target: https://travis-ci.org/hhatto/otamapy
:alt: Build statusAbout
=====
otamapy is Python Interface for otama_ (otama is CBIR.)... _otama: https://github.com/nagadomi/otama
.. _nv: https://github.com/nagadomi/nv
.. _eiio: https://github.com/nagadomi/eiioInstallation
============
from pip::$ pip install --upgrade otamapy
from easy_install::
$ easy_install -ZU otamapy
Requirements
============
* Python2.6+ and Python3.2+
* otama library (otama_, nv_, eiio_)Installation otama
------------------on MacOSX (via homebrew-tap)::
$ brew tap hhatto/otama
$ brew install otamaon Linux::
$ sh tools/install-libotama.sh
on MacOSX (from source)::
$ sh tools/install-libotama-for-macosx.sh
Usage
=====config file (example.conf)
.. code-block:: text
{
'namespace': 'testnamespace',
'driver': {'name': 'color', 'data_dir': './data', 'color_weight': 0.2},
'database': {'driver': 'sqlite3', 'name': './data/store.sqlite3'}
}store to database, and search from database.
.. code-block:: python
# store_and_search.py
from otama import Otama
db = Otama.open('example.conf')kvs = {}
db.create_database()
for filename in ('foo.jpg', 'bar.jpg'):
kvs[db.insert(filename)] = filenamefor result in db.search(10, 'foo.jpg'):
key = result['id']
print("sim=%.3f, file=%s" % (result['similarity'], kvs[key])).. code-block:: text
$ python store_and_search.py
sim=1.000, file=foo.jpg
sim=0.969, file=bar.jpgsee examples_ .
.. _examples: https://github.com/hhatto/otamapy/tree/master/examples
Links
=====
* PyPI_
* GitHub_
* `Travis CI`_.. _PyPI: http://pypi.python.org/pypi/otamapy/
.. _GitHub: https://github.com/hhatto/otamapy
.. _`Travis CI`: https://travis-ci.org/hhatto/otamapy