vumichien commited on
Commit
23a56cb
1 Parent(s): f915926

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -21,6 +21,12 @@ sys.path.append('/home/user/app/av_hubert')
21
  print(sys.path)
22
  print(os.listdir())
23
 
 
 
 
 
 
 
24
  import dlib, cv2, os
25
  import numpy as np
26
  import skvideo
@@ -31,7 +37,7 @@ from base64 import b64encode
31
  import torch
32
  import cv2
33
  import tempfile
34
- from argparse import Namespace
35
  import fairseq
36
  from fairseq import checkpoint_utils, options, tasks, utils
37
  from fairseq.dataclass.configs import GenerationConfig
@@ -39,7 +45,6 @@ from huggingface_hub import hf_hub_download
39
  import gradio as gr
40
 
41
  ckpt_path = hf_hub_download('vumichien/AV-HuBERT', 'model.pt')
42
- user_dir = "/home/user/app/av_hubert/avhubert"
43
  face_detector_path = "/home/user/app/mmod_human_face_detector.dat"
44
  face_predictor_path = "/home/user/app/shape_predictor_68_face_landmarks.dat"
45
  mean_face_path = "/home/user/app/20words_mean_face.npy"
@@ -91,7 +96,7 @@ def predict(process_video):
91
  fo.write("".join(tsv_cont))
92
  with open(f"{data_dir}/test.wrd", "w") as fo:
93
  fo.write("".join(label_cont))
94
- utils.import_user_module(Namespace(user_dir=user_dir))
95
  modalities = ["video"]
96
  gen_subset = "test"
97
  gen_cfg = GenerationConfig(beam=20)
 
21
  print(sys.path)
22
  print(os.listdir())
23
 
24
+ from fairseq import checkpoint_utils, options, tasks, utils
25
+ from argparse import Namespace
26
+ user_dir = "/home/user/app/av_hubert/avhubert"
27
+ utils.import_user_module(Namespace(user_dir=user_dir))
28
+
29
+
30
  import dlib, cv2, os
31
  import numpy as np
32
  import skvideo
 
37
  import torch
38
  import cv2
39
  import tempfile
40
+
41
  import fairseq
42
  from fairseq import checkpoint_utils, options, tasks, utils
43
  from fairseq.dataclass.configs import GenerationConfig
 
45
  import gradio as gr
46
 
47
  ckpt_path = hf_hub_download('vumichien/AV-HuBERT', 'model.pt')
 
48
  face_detector_path = "/home/user/app/mmod_human_face_detector.dat"
49
  face_predictor_path = "/home/user/app/shape_predictor_68_face_landmarks.dat"
50
  mean_face_path = "/home/user/app/20words_mean_face.npy"
 
96
  fo.write("".join(tsv_cont))
97
  with open(f"{data_dir}/test.wrd", "w") as fo:
98
  fo.write("".join(label_cont))
99
+
100
  modalities = ["video"]
101
  gen_subset = "test"
102
  gen_cfg = GenerationConfig(beam=20)