Skip to content

Commit

Permalink
Refactor export instance video script (#541)
Browse files Browse the repository at this point in the history
* Bugfix when no out_dir is provided

* Reformatting, better error handling, change default codec

* Added type hints

* Formatting

* Address review comments

Co-authored-by: Holger Caesar <[email protected]>
  • Loading branch information
holger-motional and Holger Caesar authored Jan 11, 2021
1 parent 6e0ed36 commit c839839
Show file tree
Hide file tree
Showing 5 changed files with 298 additions and 254 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def do_inference_for_submission(helper: PredictHelper,
:param helper: Instance of PredictHelper that wraps the nuScenes test set.
:param config: Instance of PredictionConfig.
:param dataset_tokens: Tokens of instance_sample pairs in the test set.
:returns: List of predictions.
:return: List of predictions.
"""

# User: Fill in the path to the model weights here.
Expand Down
4 changes: 2 additions & 2 deletions python-sdk/nuscenes/eval/tracking/algo.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def name_gen(_threshold):
def accumulate(self) -> TrackingMetricData:
"""
Compute metrics for all recall thresholds of the current class.
:returns: TrackingMetricData instance which holds the metrics for each threshold.
:return: TrackingMetricData instance which holds the metrics for each threshold.
"""
# Init.
if self.verbose:
Expand Down Expand Up @@ -208,7 +208,7 @@ def accumulate_threshold(self, threshold: float = None) -> Tuple[pandas.DataFram
Accumulate metrics for a particular recall threshold of the current class.
The scores are only computed if threshold is set to None. This is used to infer the recall thresholds.
:param threshold: score threshold used to determine positives and negatives.
:returns: (The MOTAccumulator that stores all the hits/misses/etc, Scores for each TP).
:return: (The MOTAccumulator that stores all the hits/misses/etc, Scores for each TP).
"""
accs = []
scores = [] # The scores of the TPs. These are used to determine the recall thresholds initially.
Expand Down
2 changes: 1 addition & 1 deletion python-sdk/nuscenes/prediction/models/mtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def forward(self, image_tensor: torch.Tensor,
:param image_tensor: Tensor of images shape [batch_size, n_channels, length, width].
:param agent_state_vector: Tensor of floats representing the agent state.
[batch_size, 3].
:returns: Tensor of dimension [batch_size, number_of_modes * number_of_predictions_per_mode + number_of_modes]
:return: Tensor of dimension [batch_size, number_of_modes * number_of_predictions_per_mode + number_of_modes]
storing the predicted trajectory and mode probabilities. Mode probabilities are normalized to sum
to 1 during inference.
"""
Expand Down
Loading

0 comments on commit c839839

Please sign in to comment.