| 19 | |
| 20 | |
| 21 | class FeatureExtractor(ABC): |
| 22 | @property |
| 23 | @abstractmethod |
| 24 | def supports_predictions(self) -> bool: |
| 25 | pass |
| 26 | |
| 27 | @property |
| 28 | @abstractmethod |
| 29 | def feature_dim(self) -> int: |
| 30 | pass |
| 31 | |
| 32 | @property |
| 33 | @abstractmethod |
| 34 | def num_classes(self) -> int: |
| 35 | pass |
| 36 | |
| 37 | @abstractmethod |
| 38 | def features_and_preds(self, streamer: NpzStreamer) -> Tuple[np.ndarray, np.ndarray]: |
| 39 | """ |
| 40 | For a stream of point cloud batches, compute feature vectors and class |
| 41 | predictions. |
| 42 | |
| 43 | :param point_clouds: a streamer for a sample batch. Typically, arr_0 |
| 44 | will contain the XYZ coordinates. |
| 45 | :return: a tuple (features, predictions) |
| 46 | - features: a [B x feature_dim] array of feature vectors. |
| 47 | - predictions: a [B x num_classes] array of probabilities. |
| 48 | """ |
| 49 | |
| 50 | |
| 51 | class PointNetClassifier(FeatureExtractor): |
nothing calls this directly
no outgoing calls
no test coverage detected