Skip to content

DataPack function to Retrieve overlapped ImageAnnotation using data structure grid #888

Open
@hepengfe

Description

Is your feature request related to a problem? Please describe.
One of the main reasons for creating grid is to searching overlapped ImageAnnotation efficiently. However, the current code supports compute iou but not search overlapped ImageAnnotation.

Describe the solution you'd like

  • store a grid in the DataPack
  • store two dictionaries in the DataPack based on the grid
    • dictionary 1: key is grid cell position and value is a collection of image annotation presented at the grid cell
    • dictionary 2: key is the image annotation and value is a list of grid cell positions it's on
  • implement a function that search overlapped ImageAnnnotation given a ImageAnnnotation using the two dictionaries
grid_cells = dict2[query_ia]
image_anns = set()
for gc in grid_cells:
     for ia in dict1[gc]:
        image_anns.add(ia)

out = []
for ia in  image_anns:
     if ia.overlap(query_ia):
        out.append(ia)

return ia

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
This is a follow-up issue on #876 (comment)

Metadata

Assignees

Labels

topic: dataIssue about data loader modules and data processing relatedtopic:cv

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions