From owner-svn-ports-head@freebsd.org Fri Sep 25 09:04:12 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A97E33EFFB5; Fri, 25 Sep 2020 09:04:12 +0000 (UTC) (envelope-from ehaupt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ByQvc44J3z4s88; Fri, 25 Sep 2020 09:04:12 +0000 (UTC) (envelope-from ehaupt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5501010CEE; Fri, 25 Sep 2020 09:04:12 +0000 (UTC) (envelope-from ehaupt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08P94CT8052649; Fri, 25 Sep 2020 09:04:12 GMT (envelope-from ehaupt@FreeBSD.org) Received: (from ehaupt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08P94B9h052647; Fri, 25 Sep 2020 09:04:11 GMT (envelope-from ehaupt@FreeBSD.org) Message-Id: <202009250904.08P94B9h052647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ehaupt set sender to ehaupt@FreeBSD.org using -f From: Emanuel Haupt Date: Fri, 25 Sep 2020 09:04:11 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r550003 - in head/graphics/facedetect: . files X-SVN-Group: ports-head X-SVN-Commit-Author: ehaupt X-SVN-Commit-Paths: in head/graphics/facedetect: . files X-SVN-Commit-Revision: 550003 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2020 09:04:12 -0000 Author: ehaupt Date: Fri Sep 25 09:04:11 2020 New Revision: 550003 URL: https://svnweb.freebsd.org/changeset/ports/550003 Log: - Provide a patch to work with python 3.6+ - Drop python 2.x support - Pacify portlint/portclippy PR: 249692 (based on) Submitted by: swills Modified: head/graphics/facedetect/Makefile head/graphics/facedetect/files/patch-facedetect Modified: head/graphics/facedetect/Makefile ============================================================================== --- head/graphics/facedetect/Makefile Fri Sep 25 08:52:04 2020 (r550002) +++ head/graphics/facedetect/Makefile Fri Sep 25 09:04:11 2020 (r550003) @@ -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: Modified: head/graphics/facedetect/files/patch-facedetect ============================================================================== --- head/graphics/facedetect/files/patch-facedetect Fri Sep 25 08:52:04 2020 (r550002) +++ head/graphics/facedetect/files/patch-facedetect Fri Sep 25 09:04:11 2020 (r550003) @@ -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" + # 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: