antispoofing.lbp and antispoofing.motion issues

140 views
Skip to first unread message

Ailbhe Cullen

unread,
May 2, 2017, 6:33:17 AM5/2/17
to bob-devel
Hi,

I'm trying to run the antispoofing.lbp and antispoofing.motion packages on the replay attack database.

I've installed bob using conda as recommended in the installation instructions, and I've downloaded the two packages from:
https://pypi.python.org/pypi/antispoofing.lbp
https://pypi.python.org/pypi/antispoofing.motion

I installed each package using the bootstrap-buildout and bin/buildout scripts, which seem to run fine, but I must have done something wrong, because when I try to call either calclbp.py or motion_framediff.py I get the following messages:

$ bin/calclbp.py replay
usage: calclbp.py [-h] [-v DIR] [-d DIRECTORY] [-n NORMFACESIZE]
                  [--ff FACESIZE_FILTER] [-l LBPTYPE] [--el ELBPTYPE]
                  [-b BLOCKS] [-c] [-o] [-e] [--nn] [--bbx]
                  {casia_fasd,all} ...
calclbp.py: error: invalid choice: 'replay' (choose from 'casia_fasd', 'all')

$ bin/calclbp.py replay
usage: calclbp.py [-h] [-v DIR] [-d DIRECTORY] [-n NORMFACESIZE]
                  [--ff FACESIZE_FILTER] [-l LBPTYPE] [--el ELBPTYPE]
                  [-b BLOCKS] [-c] [-o] [-e] [--nn] [--bbx]
                  {casia_fasd,all} ...
calclbp.py: error: invalid choice: 'replay' (choose from 'casia_fasd', 'all')

It appears that there is no valid option to run on replay?

Is this a common problem?

I'm running linux mint (64-bit), with python 2.7, conda 4.3.16, and bob 2.6.2

Thanks,
Ailbhe

Amir Mohammadi

unread,
May 2, 2017, 7:36:39 AM5/2/17
to bob-devel
Hi,

You probably need to install bob.db.replay in your environment too:
pip install bob.db.replay

Best,
Amir

--
-- You received this message because you are subscribed to the Google Groups bob-devel group. To post to this group, send email to bob-...@googlegroups.com. To unsubscribe from this group, send email to bob-devel+...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/bob-devel or directly the project website at http://idiap.github.com/bob/
---
You received this message because you are subscribed to the Google Groups "bob-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bob-devel+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ailbhe Cullen

unread,
May 2, 2017, 8:10:15 AM5/2/17
to bob-devel
Hi Amir,

Thanks for your quick reply.

I have already installed bob.db.base and bob.db.replay.

Interestingly though, I have not installed bob.db.casia_fasd. Despite this, looking through the log of the buildout I can find this message:

Getting distribution for 'bob.db.casia_fasd'.
warning: no files found matching '*.sql3' under directory 'bob'
Got bob.db.casia-fasd 2.0.6.

But there is no equivalent message for bob.db.replay

Amir Mohammadi

unread,
May 2, 2017, 8:22:41 AM5/2/17
to bob-devel
Hi,

Could you try to use antispoofing.motion from the latest commit?
https://gitlab.idiap.ch/bob/antispoofing.motion

Thanks,
Amir

Ailbhe Cullen

unread,
May 2, 2017, 9:54:00 AM5/2/17
to bob-devel
Hi Amir,

I'm really sorry, it's still giving me the same error.

The package comes from an old paper. Do you think it would help to try a new conda environment with an older version of bob?

Thanks
Ailbhe

Amir Mohammadi

unread,
May 2, 2017, 10:30:20 AM5/2/17
to bob-devel
Hi Ailbhe,

antispoofing.* packages are deprecated and no longer supported.
Your problem is that you have bob.db.replay==3 which is a new version and does not support antispooing packages anymore.
What you can do is this:

pip uninstall bob.db.replay
conda install --force bob.extension bob.db.base # to get the files deleted by pip back
pip install bob.db.replay==2

When you do that, you'll see replay an option:

bin/motion_framediff.py --help    
usage: motion_framediff.py [-h] [-e] [-m PIXELS] [--bbx]
                           [DIR] [DIR] {casia_fasd,replay,all} ...

Calculates the normalized frame differences for face and background, for all
input videos. This technique is described on the paper: Counter-Measures to
Photo Attacks in Face Recognition: a public database and a baseline, Anjos &
Marcel, IJCB'11.

positional arguments:
  DIR                   Base directory containing the videos to be treated by
                        this procedure (defaults to
                        "/home/amir/antispoofing.motion/database")
  DIR                   Base output directory for every file created by this
                        procedure defaults to
                        "/home/amir/antispoofing.motion/framediff")

optional arguments:
  -h, --help            show this help message and exit
  -e, --enrollment      If True, will do the processing of the enrollment data
                        of the database (defaults to "False")
  -m PIXELS, --mininum-face-size PIXELS
                        Minimum face size to be considered when pre-processing
                        and extrapolating detections (defaults to 0)
  --bbx, --boundingbox  If True, will read the face locations using the bbx
                        function of the File class of the database. If False,
                        will use faceloc.read_face utility to read the
                        faceloc. For MSU-MFSD only (defaults to "False")

Databases:
  choose one of the following databases to run this script with:

  {casia_fasd,replay,all}
                        Available databases
    casia_fasd          CASIA Face Anti-Spoofing database (FASD)
    replay              Anti-Spoofing database with 1300 videos produced at
                        Idiap, Switzerland
    all                 Fusion with all antispoofing databases available in


Let me know if this works.

Best,
Amir

Ailbhe Cullen

unread,
May 2, 2017, 11:29:21 AM5/2/17
to bob-devel
Hi Amir,

That worked, thanks!

I'm now getting a new error:

Traceback (most recent call last):
  File "bin/calclbp.py", line 26, in <module>
    sys.exit(antispoofing.lbp.script.calclbp.main())
  File "/home/cullena/bobScripts/antispoofing.lbp/antispoofing/lbp/script/calclbp.py", line 114, in main
    obj.save(data.reshape([1,data.size]), directory = args.directory, extension='.hdf5')
  File "/home/cullena/miniconda2/envs/bob262_py27/lib/python2.7/site-packages/bob/db/replay/spoofing.py", line 42, in save
    return self.__f.save(data, directory=directory, extension=extension)
  File "/home/cullena/miniconda2/envs/bob262_py27/lib/python2.7/site-packages/bob/db/replay/models.py", line 205, in save
    bob.db.base.utils.makedirs_safe(os.path.dirname(path))

Is it possible that I need to revert to an older version of bob.bd.base too?

Thanks,
Ailbhe

Ailbhe Cullen

unread,
May 3, 2017, 4:21:50 AM5/3/17
to bob-devel
Never mind, fixed it by replacing all instances of

obj.save(data, args.outputdir, '.hdf5')

with
    fname = obj.make_path(directory=args.outputdir, extension='.hdf5')
    bob.io.base.save(data,fname)

Thanks for all your help!
Reply all
Reply to author
Forward
0 new messages