Skip to content
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

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7ccd345
update .gitignore
xianyuanliu Jan 20, 2022
d955f73
update .gitignore
xianyuanliu Jan 20, 2022
1cecdf2
change root dir
xianyuanliu Jan 22, 2022
f9d0577
add EPIC100DatasetAccess
xianyuanliu Jan 22, 2022
046ef98
change transform_kind to transform
xianyuanliu Jan 22, 2022
77f1b0f
add NUM_SEGMENTS
xianyuanliu Jan 22, 2022
8a8581b
add INPUT_TYPE
xianyuanliu Jan 22, 2022
23b0e8e
add functions in VideoDatasetAccess for feature vector input
xianyuanliu Jan 22, 2022
f993f8d
add get_class_type
xianyuanliu Jan 22, 2022
60951d4
add CLASS_TYPE
xianyuanliu Jan 22, 2022
76f3e72
change num_classes to dict_num_classes
xianyuanliu Jan 22, 2022
feaf72a
update ClassNetVideo for dual-class task
xianyuanliu Jan 22, 2022
f5bc2b7
update test
xianyuanliu Jan 22, 2022
63c5be9
Merge branch 'main' into add_feature_vector_dataloader
xianyuanliu Jan 22, 2022
f89d8fc
change output folder to tb_logs
xianyuanliu Jan 22, 2022
b845a88
add get_class_type test
xianyuanliu Jan 22, 2022
ef74b72
update test_video_access
xianyuanliu Jan 22, 2022
b43802c
update config
xianyuanliu Jan 22, 2022
ba6f5c5
test bug fixes
xianyuanliu Jan 23, 2022
bdf9cbb
add VideoFeatureRecord in Videos.py & improve doc
xianyuanliu Jan 23, 2022
3ea4678
add epic100 test & bug fixes
xianyuanliu Jan 23, 2022
1540051
test bug fixes
xianyuanliu Jan 23, 2022
de0e6cd
test bug fixes
xianyuanliu Jan 23, 2022
cf1638b
add BaseAdaptTrainerVideo
xianyuanliu Jan 23, 2022
a2b3ce8
bug fixes
xianyuanliu Jan 23, 2022
4470413
add CLASS_TYPE
xianyuanliu Jan 23, 2022
37aeaac
add conditional function for class type
xianyuanliu Jan 23, 2022
a95a185
rename to num_classes
xianyuanliu Feb 7, 2022
ab23896
change root dir
xianyuanliu Feb 7, 2022
40861fc
Update doc
xianyuanliu Feb 7, 2022
dc4b990
Merge branch 'add_feature_vector_dataloader' into simplify_video_doma…
xianyuanliu Feb 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update doc
  • Loading branch information
xianyuanliu committed Feb 7, 2022
commit 40861fc48161b7193dcde00bbf5c304644513f39
2 changes: 1 addition & 1 deletion kale/loaddata/video_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BasicVideoDataset(VideoFrameDataset):
num_segments (int): The number of segments the video should be divided into to sample frames from.
frames_per_segment (int): The number of frames that should be loaded per segment.
imagefile_template (string): The image filename template.
transform (Compose): Video transform.
transform (torchvision.transforms.Compose, optional): Video transform.
random_shift (bool): Whether the frames from each segment should be taken consecutively starting from
the center(False) of the segment, or consecutively starting from
a random(True) location inside the segment range.
Expand Down
30 changes: 11 additions & 19 deletions kale/loaddata/videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class VideoRecord(object):
represents a video sample's metadata.

Args:
root_datapath (Path, optional): the system path to the root folder of the videos.
root_datapath (pathlib.Path, optional): the system path to the root folder of the videos.
row (tuple, optional): A list with four or more elements where
1) The first element is the path to the video sample's frames excluding the root_datapath prefix.
2) The second element is the starting frame id of the video.
Expand Down Expand Up @@ -126,27 +126,19 @@ class VideoFrameDataset(torch.utils.data.Dataset):
might be ``jumping\0052\`` or ``sample1\`` or ``00053\``.

Args:
root_path (str, Path): root path in which video folders lie.
this is ROOT_DATA from the description above.
annotationfile_path (str, Path): .txt annotation file containing
one row per video sample as described above.
root_path (str, pathlib.Path): root path in which video folders lie. This is ROOT_DATA from the above.
annotationfile_path (str, pathlib.Path): .txt annotation file containing one row per video sample as described above.
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
be loaded per segment. For each segment's
frame-range, a random start index or the
center is chosen, from which frames_per_segment
consecutive frames are loaded.
imagefile_template (str): image filename template that video frame files
have inside of their video folders as described above.
transform (Compose, optional): transform pipeline that receives a list of PIL images/frames.
random_shift (bool): whether the frames from each segment should be taken
consecutively starting from the center of the segment, or
consecutively starting from a random location inside the
segment range.
test_mode (bool): whether this is a test dataset. If so, chooses
frames from segments with random_shift=False.
frames_per_segment (int): number of frames that should be loaded per segment. For each segment's frame-range,
a random start index or the center is chosen,
from which frames_per_segment consecutive frames are loaded.
imagefile_template (str): image filename template that video frame files have inside the video folders as described above.
transform (torchvision.transforms.Compose, optional): transform pipeline that receives a list of PIL images/frames.
random_shift (bool): whether the frames from each segment should be taken consecutively starting from the center
of the segment, or consecutively starting from a random location inside the segment range.
test_mode (bool): whether this is a test dataset. If so, chooses frames from segments with random_shift=False.
input_type (str): type of input. (options: 'image' or 'feature')
num_data_load (int): number of the data to load. (only used in feature vector mode)
total_segments (int): total number of segments a video is divided into. (only used in feature vector mode)
Expand Down