From 6e39bd0d00f54e07d94f2f5745ae719f6a32808b Mon Sep 17 00:00:00 2001 From: Nick Davis <1107589563@qq.com> Date: Wed, 2 Jul 2025 16:40:49 +0800 Subject: [PATCH] fix: preprocess import bug (#345) Fixing 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/preprocess.py b/scripts/preprocess.py index 2f8bc6d..979c9fc 100755 --- a/scripts/preprocess.py +++ b/scripts/preprocess.py @@ -1,6 +1,9 @@ import os import argparse import subprocess +import torch +import numpy as np +from tqdm import tqdm from omegaconf import OmegaConf from typing import Tuple, List, Union import decord @@ -9,9 +12,6 @@ import cv2 from musetalk.utils.face_detection import FaceAlignment,LandmarksType from mmpose.apis import inference_topdown, init_model from mmpose.structures import merge_data_samples -import torch -import numpy as np -from tqdm import tqdm import sys def fast_check_ffmpeg(): @@ -331,4 +331,4 @@ if __name__ == "__main__": config = OmegaConf.load(args.config) main(config) - \ No newline at end of file +