Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug of loading testset label #90

Merged
merged 3 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/av2/datasets/sensor/sensor_dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ def _build_sensor_cache(self) -> pd.DataFrame:
if self.with_cache and sensor_cache_path.exists():
logger.info("Cache found. Loading from disk ...")
sensor_cache = read_feather(sensor_cache_path)
if self.with_annotations:
sensor_cache = sensor_cache[sensor_cache.split != "test"]
else:
lidar_records = self.populate_lidar_records()
# Load camera records if enabled.
Expand Down Expand Up @@ -338,7 +340,8 @@ def __getitem__(self, idx: int) -> SynchronizedSensorData:

# Load annotations if enabled.
if self.with_annotations:
datum.annotations = self._load_annotations(split, log_id, timestamp_ns)
if split != "test":
datum.annotations = self._load_annotations(split, log_id, timestamp_ns)

# Load camera imagery if enabled.
if self.cam_names:
Expand Down
2 changes: 2 additions & 0 deletions tutorials/generate_sensor_dataset_visualizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def generate_sensor_dataset_visualizations(
for _, datum in enumerate(track(dataset, "Creating sensor tutorial videos ...")):
sweep = datum.sweep
annotations = datum.annotations
if annotations is None:
continue

timestamp_city_SE3_ego_dict = datum.timestamp_city_SE3_ego_dict
synchronized_imagery = datum.synchronized_imagery
Expand Down