-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify video_domain_adapter #292
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #292 +/- ##
==========================================
- Coverage 92.98% 91.10% -1.89%
==========================================
Files 45 45
Lines 4635 4790 +155
==========================================
+ Hits 4310 4364 +54
- Misses 325 426 +101
Continue to review full report at Codecov.
|
@@ -16,15 +16,17 @@ | |||
# Dataset | |||
# ----------------------------------------------------------------------------- | |||
_C.DATASET = CN() | |||
_C.DATASET.ROOT = "I:/Datasets/EgoAction/" # "/shared/tale2/Shared" | |||
_C.DATASET.ROOT = "J:/Datasets/EgoAction/" # "/shared/tale2/Shared" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same problem as in PR #291.
kale/loaddata/videos.py
Outdated
@@ -96,41 +126,47 @@ class VideoFrameDataset(torch.utils.data.Dataset): | |||
might be ``jumping\0052\`` or ``sample1\`` or ``00053\``. | |||
|
|||
Args: | |||
root_path: The root path in which video folders lie. | |||
root_path (str, Path): root path in which video folders lie. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Path
a Python variable type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to pathlib.Path.
kale/loaddata/videos.py
Outdated
this is ROOT_DATA from the description above. | ||
annotationfile_path: The .txt annotation file containing | ||
annotationfile_path (str, Path): .txt annotation file containing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
kale/loaddata/videos.py
Outdated
have inside of their video folders as described above. | ||
transform: Transform pipeline that receives a list of PIL images/frames. | ||
random_shift: Whether the frames from each segment should be taken | ||
transform (Compose, optional): transform pipeline that receives a list of PIL images/frames. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
torchvision.transforms.Compose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
kale/loaddata/videos.py
Outdated
image_modality (str): image modality (RGB or Optical Flow). | ||
num_segments (int): number of segments the video should be divided into to sample frames from. | ||
Default is 1 in image mode and 5 in feature vector mode. | ||
frames_per_segment (int): number of frames that should |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lines seem do not exceed 120 characters. Please check the same problems for the other.
examples/action_dann_lightn/model.py
Outdated
""" | ||
Builds and returns a model and associated hyper parameters according to the config object passed. | ||
|
||
Args: | ||
cfg: A YACS config object. | ||
dataset: A multi domain dataset consisting of source and target datasets. | ||
num_classes: The class number of specific dataset. | ||
dict_num_classes (dict): The dictionary of class number for specific dataset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better to implement this as a class (e.g., https://github.com/pykale/pykale/blob/main/kale/pipeline/domain_adapter.py#L81). We can discuss if you need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A function returning boolean variables is used to control image_modality and class_type. A class may be a better choice, but I have no idea about this. We can talk.
n_verb_channel=256, | ||
n_noun_channel=512, | ||
dropout_keep_prob=0.5, | ||
class_type="verb", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to my comments above, we can implement the a class for the type of classes.
This pull request has been automatically marked as stale due to lack of activity. |
Description
Improve video_domain_adapter.py via organizing repeated and redundant codes into BaseAdaptTrainerVideo. This PR follows PR #291 and is followed by a large PR that will merge feature vector into action_dann_lightn example.
Status
Ready
Types of changes
docs
manually updated for new API.