Skip to content

Commit fc98afd

Browse files
Waymo ResearchPei Sun
authored andcommitted
Merged commit includes the following changes:
305054377 by Waymo Research: Check fail if required info is missing the submission tool -- 304415340 by Waymo Research: Check fail if submission file does not exist. -- PiperOrigin-RevId: 305054377
1 parent 22700ee commit fc98afd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

waymo_open_dataset/metrics/tools/create_prediction_file_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def _create_pd_file_example():
2828
# The following 3 fields are used to uniquely identify a frame a prediction
2929
# is predicted at. Make sure you set them to values exactly the same as what
3030
# we provided in the raw data. Otherwise your prediction is considered as a
31-
# false positive.
31+
# false negative.
3232
o.context_name = ('context_name for the prediction. See Frame::context::name '
3333
'in dataset.proto.')
3434
# The frame timestamp for the prediction. See Frame::timestamp_micros in

waymo_open_dataset/metrics/tools/create_submission.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ void ValidateFlags() {
126126
// Read all content in a file to a string.
127127
std::string ReadFileToString(const std::string& filename) {
128128
std::ifstream s(filename.c_str());
129+
CHECK(s.is_open()) << filename << " does not exist.";
129130
const std::string content((std::istreambuf_iterator<char>(s)),
130131
std::istreambuf_iterator<char>());
131132
s.close();
@@ -159,6 +160,10 @@ void Run() {
159160
Submission submission;
160161
CHECK(google::protobuf::TextFormat::ParseFromString(submission_content, &submission))
161162
<< "Failed to parse " << submission_content;
163+
CHECK(!submission.unique_method_name().empty() &&
164+
!submission.account_name().empty())
165+
<< "unique_method_name and account_name must be set in "
166+
"--submission_filename.";
162167

163168
std::vector<Submission> submissions(absl::GetFlag(FLAGS_num_shards),
164169
submission);

0 commit comments

Comments
 (0)