blueoil
blueoil copied to clipboard
Inconvenient staticmethod in Dataset Class
In Base
dataset class, classes
, num_classes
, extend_dir
are defined as static method.
So when we want to change those method, we must duplicate Dataset Class. Sometimes this is inconvenient.
For example, It is not possible to change the class for each instance as follows.
class SomethingDataset(Base):
def __init__(self, mode):
if mode == "debug":
self.class = [
"classA", "classB"
]
else:
self.class = [
"classA", "classB", "classC", "classD", ...
]
...
Currently we must do as follows.
class SomethingDataset(Base):
...
class DebugSomethingDataset(Base):
# Reproduction of SomethingDataset