logo
Browse Source

modify weights name

Signed-off-by: xujinling <jinling.xu@zilliz.com>
main
xujinling 2 years ago
parent
commit
45eb2ed60a
  1. 6
      .idea/inspectionProfiles/profiles_settings.xml
  2. 8
      .idea/modules.xml
  3. 6
      .idea/vcs.xml
  4. 12
      .idea/video-swin-transformer.iml
  5. 40
      .idea/workspace.xml
  6. 14
      README.md
  7. 2
      video_swin_transformer.py

6
.idea/inspectionProfiles/profiles_settings.xml

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

8
.idea/modules.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/video-swin-transformer.iml" filepath="$PROJECT_DIR$/.idea/video-swin-transformer.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

12
.idea/video-swin-transformer.iml

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="format" value="GOOGLE" />
<option name="myDocStringFormat" value="Google" />
</component>
</module>

40
.idea/workspace.xml

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="663dda54-daf6-497a-a571-035bc92b0930" name="Changes" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectId" id="2AVkEqbwOgCW09vx7LNGoo3PM99" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;/Users/zilliz/PycharmProjects/operator/action_classification/video-swin-transformer&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable&quot;
}
}</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="663dda54-daf6-497a-a571-035bc92b0930" name="Changes" comment="" />
<created>1655102030715</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1655102030715</updated>
</task>
<servers />
</component>
</project>

14
README.md

@ -16,7 +16,7 @@ and maps vectors with labels.
## Code Example ## 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)). 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*: *Write the pipeline in simplified style*:
@ -27,7 +27,7 @@ import towhee
( (
towhee.glob('./archery.mp4') towhee.glob('./archery.mp4')
.video_decode.ffmpeg() .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() .show()
) )
``` ```
@ -43,7 +43,7 @@ import towhee
( (
towhee.glob['path']('./archery.mp4') towhee.glob['path']('./archery.mp4')
.video_decode.ffmpeg['path', 'frames']() .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']() .select['path', 'labels', 'scores', 'features']()
.show(formatter={'path': 'video_path'}) .show(formatter={'path': 'video_path'})
) )
@ -64,10 +64,10 @@ model_name='swin_tiny_patch244_window877_kinetics400_1k', skip_preprocess=False,
***model_name***: *str* ***model_name***: *str*
​ The name of pre-trained model. Supported model names: ​ 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* ***skip_preprocess***: *bool*

2
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). The number of classification labels to be returned (ordered by possibility from high to low).
""" """
def __init__(self, def __init__(self,
model_name: str = 'swin_t_w877_k400_1k',
model_name: str = 'swin_t_k400_1k',
framework: str = 'pytorch', framework: str = 'pytorch',
skip_preprocess: bool = False, skip_preprocess: bool = False,
classmap: str = None, classmap: str = None,

Loading…
Cancel
Save