comparison trafficintelligence/moving.py @ 1226:d478d3122804

change of bicycle to cyclist
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 12 Jul 2023 12:12:37 -0400
parents 69b531c7a061
children 5654c9173548
comparison
equal deleted inserted replaced
1225:202073959fb4 1226:d478d3122804
1374 'cyclist', 1374 'cyclist',
1375 'bus', 1375 'bus',
1376 'truck', 1376 'truck',
1377 'automated'] 1377 'automated']
1378 1378
1379 coco2UserTypes = {0: 2, 1: 4, 2: 1, 5: 5, 7: 6} 1379 coco2Types = {0: 2, 1: 4, 2: 1, 5: 5, 7: 6}
1380 cocoUserTypeNames = {0: 'person', 1380 cocoTypeNames = {0: 'person',
1381 1: 'bicycle', 1381 1: 'bicycle',
1382 2: 'car', 1382 2: 'car',
1383 3: 'motorcycle', 1383 3: 'motorcycle',
1384 5: 'bus', 1384 5: 'bus',
1385 6: 'train', 1385 6: 'train',
2071 for t in self.getTimeInterval(): 2071 for t in self.getTimeInterval():
2072 if t not in self.userTypes: 2072 if t not in self.userTypes:
2073 self.classifyUserTypeHoGSVMAtInstant(images[t], t, homography, width, height, px, py, minNPixels, rescaleSize, orientations, pixelsPerCell, cellsPerBlock) 2073 self.classifyUserTypeHoGSVMAtInstant(images[t], t, homography, width, height, px, py, minNPixels, rescaleSize, orientations, pixelsPerCell, cellsPerBlock)
2074 # compute P(Speed|Class) 2074 # compute P(Speed|Class)
2075 if speedProbabilities is None or self.aggregatedSpeed < minSpeedEquiprobable: # equiprobable information from speed 2075 if speedProbabilities is None or self.aggregatedSpeed < minSpeedEquiprobable: # equiprobable information from speed
2076 userTypeProbabilities = {userType2Num['car']: 1., userType2Num['pedestrian']: 1., userType2Num['bicycle']: 1.} 2076 userTypeProbabilities = {userType2Num['car']: 1., userType2Num['pedestrian']: 1., userType2Num['cyclist']: 1.}
2077 else: 2077 else:
2078 userTypeProbabilities = {userType2Num[userTypename]: speedProbabilities[userTypename](self.aggregatedSpeed) for userTypename in speedProbabilities} 2078 userTypeProbabilities = {userType2Num[userTypename]: speedProbabilities[userTypename](self.aggregatedSpeed) for userTypename in speedProbabilities}
2079 # compute P(Class|Appearance) 2079 # compute P(Class|Appearance)
2080 nInstantsUserType = {userTypeNum: 0 for userTypeNum in userTypeProbabilities}# number of instants the object is classified as userTypename 2080 nInstantsUserType = {userTypeNum: 0 for userTypeNum in userTypeProbabilities}# number of instants the object is classified as userTypename
2081 nInstantsUserType[userType2Num['unknown']] = 0 2081 nInstantsUserType[userType2Num['unknown']] = 0