检测识别率

xbob.measure.idmeasure的Python项目详细描述


此示例演示如何通过提供新的性能度量来扩展bob 用于测量开放集标识

安装

首先,必须按照说明安装bobthere

注意

如果您是通过我们的github门户而不是通过pypi阅读此页面, 注意包的开发提示可能不稳定或 瞬间不稳定的

转到https://pypi.python.org/pypi/xbob.measure.idmeasure下载最新的 这个包的稳定版本。

有两个选项可用于安装此软件包和 在计算机上运行:可以使用自动安装程序,如pip(或easy_install),也可以手动下载、解包和 使用zc.buildout创建 虚拟工作环境仅用于此包。在这两种情况下 上面列出的依赖项将自动下载和安装。

使用自动安装程序

使用pip是最简单的(shell命令用$信号标记):

$ pip install xbob.measure.idmeasure

您也可以使用easy_install

$ easy_install xbob.measure.idmeasure

这将下载并安装此软件包以及任何其他需要的 依赖关系。它还将验证您安装的bob版本 是兼容的。

此方案可以通过virtualenv或根访问 机器。否则,我们建议您使用下一个选项。

使用zc.buildout

PyPI下载此包的最新版本,并将其解压缩到 工作区。工具包本身的安装使用buildout。你不需要了解它的内部工作原理 使用这个包裹。这是一个让你开始的食谱:

$ python bootstrap.py
$ ./bin/buildout

这两个命令应该下载并安装所有未安装的依赖项和 为您提供一个完全可操作的测试和开发环境。

注意

在前一个命令集的第一行中使用的python shell 确定将用于开发的所有脚本的python解释器 在这个包裹里。因为这个包使用Bob,所以必须确保 使用调用bootstrap.py脚本 生成bob,否则可能会发生意外问题。

如果系统管理员安装了bob,则可以安全地 假设它使用默认的python解释器。在这种情况下,上述3 命令行应按预期工作。如果你在某个地方安装了鲍勃 否则,在私有目录中,在buildout.cfg之前编辑文件 正在运行./bin/buildout。找到名为buildout的节并编辑或 添加行prefixes以指向安装bob的目录或 建造。例如:

[buildout]
...
prefixes=/Users/crazyfox/work/bob/build

用户指南

假设您已经遵循了软件包的安装说明 安装了这个软件包。

这个包中有两个函数dir和dir_plot,用于计算和绘制 通过给定预先定义的错误接受来检测和识别率 价格。这些功能的说明如下:

DIR(cmc_scores, far_list):
==========================
Calculates the Detection and Identification Rate from the give input and
a vector of specified false acceptance rates

Keyword attributes:

cmc_scores
  List of two-element tuples. Each of the tuples contains the negative and
  the positive scores for one test item.

far_list
  Array of predefined false acceptance rates.

Return: List of two-element tuples, namely detection and identificatio rate.
  Each of the tuples contains the probability that the rank r of the
  positive score and the corresponding false acceptance rate. r is computed
  as the number of negative scores that are higher than the positive score.

DIR_plot(cmc_scores, far_list, logx = True, **kwargs):
======================================================
Plot the Detection and Identification Rate from the give input and a
vector of specified false acceptance rates

Keyword attributes:

cmc_scores
  List of two-element tuples. Each of the tuples contains the negative
  and the positive scores for one test item.

far_list
  Array of predefined false acceptance rates.

logx
  Boolean input, if it is true, the x-axis is in log scale.

kwargs
  A dictionary of extra plotting parameters, that is passed directly to
  matplotlib.pyplot.plot

Note: This function does not initiate and save the figure instance, it
      only issues the plotting commands.  Every user is responsible for
      setting up and saving the figure as it best fits his purpose.

下面,我们提供一个如何应用dir_plot绘制dir曲线的示例,从 Python世界:

>>> import idmeasure
# predefine a list of false acceptance rates
>>> FAR=[.01, 0.1, 1]
#Read The four column file needs to be in the same format as described in the
 five_column function, and the "test label" (column 4) has to contain the
 test/probe file name.  please refer the functions of
 bob.measure.load.cmc_four_column, bob.measure.load.cmc_five_column to load
 or generate the "cmc scores".
>>> idmeasure.DIR_plot(cmc_scores, FAR)
>>>pyplot.xlabel("Rank")
>>>pyplot.ylabel("Identification Rate (%)")
>>>pyplot.title("Detection and Identification Rate Identification Experiment")
>>>pyplot.grid()
>>>pyplot.savefig("eigenfaceDIR.png")
>>>pyplot.close()

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
gwt java。lang.UnsupportedClassVersionError:不受支持的专业。小版本51.0   java XML解析器trycatch不工作   java Jackson MRBean不工作,无法构造实例   javascript是检查参数的更好方法吗?   java在发生冲突时从ArrayList中删除对象   JavaSpringWebFlux和KeyClope JWTRESTAPI   java Selected选项在微调器中不可见   java在增加分区后,有没有办法在ApacheKafka中保持顺序?   java添加SourceRoot会导致spring启动应用程序出错   java Spring引导:任何bean都没有实现ReactiveCrudepository   java无法注册我的自定义AbstractAnnotationConfigDispatcherServletInitializer   TCP连接上的java Caesar密码   java树集排序不正确   java如何在自定义查询中加载@ElementCollection?