fix: preprocess import bug (#345)
Browse filesFixing the issue when executing the script "python -m scripts.preprocess --config ./configs/training/preprocess.yaml" in the Ubuntu environment, due to the "import torch" order problem, the execution of "from musetalk.utils.face_detection import FaceAlignment, LandmarksType" hangs.
- scripts/preprocess.py +4 -4
scripts/preprocess.py
CHANGED
|
@@ -1,6 +1,9 @@
|
|
| 1 |
import os
|
| 2 |
import argparse
|
| 3 |
import subprocess
|
|
|
|
|
|
|
|
|
|
| 4 |
from omegaconf import OmegaConf
|
| 5 |
from typing import Tuple, List, Union
|
| 6 |
import decord
|
|
@@ -9,9 +12,6 @@ import cv2
|
|
| 9 |
from musetalk.utils.face_detection import FaceAlignment,LandmarksType
|
| 10 |
from mmpose.apis import inference_topdown, init_model
|
| 11 |
from mmpose.structures import merge_data_samples
|
| 12 |
-
import torch
|
| 13 |
-
import numpy as np
|
| 14 |
-
from tqdm import tqdm
|
| 15 |
import sys
|
| 16 |
|
| 17 |
def fast_check_ffmpeg():
|
|
@@ -331,4 +331,4 @@ if __name__ == "__main__":
|
|
| 331 |
config = OmegaConf.load(args.config)
|
| 332 |
|
| 333 |
main(config)
|
| 334 |
-
|
|
|
|
| 1 |
import os
|
| 2 |
import argparse
|
| 3 |
import subprocess
|
| 4 |
+
import torch
|
| 5 |
+
import numpy as np
|
| 6 |
+
from tqdm import tqdm
|
| 7 |
from omegaconf import OmegaConf
|
| 8 |
from typing import Tuple, List, Union
|
| 9 |
import decord
|
|
|
|
| 12 |
from musetalk.utils.face_detection import FaceAlignment,LandmarksType
|
| 13 |
from mmpose.apis import inference_topdown, init_model
|
| 14 |
from mmpose.structures import merge_data_samples
|
|
|
|
|
|
|
|
|
|
| 15 |
import sys
|
| 16 |
|
| 17 |
def fast_check_ffmpeg():
|
|
|
|
| 331 |
config = OmegaConf.load(args.config)
|
| 332 |
|
| 333 |
main(config)
|
| 334 |
+
|