Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 17, 2024
1 parent 87fd385 commit 7f0ab5b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 4 additions & 2 deletions perception_dataset/deepen/deepen_to_t4_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import re
import shutil
from typing import Any, Dict, List, Optional, Union
import yaml

from nuscenes.nuscenes import NuScenes
import yaml

from perception_dataset.abstract_converter import AbstractConverter
from perception_dataset.deepen.deepen_annotation import (
Expand Down Expand Up @@ -118,7 +118,9 @@ def convert(self):
output_dir = osp.join(self._output_base, t4data_name, self._t4_dataset_dir_name)
input_dir = osp.join(self._input_base, t4data_name)

annotation_files_generator = AnnotationFilesGenerator(description=self._description, surface_categories=self._surface_categories)
annotation_files_generator = AnnotationFilesGenerator(
description=self._description, surface_categories=self._surface_categories
)
annotation_files_generator.convert_one_scene(
input_dir=input_dir,
output_dir=output_dir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@ def _format_fastlabel_annotation(self, annotations: Dict[str, List[Dict[str, Any
"sensor_id": self._camera2idx[camera],
}
)
if self._label_converter.is_object_label(category_label) and category_label not in self._surface_categories:
if (
self._label_converter.is_object_label(category_label)
and category_label not in self._surface_categories
):
label_t4_dict["two_d_box"] = _convert_polygon_to_bbox(
a["points"][0][0]
)
Expand Down
7 changes: 6 additions & 1 deletion perception_dataset/t4_dataset/annotation_files_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@


class AnnotationFilesGenerator:
def __init__(self, with_camera: bool = True, description: Dict[str, Dict[str, str]] = {}, surface_categories: List[str] = []):
def __init__(
self,
with_camera: bool = True,
description: Dict[str, Dict[str, str]] = {},
surface_categories: List[str] = [],
):
# TODO(yukke42): remove the hard coded attribute description
self._attribute_table = AttributeTable(
name_to_description={},
Expand Down

0 comments on commit 7f0ab5b

Please sign in to comment.