(cls, bboxes, ids="")
| 47 | |
| 48 | @classmethod |
| 49 | def execute(cls, bboxes, ids="") -> io.NodeOutput: |
| 50 | # normalise to list[list[dict]] (per-frame), tolerating a single box or flat list |
| 51 | if isinstance(bboxes, dict): |
| 52 | frames = [[bboxes]] |
| 53 | elif not isinstance(bboxes, list) or not bboxes: |
| 54 | frames = [] |
| 55 | elif isinstance(bboxes[0], dict): |
| 56 | frames = [bboxes] |
| 57 | else: |
| 58 | frames = bboxes |
| 59 | |
| 60 | wanted = _parse_ids(ids) |
| 61 | if not wanted: |
| 62 | return io.NodeOutput(frames) # blank passes everything through |
| 63 | |
| 64 | out = [[f[i - 1] for i in wanted if 1 <= i <= len(f)] for f in frames] |
| 65 | return io.NodeOutput(out) |
nothing calls this directly
no test coverage detected