diff options
author | Emanuel Haupt <ehaupt@FreeBSD.org> | 2020-09-25 09:04:11 +0000 |
---|---|---|
committer | Emanuel Haupt <ehaupt@FreeBSD.org> | 2020-09-25 09:04:11 +0000 |
commit | 7daa417f413f8f2edba189237d3ba2e3407ba372 (patch) | |
tree | 1614e0604e9e8c37c66e7c0488465230e90bf206 /graphics/facedetect | |
parent | 004bb9c0f179d88ae0c7bb0f20e153cd56784eb4 (diff) | |
download | ports-7daa417f413f8f2edba189237d3ba2e3407ba372.tar.gz ports-7daa417f413f8f2edba189237d3ba2e3407ba372.zip |
- Provide a patch to work with python 3.6+
- Drop python 2.x support
- Pacify portlint/portclippy
PR: 249692 (based on)
Submitted by: swills
Notes
Notes:
svn path=/head/; revision=550003
Diffstat (limited to 'graphics/facedetect')
-rw-r--r-- | graphics/facedetect/Makefile | 11 | ||||
-rw-r--r-- | graphics/facedetect/files/patch-facedetect | 39 |
2 files changed, 44 insertions, 6 deletions
diff --git a/graphics/facedetect/Makefile b/graphics/facedetect/Makefile index 871f808c3674..2afed396b05f 100644 --- a/graphics/facedetect/Makefile +++ b/graphics/facedetect/Makefile @@ -3,8 +3,8 @@ PORTNAME= facedetect PORTVERSION= 0.1 -PORTREVISION= 4 DISTVERSIONPREFIX= v +PORTREVISION= 5 CATEGORIES= graphics MAINTAINER= ehaupt@FreeBSD.org @@ -15,14 +15,15 @@ LICENSE_FILE= ${WRKSRC}/COPYING.txt RUN_DEPENDS= ${PYTHON_SITELIBDIR}/cv2.so:graphics/py-opencv@${PY_FLAVOR} -USES= python:2.7,run shebangfix +USES= python:3.6+,run shebangfix USE_GITHUB= yes -NO_BUILD= yes -NO_ARCH= yes - GH_ACCOUNT= wavexx SHEBANG_FILES= facedetect + +NO_ARCH= yes +NO_BUILD= yes + PLIST_FILES= bin/facedetect post-patch: diff --git a/graphics/facedetect/files/patch-facedetect b/graphics/facedetect/files/patch-facedetect index f275fffaccb5..32a5c874ea54 100644 --- a/graphics/facedetect/files/patch-facedetect +++ b/graphics/facedetect/files/patch-facedetect @@ -1,5 +1,15 @@ ---- facedetect.orig 2017-07-20 10:43:10 UTC +--- facedetect.orig 2020-09-24 18:01:57 UTC +++ facedetect +@@ -2,8 +2,8 @@ + # 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 + import cv2 @@ -34,7 +34,7 @@ if 'cv' in dir(cv2): @@ -9,3 +19,30 @@ CASCADES = {} PROFILES = { +@@ -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: |