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

pruebas hechas #2802

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added browse_out/video_0.mp4
Binary file not shown.
Binary file added browse_out/video_1.mp4
Binary file not shown.
Binary file added browse_out/video_10.mp4
Binary file not shown.
Binary file added browse_out/video_11.mp4
Binary file not shown.
Binary file added browse_out/video_12.mp4
Binary file not shown.
Binary file added browse_out/video_13.mp4
Binary file not shown.
Binary file added browse_out/video_14.mp4
Binary file not shown.
Binary file added browse_out/video_15.mp4
Binary file not shown.
Binary file added browse_out/video_16.mp4
Binary file not shown.
Binary file added browse_out/video_17.mp4
Binary file not shown.
Binary file added browse_out/video_18.mp4
Binary file not shown.
Binary file added browse_out/video_19.mp4
Binary file not shown.
Binary file added browse_out/video_2.mp4
Binary file not shown.
Binary file added browse_out/video_20.mp4
Binary file not shown.
Binary file added browse_out/video_21.mp4
Binary file not shown.
Binary file added browse_out/video_22.mp4
Binary file not shown.
Binary file added browse_out/video_23.mp4
Binary file not shown.
Binary file added browse_out/video_24.mp4
Binary file not shown.
Binary file added browse_out/video_25.mp4
Binary file not shown.
Binary file added browse_out/video_26.mp4
Binary file not shown.
Binary file added browse_out/video_27.mp4
Binary file not shown.
Binary file added browse_out/video_28.mp4
Binary file not shown.
Binary file added browse_out/video_29.mp4
Binary file not shown.
Binary file added browse_out/video_3.mp4
Binary file not shown.
Binary file added browse_out/video_4.mp4
Binary file not shown.
Binary file added browse_out/video_5.mp4
Binary file not shown.
Binary file added browse_out/video_6.mp4
Binary file not shown.
Binary file added browse_out/video_7.mp4
Binary file not shown.
Binary file added browse_out/video_8.mp4
Binary file not shown.
Binary file added browse_out/video_9.mp4
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

# dataset settings
dataset_type = 'VideoDataset'
data_root = 'data/kinetics400/videos_train'
data_root_val = 'data/kinetics400/videos_val'
ann_file_train = 'data/kinetics400/kinetics400_train_list_videos.txt'
ann_file_val = 'data/kinetics400/kinetics400_val_list_videos.txt'
data_root = 'data/kinetics400_tiny/train'
data_root_val = 'data/kinetics400_tiny/val'
ann_file_train = 'data/kinetics400_tiny/kinetics_tiny_train_video.txt'
ann_file_val = 'data/kinetics400_tiny/kinetics_tiny_val_video.txt'

file_client_args = dict(io_backend='disk')

Expand Down Expand Up @@ -93,8 +93,26 @@
val_evaluator = dict(type='AccMetric')
test_evaluator = val_evaluator

default_hooks = dict(checkpoint=dict(interval=3, max_keep_ckpts=3))

