print() is a function in Python 3

This commit is contained in:
cclauss
2018-05-03 07:12:12 +02:00
parent 60e5e213fd
commit 05c1a3d160
12 changed files with 91 additions and 79 deletions

View File

@@ -1,3 +1,4 @@
from __future__ import print_function
import cv2 as cv
import numpy as np
import argparse
@@ -43,7 +44,7 @@ while cv.waitKey(1) < 0:
t, _ = net.getPerfProfile()
freq = cv.getTickFrequency() / 1000
print t / freq, 'ms'
print(t / freq, 'ms')
if args.median_filter:
out = cv.medianBlur(out, args.median_filter)

View File

@@ -1,3 +1,4 @@
from __future__ import print_function
# Script to evaluate MobileNet-SSD object detection model trained in TensorFlow
# using both TensorFlow and OpenCV. Example:
#
@@ -115,14 +116,14 @@ pylab.rcParams['figure.figsize'] = (10.0, 8.0)
annType = ['segm','bbox','keypoints']
annType = annType[1] #specify type here
prefix = 'person_keypoints' if annType=='keypoints' else 'instances'
print 'Running demo for *%s* results.'%(annType)
print('Running demo for *%s* results.'%(annType))
#initialize COCO ground truth api
cocoGt=COCO(args.annotations)
#initialize COCO detections api
for resFile in ['tf_result.json', 'cv_result.json']:
print resFile
print(resFile)
cocoDt=cocoGt.loadRes(resFile)
cocoEval = COCOeval(cocoGt,cocoDt,annType)