thinh-huynh-re commited on
Commit
c8b45a2
1 Parent(s): 69d29a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -39,7 +39,12 @@ def sample_frame_indices(
39
  # @st.cache_resource
40
  @st.experimental_singleton
41
  def load_model(model_name: str):
42
- feature_extractor = AutoFeatureExtractor.from_pretrained(model_name)
 
 
 
 
 
43
  model = TimesformerForVideoClassification.from_pretrained(model_name)
44
  return feature_extractor, model
45
 
 
39
  # @st.cache_resource
40
  @st.experimental_singleton
41
  def load_model(model_name: str):
42
+ if "k400" in model_name or "k600" in model_name:
43
+ feature_extractor = AutoFeatureExtractor.from_pretrained(
44
+ "MCG-NJU/videomae-base-finetuned-kinetics"
45
+ )
46
+ else:
47
+ feature_extractor = AutoFeatureExtractor.from_pretrained(model_name)
48
  model = TimesformerForVideoClassification.from_pretrained(model_name)
49
  return feature_extractor, model
50