跳转到主要内容

otamapy是otama的Python接口。

项目描述

Build status

关于

otamapy是otama (otama是CBIR)的Python接口。

安装

通过pip

$ pip install --upgrade otamapy

通过easy_install

$ easy_install -ZU otamapy

需求

  • Python2.6+和Python3.2+

  • otama库(《otama》otama,《nv》nv,《eiio》eiio

安装otama

在MacOSX上

$ sh tools/install-libotama-for-macosx.sh

在Linux上

$ sh tools/install-libotama.sh

用法

配置文件(example.conf)

{
    'namespace': 'testnamespace',
    'driver': {'name': 'color', 'data_dir': './data', 'color_weight': 0.2},
    'database': {'driver': 'sqlite3', 'name': './data/store.sqlite3'}
}

存储到数据库,并从数据库中搜索。

# 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

参见示例

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

otamapy-0.3.2.tar.gz (7.5 kB 查看哈希值)

上传于 来源

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面