Mercurial Hosting > traffic-intelligence
changeset 1226:d478d3122804
change of bicycle to cyclist
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 12 Jul 2023 12:12:37 -0400 |
parents | 202073959fb4 |
children | 5654c9173548 |
files | scripts/classify-objects.py scripts/manual-video-analysis.py scripts/polytracktopdtv.py scripts/train-object-classification.py trafficintelligence/moving.py |
diffstat | 5 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/classify-objects.py Mon Jul 03 10:33:20 2023 -0400 +++ b/scripts/classify-objects.py Wed Jul 12 12:12:37 2023 -0400 @@ -39,7 +39,7 @@ bicLogNorm = lognorm(classifierParams.scaleCyclistSpeed, loc = 0., scale = np.exp(classifierParams.locationCyclistSpeed)) speedProbabilities = {'car': lambda s: carNorm.pdf(s), 'pedestrian': lambda s: pedNorm.pdf(s), - 'bicycle': lambda s: bicLogNorm.pdf(s)} + 'cyclist': lambda s: bicLogNorm.pdf(s)} if args.plotSpeedDistribution: import matplotlib.pyplot as plt
--- a/scripts/manual-video-analysis.py Mon Jul 03 10:33:20 2023 -0400 +++ b/scripts/manual-video-analysis.py Wed Jul 12 12:12:37 2023 -0400 @@ -29,7 +29,7 @@ 'car', 'pedestrian', 'motorcycle', - 'bicycle', + 'cyclist', 'bus', 'truck'] class UserConfiguration(object):
--- a/scripts/polytracktopdtv.py Mon Jul 03 10:33:20 2023 -0400 +++ b/scripts/polytracktopdtv.py Wed Jul 12 12:12:37 2023 -0400 @@ -25,7 +25,7 @@ "1" -> "car" "2" -> "pedestrians" "3" -> "motorcycle" - "4" -> "bicycle" + "4" -> "cyclist" "5" -> "bus" "6" -> "truck" ... and other type if the objects_type table is defined in SQLite''' @@ -38,7 +38,7 @@ typeDict["1"] = "car" typeDict["2"] = "pedestrians" typeDict["3"] = "motorcycle" - typeDict["4"] = "bicycle" + typeDict["4"] = "cyclist" typeDict["5"] = "bus" typeDict["6"] = "truck"
--- a/scripts/train-object-classification.py Mon Jul 03 10:33:20 2023 -0400 +++ b/scripts/train-object-classification.py Wed Jul 12 12:12:37 2023 -0400 @@ -23,7 +23,7 @@ classifierParams = storage.ClassifierParameters(args.configFilename) imageDirectories = {'pedestrian': args.directoryName + "/Pedestrians/", - 'bicycle': args.directoryName + "/Cyclists/", + 'cyclist': args.directoryName + "/Cyclists/", 'car': args.directoryName + "/Vehicles/"} trainingSamplesPBV = {} @@ -43,7 +43,7 @@ trainingSamplesBV[k], trainingLabelsBV[k] = trainingSamples, trainingLabels if k != 'car': trainingSamplesPB[k], trainingLabelsPB[k] = trainingSamples, trainingLabels - if k != 'bicycle': + if k != 'cyclist': trainingSamplesPV[k], trainingLabelsPV[k] = trainingSamples, trainingLabels # Training the Support Vector Machine
--- a/trafficintelligence/moving.py Mon Jul 03 10:33:20 2023 -0400 +++ b/trafficintelligence/moving.py Wed Jul 12 12:12:37 2023 -0400 @@ -1376,8 +1376,8 @@ 'truck', 'automated'] -coco2UserTypes = {0: 2, 1: 4, 2: 1, 5: 5, 7: 6} -cocoUserTypeNames = {0: 'person', +coco2Types = {0: 2, 1: 4, 2: 1, 5: 5, 7: 6} +cocoTypeNames = {0: 'person', 1: 'bicycle', 2: 'car', 3: 'motorcycle', @@ -2073,7 +2073,7 @@ self.classifyUserTypeHoGSVMAtInstant(images[t], t, homography, width, height, px, py, minNPixels, rescaleSize, orientations, pixelsPerCell, cellsPerBlock) # compute P(Speed|Class) if speedProbabilities is None or self.aggregatedSpeed < minSpeedEquiprobable: # equiprobable information from speed - userTypeProbabilities = {userType2Num['car']: 1., userType2Num['pedestrian']: 1., userType2Num['bicycle']: 1.} + userTypeProbabilities = {userType2Num['car']: 1., userType2Num['pedestrian']: 1., userType2Num['cyclist']: 1.} else: userTypeProbabilities = {userType2Num[userTypename]: speedProbabilities[userTypename](self.aggregatedSpeed) for userTypename in speedProbabilities} # compute P(Class|Appearance)