Skip to main content

otamapy is Python Interface for otama.

Project description

About

otamapy is Python Interface for otama (otama is CBIR.).

Installation

from pip:

$ pip install --upgrade otamapy

from easy_install:

$ easy_install -ZU otamapy

Requirements

  • Python2.7+ and Python3.3+

  • otama library (otama, nv, eiio)

Usage

config file (example.conf)

{
    '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.

# store_and_search.py
from otama import Otama
db = Otama.open('example.conf')

kvs = {}
db.create_table()
for filename in ('foo.jpg', 'bar.jpg'):
    kvs[db.insert(filename)] = filename

for result in db.search(10, 'foo.jpg')
    key = result['id']
    print("sim=%.3f, file=%s" % (result['similarity'], kvs[key]))
$ python store_and_search.py
sim=1.000, file=foo.jpg
sim=0.969, file=bar.jpg

see examples .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

otamapy-0.2.tar.gz (6.4 kB view details)

Uploaded Source

File details

Details for the file otamapy-0.2.tar.gz.

File metadata

  • Download URL: otamapy-0.2.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for otamapy-0.2.tar.gz
Algorithm Hash digest
SHA256 7fd8a8f006ec60e473a02b779365852a8837be7d0817acbc3546684170f21a17
MD5 48158809a4268f61cf6011cbee81ee79
BLAKE2b-256 288e7cb913495a0dc532a9419df7000f291fa7212c34396b339f93d270f776fa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page