Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -51,6 +51,7 @@ face_detector_path = "/home/user/app/mmod_human_face_detector.dat"
|
|
51 |
face_predictor_path = "/home/user/app/shape_predictor_68_face_landmarks.dat"
|
52 |
mean_face_path = "/home/user/app/20words_mean_face.npy"
|
53 |
mouth_roi_path = "/home/user/app/roi.mp4"
|
|
|
54 |
utils.import_user_module(Namespace(user_dir=user_dir))
|
55 |
|
56 |
def detect_landmark(image, detector, predictor):
|
@@ -102,7 +103,7 @@ def predict(process_video):
|
|
102 |
modalities = ["video"]
|
103 |
gen_subset = "test"
|
104 |
gen_cfg = GenerationConfig(beam=20)
|
105 |
-
|
106 |
models = [model.eval().cuda() if torch.cuda.is_available() else model.eval() for model in models]
|
107 |
saved_cfg.task.modalities = modalities
|
108 |
saved_cfg.task.data = data_dir
|
|
|
51 |
face_predictor_path = "/home/user/app/shape_predictor_68_face_landmarks.dat"
|
52 |
mean_face_path = "/home/user/app/20words_mean_face.npy"
|
53 |
mouth_roi_path = "/home/user/app/roi.mp4"
|
54 |
+
models, saved_cfg, task = checkpoint_utils.load_model_ensemble_and_task([ckpt_path])
|
55 |
utils.import_user_module(Namespace(user_dir=user_dir))
|
56 |
|
57 |
def detect_landmark(image, detector, predictor):
|
|
|
103 |
modalities = ["video"]
|
104 |
gen_subset = "test"
|
105 |
gen_cfg = GenerationConfig(beam=20)
|
106 |
+
|
107 |
models = [model.eval().cuda() if torch.cuda.is_available() else model.eval() for model in models]
|
108 |
saved_cfg.task.modalities = modalities
|
109 |
saved_cfg.task.data = data_dir
|