Skip to content

Commit bbcd77f

Browse files
Waymo ResearchYuning Chai
authored andcommitted
Merged commit includes the following changes:
374584039 by Waymo Research: Internal fixes. -- 374581701 by Waymo Research: Improve comments. -- 374551331 by Waymo Research: Improve comments in colab. -- PiperOrigin-RevId: 374584039
1 parent 1f75252 commit bbcd77f

File tree

5 files changed

+28
-63
lines changed

5 files changed

+28
-63
lines changed

tutorial/BUILD

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ py_binary(
2929
deps = [
3030
"//waymo_open_dataset:dataset_proto_py_pb2",
3131
"//waymo_open_dataset:label_proto_py_pb2",
32-
"//waymo_open_dataset/metrics/ops:gen_metrics_ops",
33-
"//waymo_open_dataset/metrics/ops:motion_metrics_ops",
3432
"//waymo_open_dataset/metrics/ops:py_metrics_ops",
3533
"//waymo_open_dataset/metrics/python:config_util_py",
3634
"//waymo_open_dataset/protos:breakdown_proto_py_pb2",

tutorial/tutorial_motion.ipynb

Lines changed: 7 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,8 @@
4444
},
4545
{
4646
"cell_type": "code",
47-
"execution_count": 1,
47+
"execution_count": null,
4848
"metadata": {
49-
"executionInfo": {
50-
"elapsed": 401,
51-
"status": "ok",
52-
"timestamp": 1620951571164,
53-
"user": {
54-
"displayName": "",
55-
"photoUrl": "",
56-
"userId": ""
57-
},
58-
"user_tz": 420
59-
},
6049
"id": "xdEcN6WilcBn"
6150
},
6251
"outputs": [],
@@ -72,19 +61,8 @@
7261
},
7362
{
7463
"cell_type": "code",
75-
"execution_count": 2,
64+
"execution_count": null,
7665
"metadata": {
77-
"executionInfo": {
78-
"elapsed": 2591,
79-
"status": "ok",
80-
"timestamp": 1620951573762,
81-
"user": {
82-
"displayName": "",
83-
"photoUrl": "",
84-
"userId": ""
85-
},
86-
"user_tz": 420
87-
},
8866
"id": "M5gzSlBTlTiS"
8967
},
9068
"outputs": [],
@@ -255,19 +233,8 @@
255233
},
256234
{
257235
"cell_type": "code",
258-
"execution_count": 3,
236+
"execution_count": null,
259237
"metadata": {
260-
"executionInfo": {
261-
"elapsed": 81,
262-
"status": "ok",
263-
"timestamp": 1620951573865,
264-
"user": {
265-
"displayName": "",
266-
"photoUrl": "",
267-
"userId": ""
268-
},
269-
"user_tz": 420
270-
},
271238
"id": "TpEZq1EMtXV9"
272239
},
273240
"outputs": [],
@@ -288,19 +255,8 @@
288255
},
289256
{
290257
"cell_type": "code",
291-
"execution_count": 7,
258+
"execution_count": null,
292259
"metadata": {
293-
"executionInfo": {
294-
"elapsed": 6331,
295-
"status": "ok",
296-
"timestamp": 1620939490073,
297-
"user": {
298-
"displayName": "",
299-
"photoUrl": "",
300-
"userId": ""
301-
},
302-
"user_tz": 420
303-
},
304260
"id": "utTE9Mtgx3Fq"
305261
},
306262
"outputs": [],
@@ -722,6 +678,7 @@
722678
"\n",
723679
" def result(self):\n",
724680
" # [batch_size, num_preds, 1, 1, steps, 2].\n",
681+
" # The ones indicate top_k = 1, num_agents_per_joint_prediction = 1.\n",
725682
" prediction_trajectory = tf.concat(self._prediction_trajectory, 0)\n",
726683
" # [batch_size, num_preds, 1].\n",
727684
" prediction_score = tf.concat(self._prediction_score, 0)\n",
@@ -793,7 +750,8 @@
793750
" optimizer.apply_gradients(zip(grads, model.trainable_weights))\n",
794751
"\n",
795752
" # [batch_size, num_agents, steps, 2] -\u003e\n",
796-
" # [batch_size, num_agents, 1, 1, steps, 2]\n",
753+
" # [batch_size, num_agents, 1, 1, steps, 2].\n",
754+
" # The added dimensions are top_k = 1, num_agents_per_joint_prediction = 1.\n",
797755
" pred_trajectory = pred_trajectory[:, :, tf.newaxis, tf.newaxis]\n",
798756
"\n",
799757
" # Fake the score since this model does not generate any score per predicted\n",

waymo_open_dataset/latency/compare_objects_file_to_submission_main.cc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ limitations under the License.
2020
#include <iostream>
2121
#include <memory>
2222
#include <numeric>
23-
#include <vector>
2423
#include <tuple>
24+
#include <vector>
2525

26-
#include "base/init_google.h"
2726
#include <glog/logging.h>
2827
#include "absl/flags/flag.h"
2928
#include "absl/flags/parse.h"
@@ -207,12 +206,11 @@ int Compute(const std::string& latency_result_filename,
207206
}
208207

209208
if (unmatched_detections > 0.05 * num_detections) {
210-
LOG(ERROR).NoPrefix()
211-
<< "Latency evaluator results did not match submission "
212-
<< "proto for " << print_key(example_key) << std::endl
213-
<< unmatched_detections << " detections out of " << num_detections
214-
<< " did not match. This exceeds our "
215-
<< "cut-off of 5% of detections being unmatched.";
209+
LOG(FATAL) << "Latency evaluator results did not match submission "
210+
<< "proto for " << print_key(example_key) << std::endl
211+
<< unmatched_detections << " detections out of "
212+
<< num_detections << " did not match. This exceeds our "
213+
<< "cut-off of 5% of detections being unmatched.";
216214
return 1;
217215
}
218216

@@ -228,7 +226,6 @@ int Compute(const std::string& latency_result_filename,
228226
} // namespace waymo
229227

230228
int main(int argc, char* argv[]) {
231-
InitGoogle(argv[0], &argc, &argv, false);
232229
absl::ParseCommandLine(argc, argv);
233230

234231
const std::string latency_result_filename =

waymo_open_dataset/metrics/ops/metrics_ops.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,23 @@ REGISTER_OP("MotionMetrics")
103103
Computes motion metrics.
104104
105105
- Notations:
106-
- B: batch size. Each batch should contain 1 scenario.
106+
- B: batch size. Each batch should contain exactly 1 scenario.
107107
- M: Number of joint prediction groups to predict per scenario.
108+
- K: top_K predictions per joint prediction.
108109
- N: number of agents in a joint prediction. 1 if mutual independence is
109110
assumed between agents.
110-
- K: top_K predictions per joint prediction.
111111
- A: number of agents in the groundtruth.
112112
- TP: number of steps to evaluate on. Matches len(config.step_measurement).
113113
- TG: number of steps in the groundtruth track. Matches
114114
config.track_history_samples + 1 + config.future_history_samples.
115115
- BR: number of breakdowns.
116116
117+
For the marginal (mutually-independent) prediction, M is the number of agents to
118+
predict for, N is 1.
119+
120+
For joint predictions of multiple agents, M is the number of joint predictions,
121+
and N is the number of agents per joint prediction.
122+
117123
prediction_trajectory: [B, M, K, N, TP, 2]. Predicted trajectories.
118124
The inner-most dimensions are [x, y].
119125
prediction_score: [B, M, K]. Scores per joint prediction.

waymo_open_dataset/metrics/ops/utils.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,20 @@ ParseObjectGroupedBySequenceFromTensors(
8787
//
8888
// - B: batch size. Each batch should contain 1 scenario.
8989
// - M: Number of joint prediction groups to predict per scenario.
90+
// - K: top_K predictions per joint prediction.
9091
// - N: number of agents in a joint prediction. 1 if mutual independence is
9192
// assumed between agents.
92-
// - K: top_K predictions per joint prediction.
9393
// - A: number of agents in the groundtruth.
9494
// - TP: number of steps to evaluate on. Matches len(config.step_measurement).
9595
// - TG: number of steps in the groundtruth track. Matches
9696
// config.track_history_samples + 1 + config.future_history_samples.
9797
//
98+
// For the marginal (mutually-independent) prediction, M is the number of agents
99+
// to predict for, N is 1.
100+
//
101+
// For joint predictions of multiple agents, M is the number of joint
102+
// predictions, and N is the number of agents per joint prediction.
103+
//
98104
// pred_trajectory: [B, M, K, N, TP, 2]. Predicted trajectories.
99105
// The inner-most dimensions are [x, y].
100106
// pred_score: [B, M, K]. Scores per joint prediction.

0 commit comments

Comments
 (0)