From 45eb2ed60a6b81be4dd82fd76605efa17c3f0dfd Mon Sep 17 00:00:00 2001 From: xujinling Date: Wed, 15 Jun 2022 10:52:13 +0800 Subject: [PATCH] modify weights name Signed-off-by: xujinling --- .../inspectionProfiles/profiles_settings.xml | 6 +++ .idea/modules.xml | 8 ++++ .idea/vcs.xml | 6 +++ .idea/video-swin-transformer.iml | 12 ++++++ .idea/workspace.xml | 40 +++++++++++++++++++ README.md | 14 +++---- video_swin_transformer.py | 2 +- 7 files changed, 80 insertions(+), 8 deletions(-) create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/video-swin-transformer.iml create mode 100644 .idea/workspace.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..db7929a --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/video-swin-transformer.iml b/.idea/video-swin-transformer.iml new file mode 100644 index 0000000..8a05c6e --- /dev/null +++ b/.idea/video-swin-transformer.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..241e973 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + { + "keyToString": { + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "last_opened_file_path": "/Users/zilliz/PycharmProjects/operator/action_classification/video-swin-transformer", + "settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" + } +} + + + + + 1655102030715 + + + + \ No newline at end of file diff --git a/README.md b/README.md index cf4d895..dbe6444 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ and maps vectors with labels. ## Code Example -Use the pretrained VideoSwinTransformer model ('swin_tiny_patch244_window877_kinetics400_1k') +Use the pretrained VideoSwinTransformer model ('swin_t_k400_1k') to classify and generate a vector for the given video path './archery.mp4' ([download](https://dl.fbaipublicfiles.com/pytorchvideo/projects/archery.mp4)). *Write the pipeline in simplified style*: @@ -27,7 +27,7 @@ import towhee ( towhee.glob('./archery.mp4') .video_decode.ffmpeg() - .action_classification.video_swin_transformer(model_name='swin_t_w877_k400_1k') + .action_classification.video_swin_transformer(model_name='swin_t_k400_1k') .show() ) ``` @@ -43,7 +43,7 @@ import towhee ( towhee.glob['path']('./archery.mp4') .video_decode.ffmpeg['path', 'frames']() - .action_classification.video_swin_transformer['frames', ('labels', 'scores', 'features')](model_name='swin_t_w877_k400_1k') + .action_classification.video_swin_transformer['frames', ('labels', 'scores', 'features')](model_name='swin_t_k400_1k') .select['path', 'labels', 'scores', 'features']() .show(formatter={'path': 'video_path'}) ) @@ -64,10 +64,10 @@ model_name='swin_tiny_patch244_window877_kinetics400_1k', skip_preprocess=False, ​ ***model_name***: *str* ​ The name of pre-trained model. Supported model names: -- swin_b_w877_k400_1k -- swin_s_w877_k400_1k -- swin_t_w877_k400_1k -- swin_b_w877_k400_22k +- swin_b_k400_1k +- swin_s_k400_1k +- swin_t_k400_1k +- swin_b_k400_22k ​ ***skip_preprocess***: *bool* diff --git a/video_swin_transformer.py b/video_swin_transformer.py index 75ab8c6..2f65cf5 100644 --- a/video_swin_transformer.py +++ b/video_swin_transformer.py @@ -32,7 +32,7 @@ class VideoSwinTransformer(NNOperator): The number of classification labels to be returned (ordered by possibility from high to low). """ def __init__(self, - model_name: str = 'swin_t_w877_k400_1k', + model_name: str = 'swin_t_k400_1k', framework: str = 'pytorch', skip_preprocess: bool = False, classmap: str = None,