# set training batch size to 4
train_dataloader['batch_size'] = 4
# Save checkpoints every epoch, and only keep the latest checkpoint
default_hooks = dict(
checkpoint=dict(type='CheckpointHook', interval=1, max_keep_ckpts=1))
# Set the maximum number of epochs to 10, and validate the model every 1 epochs
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=10, val_interval=1)
# adjust learning rate schedule according to 10 epochs
param_scheduler = [
dict(
type='MultiStepLR',
begin=0,
end=10,
by_epoch=True,
milestones=[4, 8],
gamma=0.1)
]
model = dict(
cls_head=dict(num_classes=2))
load_from = 'https://download.openmmlab.com/mmaction/v1.0/recognition/tsn/tsn_imagenet-pretrained-r50_8xb32-1x1x3-100e_kinetics400-rgb/tsn_imagenet-pretrained-r50_8xb32-1x1x3-100e_kinetics400-rgb_20220906-cd10898e.pth'
# Default setting for scaling LR automatically
# - `enable` means enable scaling LR automatically
# or not by default.
Expand Down
Binary file added kinetics400_tiny.zip
Binary file not shown.
237 changes: 237 additions & 0 deletions tsn_imagenet-pretrained-r50_8xb32-1x1x8-100e_kinetics400-rgb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
ann_file_train = 'data/kinetics400/kinetics400_train_list_videos.txt'
ann_file_val = 'data/kinetics400/kinetics400_val_list_videos.txt'
auto_scale_lr = dict(base_batch_size=256, enable=False)
data_root = 'data/kinetics400/videos_train'
data_root_val = 'data/kinetics400/videos_val'
dataset_type = 'VideoDataset'
default_hooks = dict(
checkpoint=dict(
interval=3, max_keep_ckpts=3, save_best='auto', type='CheckpointHook'),
logger=dict(ignore_last=False, interval=20, type='LoggerHook'),
param_scheduler=dict(type='ParamSchedulerHook'),
runtime_info=dict(type='RuntimeInfoHook'),
sampler_seed=dict(type='DistSamplerSeedHook'),
sync_buffers=dict(type='SyncBuffersHook'),
timer=dict(type='IterTimerHook'))
default_scope = 'mmaction'
env_cfg = dict(
cudnn_benchmark=False,
dist_cfg=dict(backend='nccl'),
mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0))
file_client_args = dict(io_backend='disk')
load_from = None
log_level = 'INFO'
log_processor = dict(by_epoch=True, type='LogProcessor', window_size=20)
model = dict(
backbone=dict(
depth=50,
norm_eval=False,
pretrained='https://download.pytorch.org/models/resnet50-11ad3fa6.pth',
type='ResNet'),
cls_head=dict(
average_clips='prob',
consensus=dict(dim=1, type='AvgConsensus'),
dropout_ratio=0.4,
in_channels=2048,
init_std=0.01,
num_classes=400,
spatial_type='avg',
type='TSNHead'),
data_preprocessor=dict(
format_shape='NCHW',
mean=[
123.675,
116.28,
103.53,
],
std=[
58.395,
57.12,
57.375,
],
type='ActionDataPreprocessor'),
test_cfg=None,
train_cfg=None,
type='Recognizer2D')
optim_wrapper = dict(
clip_grad=dict(max_norm=40, norm_type=2),
optimizer=dict(lr=0.01, momentum=0.9, type='SGD', weight_decay=0.0001))
param_scheduler = [
dict(
begin=0,
by_epoch=True,
end=100,
gamma=0.1,
milestones=[
40,
80,
],
type='MultiStepLR'),
]
resume = False
test_cfg = dict(type='TestLoop')
test_dataloader = dict(
batch_size=1,
dataset=dict(
ann_file='data/kinetics400/kinetics400_val_list_videos.txt',
data_prefix=dict(video='data/kinetics400/videos_val'),
pipeline=[
dict(io_backend='disk', type='DecordInit'),
dict(
clip_len=1,
frame_interval=1,
num_clips=25,
test_mode=True,
type='SampleFrames'),
dict(type='DecordDecode'),
dict(scale=(
-1,
256,
), type='Resize'),
dict(crop_size=224, type='TenCrop'),
dict(input_format='NCHW', type='FormatShape'),
dict(type='PackActionInputs'),
],
test_mode=True,
type='VideoDataset'),
num_workers=8,
persistent_workers=True,
sampler=dict(shuffle=False, type='DefaultSampler'))
test_evaluator = dict(type='AccMetric')
test_pipeline = [
dict(io_backend='disk', type='DecordInit'),
dict(
clip_len=1,
frame_interval=1,
num_clips=25,
test_mode=True,
type='SampleFrames'),
dict(type='DecordDecode'),
dict(scale=(
-1,
256,
), type='Resize'),
dict(crop_size=224, type='TenCrop'),
dict(input_format='NCHW', type='FormatShape'),
dict(type='PackActionInputs'),
]
train_cfg = dict(
max_epochs=100, type='EpochBasedTrainLoop', val_begin=1, val_interval=1)
train_dataloader = dict(
batch_size=32,
dataset=dict(
ann_file='data/kinetics400/kinetics400_train_list_videos.txt',
data_prefix=dict(video='data/kinetics400/videos_train'),
pipeline=[
dict(io_backend='disk', type='DecordInit'),
dict(
clip_len=1, frame_interval=1, num_clips=8,
type='SampleFrames'),
dict(type='DecordDecode'),
dict(scale=(
-1,
256,
), type='Resize'),
dict(
input_size=224,
max_wh_scale_gap=1,
random_crop=False,
scales=(
1,
0.875,
0.75,
0.66,
),
type='MultiScaleCrop'),
dict(keep_ratio=False, scale=(
224,
224,
), type='Resize'),
dict(flip_ratio=0.5, type='Flip'),
dict(input_format='NCHW', type='FormatShape'),
dict(type='PackActionInputs'),
],
type='VideoDataset'),
num_workers=8,
persistent_workers=True,
sampler=dict(shuffle=True, type='DefaultSampler'))
train_pipeline = [
dict(io_backend='disk', type='DecordInit'),
dict(clip_len=1, frame_interval=1, num_clips=8, type='SampleFrames'),
dict(type='DecordDecode'),
dict(scale=(
-1,
256,
), type='Resize'),
dict(
input_size=224,
max_wh_scale_gap=1,
random_crop=False,
scales=(
1,
0.875,
0.75,
0.66,
),
type='MultiScaleCrop'),
dict(keep_ratio=False, scale=(
224,
224,
), type='Resize'),
dict(flip_ratio=0.5, type='Flip'),
dict(input_format='NCHW', type='FormatShape'),
dict(type='PackActionInputs'),
]
val_cfg = dict(type='ValLoop')
val_dataloader = dict(
batch_size=32,
dataset=dict(
ann_file='data/kinetics400/kinetics400_val_list_videos.txt',
data_prefix=dict(video='data/kinetics400/videos_val'),
pipeline=[
dict(io_backend='disk', type='DecordInit'),
dict(
clip_len=1,
frame_interval=1,
num_clips=8,
test_mode=True,
type='SampleFrames'),
dict(type='DecordDecode'),
dict(scale=(
-1,
256,
), type='Resize'),
dict(crop_size=224, type='CenterCrop'),
dict(input_format='NCHW', type='FormatShape'),
dict(type='PackActionInputs'),
],
test_mode=True,
type='VideoDataset'),
num_workers=8,
persistent_workers=True,
sampler=dict(shuffle=False, type='DefaultSampler'))
val_evaluator = dict(type='AccMetric')
val_pipeline = [
dict(io_backend='disk', type='DecordInit'),
dict(
clip_len=1,
frame_interval=1,
num_clips=8,
test_mode=True,
type='SampleFrames'),
dict(type='DecordDecode'),
dict(scale=(
-1,
256,
), type='Resize'),
dict(crop_size=224, type='CenterCrop'),
dict(input_format='NCHW', type='FormatShape'),
dict(type='PackActionInputs'),
]
vis_backends = [
dict(type='LocalVisBackend'),
]
visualizer = dict(
type='ActionVisualizer', vis_backends=[
dict(type='LocalVisBackend'),
])