diff --git a/README.md b/README.md index 33cf6ce..00496dd 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,9 @@ to classify and generate a vector for the given video path './archery.mp4' ([dow import towhee ( - towhee.glob('./archery.mp4') - .video_decode.ffmpeg() + towhee.dc(['./demo_video.mp4']) + .video_decode.ffmpeg(sample_type='uniform_temporal_subsample', args={'num_samples': 4}) + .runas_op(func=lambda x: [y for y in x]) .action_classification.video_swin_transformer(model_name='swin_tiny_patch244_window877_kinetics400_1k') .show() ) @@ -41,10 +42,10 @@ import towhee import towhee ( - towhee.glob['path']('./archery.mp4') - .video_decode.ffmpeg['path', 'frames']() - .action_classification.video_swin_transformer['frames', ('labels', 'scores', 'features')]( - model_name='swin_tiny_patch244_window877_kinetics400_1k') + towhee.dc['path']('./demo_video.mp4') + .video_decode.ffmpeg['path', 'frames'](sample_type='uniform_temporal_subsample', args={'num_samples': 4}) + .runas_op['frames', 'frames'](func=lambda x: [y for y in x]) + .action_classification.video_swin_transformer['frames', ('labels', 'scores', 'features')](model_name='swin_tiny_patch244_window877_kinetics400_1k') .select['path', 'labels', 'scores', 'features']() .show(formatter={'path': 'video_path'}) ) @@ -57,15 +58,20 @@ import towhee Create the operator via the following factory method -***action_classification.timesformer( -model_name='timesformer_k400_8x224', skip_preprocess=False, classmap=None, topk=5)*** +***action_classification.video_swin_transformer( +model_name='swin_tiny_patch244_window877_kinetics400_1k', skip_preprocess=False, classmap=None, topk=5)*** **Parameters:** ​ ***model_name***: *str* ​ The name of pre-trained model. Supported model names: -- timesformer_k400_8x224 +- swin_tiny_patch244_window877_kinetics400_1k +- swin_base_patch244_window877_kinetics400_1k +- swin_small_patch244_window877_kinetics400_1k +- swin_base_patch244_window877_kinetics400_22k +- swin_base_patch244_window877_kinetics600_22k +- swin_base_patch244_window1677_sthv2 ​ ***skip_preprocess***: *bool* diff --git a/result1.png b/result1.png new file mode 100644 index 0000000..d019f6d Binary files /dev/null and b/result1.png differ diff --git a/result2.png b/result2.png new file mode 100644 index 0000000..dc0935a Binary files /dev/null and b/result2.png differ