Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Uniformize Flash API to TorchVision / TorchVideo #218

Closed
tchaton opened this issue Apr 16, 2021 · 1 comment · Fixed by #256
Closed

Uniformize Flash API to TorchVision / TorchVideo #218

tchaton opened this issue Apr 16, 2021 · 1 comment · Fixed by #256
Assignees
Labels
enhancement New feature or request

Comments

@tchaton
Copy link
Contributor

tchaton commented Apr 16, 2021

There's several formats of data we support:

  1. loading encoded video paths from csv with format: "path_name, label" (PySlowFast repo uses this)
  2. loading encoded video paths from directory structure as in comment (TorchVision uses this)
  3. loading frame videos (i.e. a folder of images) from directory structure
  4. loading frame videos from csv with a format specific to the dataset (e.g. EpicKitchen and DomSev datasets use this)

Originally posted by @tullie in #216 (comment)

@tchaton tchaton changed the title There's several formats of data we support: Uniformize Flash API to TorchVision / TorchVideo Apr 16, 2021
@tchaton tchaton self-assigned this Apr 16, 2021
@tchaton tchaton mentioned this issue Apr 16, 2021
8 tasks
@tchaton
Copy link
Contributor Author

tchaton commented Apr 16, 2021

DataModule
    from_paths(
        cls,
        train_data_path,
        val_data_path,
        test_data_path,
        predict_data_path,
        extensions: Optional[List[str]] = None
        data_col: str = None,
        csv_parser=LabeledDataPaths
    )
        return LabeledDataPaths([(path, label)])
class LabeledDataPaths:
    def label_row(self, row):
        return map_to_label(row[data_col])
    def data_row(self, row):
        return row[data_col]
    @property
    def num_classes(self):
        ...
    cls.from_paths("./train.csv", data_col="path", label_cols=["num_feat", ",,.."])
    path  sex, ...
    path_1 0, 2, 4
    path label
    path_1, [0, 1, 0, 0]
    path, label
    path_1, 0

@tchaton tchaton assigned edgarriba and unassigned tchaton Apr 16, 2021
@edgarriba edgarriba linked a pull request May 3, 2021 that will close this issue
8 tasks
@edgarriba edgarriba added the enhancement New feature or request label May 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants