martinwholtmon / IT3920-2024-Master-MSIT

Master project for MSIT 2024 - Towards Efficient Human Action Recognition: The Role of Keyframe Selection in Video Processing
MIT License
0 stars 0 forks source link

refactor dataset to use abstract class and subclasses for VideoDataset and RawFrameDataset #79

Open martinwholtmon opened 2 months ago

martinwholtmon commented 2 months ago

Refactor the dataset so that we have a abstract class defining the dataset, and abstract from it to create the modifications for the VideoDataset and RawFrameDataset. The abstract class could be named "ClsDataset" -> ClassificationDataset.

https://github.com/martinwholtmon/IT3920-2024-Master-MSIT/blob/dev/src/har_project/data/datasets.py

Basically, both of those two files are close to equal, the only difference is in the __getitem__, load_video and the fields:

self.loader = ..
self.sampler = ..

Idealy, create a better logic so that only one method is overridden. It is fine for the fields to be set in the subclasses. Use ABC: https://www.geeksforgeeks.org/abstract-classes-in-python/