Commit 072edb9a authored by Ivana CHINGOVSKA's avatar Ivana CHINGOVSKA
Browse files

bob2 compatibility

parent 7382820f
language: python
matrix:
include:
- python: 2.6
- python: 2.7
env:
- secure: XnteGmVwZmZGBafEq1I35HeiYlnuaTgIzQuPuitY+BsCfOsbZzJxhJep95uLlsmAMDNhsJnMrRq7IZK75OLeK4ZDhFTQ0clXQwpUZKrGazsi9uXH8zH8ts4P952CPZ8SEpFyl6Cz6zMsem/AykCBZEMzsc/4rwjyejP3If/Fg5U=
- secure: ZOyLb9iTrhUfheUnJF+hUkJlB4cf25sa88BBKVvti7XTZNk7HcOKc9eaX9DYJaLLrQI04sgMslA3uZUqcIHZgI9S8ChEcZPiU3L0zDkQZXh9YrpPFomED5Xh3kx2l1hoU5aN9fHpNllSk0iVYyyHh1uw7VWR+Lqq0duRnuPN3Q0=
- python: 3.2
env:
- NUMPYSPEC===1.8.0
- python: 3.3
env:
- NUMPYSPEC===1.8.0
before_install:
- sudo add-apt-repository -y ppa:biometrics/bob
- sudo apt-get update -qq
- sudo apt-get install -qq --force-yes libboost-all-dev libblitz1-dev libhdf5-serial-dev libatlas-dev libatlas-base-dev liblapack-dev
- if [ -n "${NUMPYSPEC}" ]; then sudo apt-get install -qq gfortran; fi
- if [ -n "${NUMPYSPEC}" ]; then pip install --upgrade pip setuptools; fi
- if [ -n "${NUMPYSPEC}" ]; then pip install --find-links http://wheels.astropy.org/ --find-links http://wheels2.astropy.org/ --use-wheel numpy$NUMPYSPEC; fi
- pip install matplotlib==1.3.0 sphinx nose==1.3.0 jinja2==2.6 coveralls
install:
- python bootstrap.py
- ./bin/buildout
script:
- ./bin/python -c 'from bob.db.replay import get_config; print(get_config())'
- ./bin/coverage run --source=bob.db.replay ./bin/nosetests -sv
- ./bin/sphinx-build -b doctest doc sphinx
- ./bin/sphinx-build -b html doc sphinx
after_success:
- coveralls
- ./src/bob.extension/scripts/upload-sphinx.sh
include README.rst
recursive-include docs *.py *.rst
recursive-include xbob *.sql3
recursive-include doc *.py *.rst
recursive-include bob *.sql3
......@@ -28,4 +28,22 @@ from .query import Database
from .models import Client, File, Protocol, RealAccess, Attack
from . import spoofing
__all__ = dir()
def get_config():
"""Returns a string containing the configuration information.
"""
import pkg_resources
packages = pkg_resources.require(__name__)
this = packages[0]
deps = packages[1:]
retval = "%s: %s (%s)\n" % (this.key, this.version, this.location)
retval += " - python dependencies:\n"
for d in deps: retval += " - %s: %s (%s)\n" % (d.key, d.version, d.location)
return retval.strip()
# gets sphinx autodoc done right - don't remove it
__all__ = [_ for _ in dir() if not _.startswith('_')]
......@@ -39,7 +39,7 @@ def checkfiles(args):
# report
output = sys.stdout
if args.selftest:
from bob.db.utils import null
from bob.db.base.utils import null
output = null()
if bad:
......
......@@ -155,7 +155,7 @@ def define_protocols(session, protodir, verbose):
def create_tables(args):
"""Creates all necessary tables (only to be used at the first time)"""
from bob.db.utils import create_engine_try_nolock
from bob.db.base.utils import create_engine_try_nolock
engine = create_engine_try_nolock(args.type, args.files[0], echo=(args.verbose >= 2))
Client.metadata.create_all(engine)
......@@ -169,7 +169,7 @@ def create_tables(args):
def create(args):
"""Creates or re-creates this database"""
from bob.db.utils import session_try_nolock
from bob.db.base.utils import session_try_nolock
dbfile = args.files[0]
......
......@@ -8,7 +8,7 @@
import os
import sys
from bob.db.driver import Interface as BaseInterface
from bob.db.base.driver import Interface as BaseInterface
def reverse(args):
"""Returns a list of file database identifiers given the path stems"""
......@@ -18,7 +18,7 @@ def reverse(args):
output = sys.stdout
if args.selftest:
from bob.db.utils import null
from bob.db.base.utils import null
output = null()
r = db.reverse(args.path)
......@@ -49,7 +49,7 @@ def path(args):
output = sys.stdout
if args.selftest:
from bob.db.utils import null
from bob.db.base.utils import null
output = null()
r = db.paths(args.id, prefix=args.directory, suffix=args.extension)
......@@ -81,7 +81,7 @@ class Interface(BaseInterface):
def version(self):
import pkg_resources # part of setuptools
return pkg_resources.require('xbob.db.%s' % self.name())[0].version
return pkg_resources.require('bob.db.%s' % self.name())[0].version
def files(self):
......
......@@ -29,7 +29,7 @@ def dumplist(args):
output = sys.stdout
if args.selftest:
from bob.db.utils import null
from bob.db.base.utils import null
output = null()
for f in r:
......
......@@ -8,8 +8,8 @@
import os
from sqlalchemy import Table, Column, Integer, String, ForeignKey
from bob.db.sqlalchemy_migration import Enum, relationship
import bob.db.utils
from bob.db.base.sqlalchemy_migration import Enum, relationship
import bob.db.base.utils
from sqlalchemy.orm import backref
from sqlalchemy.ext.declarative import declarative_base
import numpy
......@@ -180,7 +180,7 @@ class File(Base):
[optional] The extension of the filename - this will control the type of
output and the codec for saving the input blob.
"""
return bob.io.load(self.make_path(directory, extension))
return bob.io.base.load(self.make_path(directory, extension))
def save(self, data, directory=None, extension='.hdf5'):
"""Saves the input data at the specified location and using the given
......@@ -201,8 +201,8 @@ class File(Base):
"""
path = self.make_path(directory, extension)
bob.db.utils.makedirs_safe(os.path.dirname(path))
bob.io.save(data, path)
bob.db.base.utils.makedirs_safe(os.path.dirname(path))
bob.io.base.save(data, path)
# Intermediate mapping from RealAccess's to Protocol's
realaccesses_protocols = Table('realaccesses_protocols', Base.metadata,
......
......@@ -9,7 +9,7 @@ replay attack database in the most obvious ways.
import os
import logging
from bob.db import utils
from bob.db.base import utils
from .models import *
from .driver import Interface
......
......@@ -134,31 +134,31 @@ class ReplayDatabaseTest(unittest.TestCase):
def test11_manage_files(self):
from bob.db.script.dbmanage import main
from bob.db.base.script.dbmanage import main
self.assertEqual(main('replay files'.split()), 0)
def test12_manage_dumplist_1(self):
from bob.db.script.dbmanage import main
from bob.db.base.script.dbmanage import main
self.assertEqual(main('replay dumplist --self-test'.split()), 0)
def test13_manage_dumplist_2(self):
from bob.db.script.dbmanage import main
from bob.db.base.script.dbmanage import main
self.assertEqual(main('replay dumplist --class=attack --group=devel --support=hand --protocol=highdef --self-test'.split()), 0)
def test14_manage_dumplist_client(self):
from bob.db.script.dbmanage import main
from bob.db.base.script.dbmanage import main
self.assertEqual(main('replay dumplist --client=117 --self-test'.split()), 0)
def test15_manage_checkfiles(self):
from bob.db.script.dbmanage import main
from bob.db.base.script.dbmanage import main
self.assertEqual(main('replay checkfiles --self-test'.split()), 0)
......
; vim: set fileencoding=utf-8 :
; author: Manuel Guenther <manuel.guenther@idiap.ch>
; date: Wed Feb 13 12:35:29 CET 2013
; Ivana Chingovska <ivana.chingovska@idiap.ch>
; Tue Sep 9 12:47:10 CEST 2014
[buildout]
parts = scripts
develop = .
eggs = xbob.db.replay
eggs = bob.db.replay
extensions = bob.buildout
mr.developer
auto-checkout = *
develop = src/bob.extension
src/bob.blitz
src/bob.core
src/bob.io.base
src/bob.db.base
src/bob.ip.color
src/bob.ip.draw
src/bob.math
src/bob.measure
src/bob.learn.activation
src/bob.learn.linear
src/bob.learn.libsvm
src/antispoofing.utils
.
; options for bob.buildout extension
debug = true
verbose = true
newest = false
[sources]
bob.extension = git https://github.com/bioidiap/bob.extension
bob.blitz = git https://github.com/bioidiap/bob.blitz
bob.core = git https://github.com/bioidiap/bob.core
bob.io.base = git https://github.com/bioidiap/bob.io.base
bob.db.base = git https://github.com/bioidiap/bob.db.base
bob.ip.color = git https://github.com/bioidiap/bob.ip.color
bob.ip.draw = git https://github.com/bioidiap/bob.ip.draw
bob.math = git https://github.com/bioidiap/bob.math
bob.measure = git https://github.com/bioidiap/bob.measure
bob.learn.activation = git https://github.com/bioidiap/bob.learn.activation
bob.learn.linear = git https://github.com/bioidiap/bob.learn.linear
bob.learn.libsvm = git https://github.com/bioidiap/bob.learn.libsvm
antispoofing.utils = git https://github.com/bioidiap/antispoofing.utils
[scripts]
recipe = xbob.buildout:scripts
dependent-scripts = true
recipe = bob.buildout:scripts
dependent-scripts=true
......@@ -40,7 +40,6 @@ extensions = [
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'bob.sphinxext.plot', # ours add source copying to install directory
]
# The viewcode extension appeared only on Sphinx >= 1.0.0
......@@ -77,7 +76,7 @@ copyright = u'%s, Idiap Research Institute' % time.strftime('%Y')
# built documents.
#
# The short X.Y version.
from xbob.db.replay.driver import Interface
from bob.db.replay.driver import Interface
version = Interface().version()
# The full version, including alpha/beta/rc tags.
release = version
......@@ -151,7 +150,7 @@ html_favicon = ''
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
#html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
......
.. vim: set fileencoding=utf-8 :
.. @author: Manuel Guenther <Manuel.Guenther@idiap.ch>
.. @date: Thu Dec 6 12:28:25 CET 2012
==============
User's Guide
==============
.. todo::
Write users guide.
.. vim: set fileencoding=utf-8 :
.. @author: Manuel Guenther <Manuel.Guenther@idiap.ch>
.. @date: Tue Aug 26 09:42:18 CEST 2014
======================================
Replay-Attack Face Spoofing Database
======================================
.. todolist::
Documentation
-------------
.. toctree::
:maxdepth: 2
guide
py_api
Indices and tables
------------------
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
.. vim: set fileencoding=utf-8 :
.. Andre Anjos <andre.anjos@idiap.ch>
.. Mon 13 Aug 2012 12:36:40 CEST
.. Mon 13 Aug 2012 12:36:40 CEST
========================
Replay Attack Database
========================
============
Python API
============
.. automodule:: xbob.db.replay
.. automodule:: bob.db.replay
......@@ -9,13 +9,13 @@ from setuptools import setup, find_packages
# parameters that define our package.
setup(
name='xbob.db.replay',
version='1.0.4',
name='bob.db.replay',
version='2.0.0a0',
description='Replay Attack Database Access API for Bob',
url='http://pypi.python.org/pypi/xbob.db.replay',
url='http://pypi.python.org/pypi/bob.db.replay',
license='GPLv3',
author='Andre Anjos',
author_email='andre.anjos@idiap.ch',
author='Andre Anjos, Ivana Chingovska',
author_email='andre.anjos@idiap.ch, ivana.chingovska@idiap.ch',
long_description=open('README.rst').read(),
# This line is required for any distutils based packaging.
......@@ -26,34 +26,29 @@ setup(
install_requires=[
'setuptools',
'six',
'bob >= 1.1.0',
'antispoofing.utils',
'bob.db.base',
],
namespace_packages = [
'xbob',
'xbob.db',
'bob',
'bob.db',
],
entry_points = {
# bob database declaration
'bob.db': [
'replay = xbob.db.replay.driver:Interface',
],
# bob unittest declaration
'bob.test': [
'replay = xbob.db.replay.test:ReplayDatabaseTest',
'replay = bob.db.replay.driver:Interface',
],
# antispoofing database declaration
'antispoofing.utils.db': [
'replay = xbob.db.replay.spoofing:Database',
'replay = bob.db.replay.spoofing:Database',
],
},
classifiers = [
'Development Status :: 5 - Production/Stable',
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Natural Language :: English',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment