Skip to content

Commit

Permalink
refactor: update Tier4 API to avoid runtime errors for irregular data (
Browse files Browse the repository at this point in the history
…#64)

Signed-off-by: ktro2828 <[email protected]>
  • Loading branch information
ktro2828 authored Dec 4, 2024
1 parent 6c27336 commit 697a56a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions t4_devkit/tier4.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,12 @@ def __make_reverse_index__(self, verbose: bool) -> None:
record.category_name = category.name

for record in self.object_ann:
instance: Instance = self.get("instance", record.instance_token)
category: Category = self.get("category", instance.category_token)
category: Category = self.get("category", record.category_token)
record.category_name = category.name

for record in self.surface_ann:
if record.category_token == "": # NOTE: Some database contains this case
continue
category: Category = self.get("category", record.category_token)
record.category_name = category.name

Expand Down

0 comments on commit 697a56a

Please sign in to comment.