Skip to content

Commit 3d886c3

Browse files
shapovalovfacebook-github-bot
authored andcommitted
Fix: subset filter in DatasetBase implementation
Summary: In D42739669, I forgot to update the API of existing implementations of DatasetBase to take `subset_filter`. Looks like only one was missing. Reviewed By: bottler Differential Revision: D46724488 fbshipit-source-id: 13ab7a457f853278cf06955aad0cc2bab5fbcce6
1 parent 5592d25 commit 3d886c3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pytorch3d/implicitron/dataset/single_sequence_dataset.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# provide data for a single scene.
1010

1111
from dataclasses import field
12-
from typing import Iterable, Iterator, List, Optional, Tuple
12+
from typing import Iterable, Iterator, List, Optional, Sequence, Tuple
1313

1414
import numpy as np
1515
import torch
@@ -47,13 +47,12 @@ def sequence_names(self) -> Iterable[str]:
4747
def __len__(self) -> int:
4848
return len(self.poses)
4949

50-
# pyre-fixme[14]: `sequence_frames_in_order` overrides method defined in
51-
# `DatasetBase` inconsistently.
5250
def sequence_frames_in_order(
53-
self, seq_name: str
51+
self, seq_name: str, subset_filter: Optional[Sequence[str]] = None
5452
) -> Iterator[Tuple[float, int, int]]:
5553
for i in range(len(self)):
56-
yield (0.0, i, i)
54+
if subset_filter is None or self.frame_types[i] in subset_filter:
55+
yield 0.0, i, i
5756

5857
def __getitem__(self, index) -> FrameData:
5958
if index >= len(self):

0 commit comments

Comments
 (0)