changeset 962:64259b9885bf

verbose option to print classification information (more to add)
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 06 Nov 2017 21:25:41 -0500
parents ec1682ed999f
children 2757efeabbb4
files scripts/classify-objects.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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: