Update app.py
Browse files
app.py
CHANGED
|
@@ -12,20 +12,20 @@ from utils import IMAGENET_MEAN, IMAGENET_STD, num_frames, patch_size, input_siz
|
|
| 12 |
from labels import K400_label_map, SSv2_label_map, UCF_label_map
|
| 13 |
|
| 14 |
|
| 15 |
-
MODELS = {
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
}
|
| 29 |
|
| 30 |
LABEL_MAPS = {
|
| 31 |
'K400': K400_label_map,
|
|
@@ -51,18 +51,15 @@ def tube_mask_generator(mask_ratio):
|
|
| 51 |
|
| 52 |
|
| 53 |
def get_model(model_type):
|
| 54 |
-
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
)
|
| 60 |
-
pt_path = hf_hub_download(
|
| 61 |
-
repo_id='innat/videomae', filename=model_type + '_PT', repo_type="model"
|
| 62 |
-
)
|
| 63 |
-
|
| 64 |
-
ft_model = keras.models.load_model(ft_path)
|
| 65 |
-
pt_model = keras.models.load_model(pt_path)
|
| 66 |
|
| 67 |
if 'K400' in model_type:
|
| 68 |
data_type = 'K400'
|
|
@@ -126,7 +123,6 @@ def main():
|
|
| 126 |
'TFVideoMAE_B_UCF_16x224',
|
| 127 |
]
|
| 128 |
|
| 129 |
-
|
| 130 |
sample_example = [
|
| 131 |
["examples/k400.mp4", ALL_MODELS[0], 0.9],
|
| 132 |
["examples/k400.mp4", ALL_MODELS[1], 0.8],
|
|
|
|
| 12 |
from labels import K400_label_map, SSv2_label_map, UCF_label_map
|
| 13 |
|
| 14 |
|
| 15 |
+
# MODELS = {
|
| 16 |
+
# 'K400': [
|
| 17 |
+
# './TFVideoMAE_S_K400_16x224_FT',
|
| 18 |
+
# './TFVideoMAE_S_K400_16x224_PT'
|
| 19 |
+
# ],
|
| 20 |
+
# 'SSv2': [
|
| 21 |
+
# './TFVideoMAE_S_K400_16x224_FT',
|
| 22 |
+
# './TFVideoMAE_S_K400_16x224_PT'
|
| 23 |
+
# ],
|
| 24 |
+
# 'UCF' : [
|
| 25 |
+
# './TFVideoMAE_S_K400_16x224_FT',
|
| 26 |
+
# './TFVideoMAE_S_K400_16x224_PT'
|
| 27 |
+
# ]
|
| 28 |
+
# }
|
| 29 |
|
| 30 |
LABEL_MAPS = {
|
| 31 |
'K400': K400_label_map,
|
|
|
|
| 51 |
|
| 52 |
|
| 53 |
def get_model(model_type):
|
| 54 |
+
# ft_path = hf_hub_download(
|
| 55 |
+
# repo_id='innat/videomae', filename=model_type + '_FT', repo_type="model"
|
| 56 |
+
# )
|
| 57 |
+
# pt_path = hf_hub_download(
|
| 58 |
+
# repo_id='innat/videomae', filename=model_type + '_PT', repo_type="model"
|
| 59 |
+
# )
|
| 60 |
|
| 61 |
+
ft_model = keras.models.load_model(model_type + '_FT')
|
| 62 |
+
pt_model = keras.models.load_model(model_type + '_PT')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
if 'K400' in model_type:
|
| 65 |
data_type = 'K400'
|
|
|
|
| 123 |
'TFVideoMAE_B_UCF_16x224',
|
| 124 |
]
|
| 125 |
|
|
|
|
| 126 |
sample_example = [
|
| 127 |
["examples/k400.mp4", ALL_MODELS[0], 0.9],
|
| 128 |
["examples/k400.mp4", ALL_MODELS[1], 0.8],
|