# HG changeset patch # User Nicolas Saunier # Date 1510021541 18000 # Node ID 64259b9885bf877ce718d03ca100fdf6045e10e7 # Parent ec1682ed999fe18a8d396d58c741fc3a2443e398 verbose option to print classification information (more to add) diff -r ec1682ed999f -r 64259b9885bf scripts/classify-objects.py --- a/scripts/classify-objects.py Sun Nov 05 23:45:47 2017 -0500 +++ b/scripts/classify-objects.py Mon Nov 06 21:25:41 2017 -0500 @@ -18,6 +18,7 @@ parser.add_argument('--start-frame0', dest = 'startFrame0', help = 'starts with first frame for videos with index problem where frames cannot be reached', action = 'store_true') parser.add_argument('--plot-speed-distributions', dest = 'plotSpeedDistribution', help = 'simply plots the distributions used for each user type', action = 'store_true') parser.add_argument('--max-speed-distribution-plot', dest = 'maxSpeedDistributionPlot', help = 'if plotting the user distributions, the maximum speed to display (km/h)', type = float, default = 50.) +parser.add_argument('--verbose', dest = 'verbose', help = 'verbose information', action = 'store_true') args = parser.parse_args() params, videoFilename, databaseFilename, invHomography, intrinsicCameraMatrix, distortionCoefficients, undistortedImageMultiplication, undistort, firstFrameNum = storage.processVideoArguments(args) @@ -111,6 +112,8 @@ currentObjects.remove(obj) else: obj.classifyUserTypeHoGSVMAtInstant(img, frameNum, width, height, classifierParams.percentIncreaseCrop, classifierParams.percentIncreaseCrop, classifierParams.minNPixels, classifierParams.hogRescaleSize, classifierParams.hogNOrientations, classifierParams.hogNPixelsPerCell, classifierParams.hogNCellsPerBlock, classifierParams.hogBlockNorm) + if args.verbose: + print('obj {}@{}: {}'.format(obj.getNum(), frameNum, moving.userTypeNames[obj.userTypes[frameNum]])) frameNum += 1 for obj in currentObjects: