Open marijnl opened 2 years ago
Hi @marijnl. Subclassing Sample
is not possible at moment. Defining functions that operate on a Sample
is enough in on our experience.
import fiftyone on as of
dataset = fo.Dataset()
sample = fo.Sample(filepath="image.png")
dataset.add_sample(sample)
def my_method(sample):
pass
for sample in dataset:
my_method(sample)
My own interpretation of Sample
is something similar to a dataclass
which functions can operate on (not class/instance methods).
Perhaps this feature could be added if there is community support for it. So I will defer to community feedback for the time being. If users want OOP Sample
s that they can define, we will listen. But this is a large consideration.
Im trying to sublcass fo.Sample such that during evaluation i can put some custom logic on top Can someone help me out here?
My non-working attempt: