Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import numpy as np
|
| 3 |
import imageio
|
|
@@ -52,8 +53,16 @@ def tube_mask_generator(mask_ratio):
|
|
| 52 |
def get_model(model_type):
|
| 53 |
print('---------------------')
|
| 54 |
print('innat/videomae/' + model_type + '_FT')
|
| 55 |
-
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
if 'K400' in model_type:
|
| 59 |
data_type = 'K400'
|
|
|
|
| 1 |
+
from huggingface_hub import hf_hub_download
|
| 2 |
import gradio as gr
|
| 3 |
import numpy as np
|
| 4 |
import imageio
|
|
|
|
| 53 |
def get_model(model_type):
|
| 54 |
print('---------------------')
|
| 55 |
print('innat/videomae/' + model_type + '_FT')
|
| 56 |
+
|
| 57 |
+
ft_path = hf_hub_download(
|
| 58 |
+
repo_id=hf_dataset_identifier, filename='innat/videomae/' + model_type + '_FT', repo_type="model"
|
| 59 |
+
)
|
| 60 |
+
pt_path = hf_hub_download(
|
| 61 |
+
repo_id=hf_dataset_identifier, filename='innat/videomae/' + 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'
|