Mercurial Hosting > traffic-intelligence
comparison scripts/manual-video-analysis.py @ 891:ab3a4cb524a9
forgot frame number
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 28 Mar 2017 17:26:49 -0400 |
parents | 85bcc758ee5b |
children | 933670761a57 |
comparison
equal
deleted
inserted
replaced
890:85bcc758ee5b | 891:ab3a4cb524a9 |
---|---|
119 print('New {} {}'.format(config.name, config.userNum)) | 119 print('New {} {}'.format(config.name, config.userNum)) |
120 if args.nAttributes > 0: | 120 if args.nAttributes > 0: |
121 key2 = ord('1') | 121 key2 = ord('1') |
122 cv2.namedWindow('Input', cv2.WINDOW_NORMAL) | 122 cv2.namedWindow('Input', cv2.WINDOW_NORMAL) |
123 attributeNum = 0 | 123 attributeNum = 0 |
124 while key2 != ord('\n'): | 124 while key2 != ord('s'): |
125 attrImg = 255*np.ones((20*args.nAttributes, 20, 3)) | 125 attrImg = 255*np.ones((20*args.nAttributes, 20, 3)) |
126 for i in xrange(args.nAttributes): | 126 for i in xrange(args.nAttributes): |
127 if i == (attributeNum%args.nAttributes): | 127 if i == (attributeNum%args.nAttributes): |
128 cv2.putText(attrImg, str(config.attributes[i]), (1,20*(i+1)), cv2.FONT_HERSHEY_PLAIN, 1, (0, 0, 255)) | 128 cv2.putText(attrImg, str(config.attributes[i]), (1,20*(i+1)), cv2.FONT_HERSHEY_PLAIN, 1, (0, 0, 255)) |
129 else: | 129 else: |
135 attributeNum += 1 | 135 attributeNum += 1 |
136 cv2.destroyWindow('Input') | 136 cv2.destroyWindow('Input') |
137 elif config.isKeyAddInstant(key): | 137 elif config.isKeyAddInstant(key): |
138 config.userInstant += 1 | 138 config.userInstant += 1 |
139 print('User {} no {} at line {}'.format(config.name, config.userNum, config.userInstant)) | 139 print('User {} no {} at line {}'.format(config.name, config.userNum, config.userInstant)) |
140 out.write('{},{},{}{}\n'.format(config.userNum, config.name, config.getAttributeStr(), config.userInstant)) | 140 out.write('{},{},{}{},{}\n'.format(config.userNum, config.name, config.getAttributeStr(), config.userInstant, frameNum)) |
141 oldUserConfig = config | 141 oldUserConfig = config |
142 if key == ord('o'): | 142 if key == ord('o'): |
143 print('SKIPPED') | 143 print('SKIPPED') |
144 out.write('{},{},SKIP\n'.format(oldUserConfig.userNum, oldUserConfig.name)) | 144 out.write('{},{},SKIP\n'.format(oldUserConfig.userNum, oldUserConfig.name)) |
145 elif key == ord('d'): | 145 elif key == ord('d'): |