...
 
Commits (10)
facedetect (0.1-2) unstable; urgency=medium
* Use 2to3 to convert to Python3
* s/python/python3/ in (Build-)Depends
* Add dh-python to Build-Depends
* Standards-Version: 4.1.3
* Point Vcs fields to salsa.debian.org
* Add example images
* debhelper 11
* Add autopkgtest
-- Andreas Tille <tille@debian.org> Fri, 06 Apr 2018 11:22:48 +0200
facedetect (0.1-1) unstable; urgency=medium
* New upstream version
......
......@@ -3,19 +3,21 @@ Maintainer: Debian PhotoTools Maintainers <pkg-phototools-devel@lists.alioth.deb
Uploaders: Andreas Tille <tille@debian.org>
Section: graphics
Priority: optional
Build-Depends: debhelper (>= 10),
python-all-dev
Standards-Version: 3.9.8
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-phototools/facedetect.git
Vcs-Git: https://anonscm.debian.org/git/pkg-phototools/facedetect.git
Build-Depends: debhelper (>= 11~),
dh-python,
python3-all-dev
Standards-Version: 4.1.3
Vcs-Browser: https://salsa.debian.org/debian-phototools-team/facedetect
Vcs-Git: https://salsa.debian.org/debian-phototools-team/facedetect.git
Homepage: https://www.thregr.org/~wavexx/software/facedetect/
Package: facedetect
Architecture: any
Depends: ${misc:Depends},
${python:Depends},
${python3:Depends},
libopencv-dev,
python-opencv
python3,
python3-opencv
Recommends: imagemagick
Description: simple face detector for batch processing
Facedetect is a simple face detector for batch processing. It answers
......
debian/images_with_faces
debian/sampleimages/*.jpg
Description: Use 2to3 to convert to Python3
Author: Andreas Tille <tille@debian.org>
Last-Update: Fri, 06 Apr 2018 10:00:20 +0200
--- a/facedetect
+++ b/facedetect
@@ -1,8 +1,8 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# facedetect: a simple face detector for batch processing
# Copyright(c) 2013-2016 by wave++ "Yuri D'Elia" <wavexx@thregr.org>
# Distributed under GPLv2+ (see COPYING) WITHOUT ANY WARRANTY.
-from __future__ import print_function, division
+
import argparse
import numpy as np
@@ -58,7 +58,7 @@ def fatal(msg):
def load_cascades(data_dir):
- for k, v in PROFILES.iteritems():
+ for k, v in PROFILES.items():
v = os.path.join(data_dir, v)
try:
if not os.path.exists(v):
@@ -117,7 +117,7 @@ def rank(im, rects):
eN = s['eN'] = s['e'] / eMax
f = s['f'] = eN * 0.7 + (1 - s['d']) * 0.1 + sN * 0.2
- ranks = range(len(scores))
+ ranks = list(range(len(scores)))
ranks = sorted(ranks, reverse=True, key=lambda x: scores[x]['f'])
for i in range(len(scores)):
scores[ranks[i]]['RANK'] = i
@@ -258,7 +258,7 @@ def __main__():
if args.debug:
lines = []
- for k, v in scores[i].iteritems():
+ for k, v in scores[i].items():
lines.append("{}: {}".format(k, v))
h = rect[1] + rect[3] + fontHeight
for line in lines:
......@@ -5,5 +5,5 @@
#export DH_VERBOSE=1
%:
dh $@ --with python2
dh $@ --with python3
These images can be obtained by
wget https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/mpl-data/sample_data/grace_hopper.jpg
wget https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/IceBlockNearJoekullsarlon.jpg/640px-IceBlockNearJoekullsarlon.jpg
debian/sampleimages/640px-IceBlockNearJoekullsarlon.jpg
debian/sampleimages/grace_hopper_512x512.jpg
Tests: run-unit-test
Depends: @
Restrictions: allow-stderr
#!/bin/sh -e
if [ `for img in /usr/share/doc/facedetect/examples/*.jpg ; do if [ "$(facedetect $img 2>/dev/null)" != "" ] ; then echo $img ; fi ; done` = "/usr/share/doc/facedetect/examples/grace_hopper_512x512.jpg" ] ; then
echo "Test passed"
else
echo "Test failed"
exit 1
fi