VizUtils.quickDisplayOrtho("MainWindow", points, StandardBody.standardColors) def visualizeFrame(rgb): #First, resize to 512 x 424 resized = cv2.resize(rgb, (424, 512)) cv2.imshow("Frame", resized) cv2.waitKey(10) sequenceRoot = sys.argv[1] rootDirector = RootDirector(sequenceRoot) for recordingName in rootDirector.getPeopleRecordingNames(): recordingPath = os.path.join(rootDirector.getDirectoryPath(), recordingName) #Look inside the autoLabels path there autoLabelsPath = os.path.join(recordingPath, "autoLabels") recordingZeroCamPath = os.path.join(recordingPath, "0") frameManager = FrameManager(recordingZeroCamPath) subs = os.listdir(autoLabelsPath) subs.sort() for sub in subs: full = os.path.join(autoLabelsPath, sub) labelReader = AutoLabelReader(full) N = labelReader.getNumLabels() for i in range(N): points = labelReader.getLabel(i) timestamp = labelReader.getTimestamp(i) while (frameManager.getViewTime() < timestamp): frameManager.tryAdvance(1) visualizeFrame(frameManager.getFrame().getRGB()) visualizePoints(points)
sequenceRootRoot = sys.argv[1] emptySequenceDirs = [ y for x in os.walk(sequenceRootRoot) for y in glob(os.path.join(x[0], '*empty*/')) ] cameraLabels = ["0", "1", "2"] rgbFrames = [] for sequenceDir in emptySequenceDirs: for cam in cameraLabels: fullPath = os.path.join(sequenceDir, cam) if (os.path.isdir(fullPath)): frameManager = FrameManager(fullPath) LIMIT = 20 i = 0 while True: frame = frameManager.getFrame() #Great -- take all of the i += 1 if (i == LIMIT): rgbFrames.append(frame.getRGB()) break advanced = frameManager.tryAdvance(1) if (not advanced): break rgbFrames = np.reshape(np.array(rgbFrames), (-1, 3)).astype(np.float32) / 255.0 NUM_TO_PLOT = 5000 rgbFrames = randomRows(rgbFrames, NUM_TO_PLOT)