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
Installation otama
on MacOSX:
$ sh tools/install-libotama-for-macosx.sh
on Linux:
$ sh tools/install-libotama.sh
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 .
Links
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.3.1.tar.gz
(7.4 kB
view details)
File details
Details for the file otamapy-0.3.1.tar.gz
.
File metadata
- Download URL: otamapy-0.3.1.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c41fc5dadefbfb4eaa061693d536627de4810a4d2c60052f4ccbb7b53ffd4bf1 |
|
MD5 | 598d93def321b198dfe6ae154a7ec9bc |
|
BLAKE2b-256 | a10e13aea82cc7103b79e1cea467d6bc58a753d537d2bd235cf057016e3d130c |