def load_lidar_tile(self, normalize=True): '''Load a point cloud into memory from file ''' self.lidar_filepath = self.fetch_lidar_filename() if self.lidar_filepath == None: print("Lidar file {} cannot be found".format(self.row["tile"])) return None self.lidar_tile = Lidar.load_lidar(self.lidar_filepath, normalize) return self.lidar_tile
draw_caption(draw, b, caption) #only pass score threshold boxes quality_boxes = [] for box, score, label in zip(boxes[0], scores[0], labels[0]): quality_boxes.append(box) # scores are sorted so we can break if score < args.score_threshold: break #drape boxes #get image name and load point cloud image_name = os.path.splitext(os.path.basename(image_path))[0] point_cloud_filename = os.path.join(DeepForest_config["lidar_path"] + image_name) + ".laz" pc = Lidar.load_lidar(point_cloud_filename) pc = postprocessing.drape_boxes(boxes=quality_boxes, pc=pc) #Skip if point density is too low if pc: #Get new bounding boxes new_boxes = postprocessing.cloud_to_box(pc) #expends 3dim new_boxes = np.expand_dims(new_boxes, 0) # visualize detections for box, score, label in zip(new_boxes[0], scores[0], labels[0]): # scores are sorted so we can break if score < args.score_threshold: break