a312863063 / SimSwapHD

Reimplement of SimSwap training code
Other
171 stars 47 forks source link

Issue after adding src_all = np.array([src1, src2, src3, src4, src5]) src = src_all * image_size / 112 #13

Closed netrunner-exe closed 2 years ago

netrunner-exe commented 2 years ago

Trying to train in Google Collab

If i change face_align.py, from readme, it show:

Traceback (most recent call last):
  File "make_dataset.py", line 10, in <module>
    from insightface_func.face_detect_crop_single import Face_detect_crop
  File "/content/SimSwap-train/insightface_func/face_detect_crop_single.py", line 8, in <module>
    from insightface.model_zoo import model_zoo
  File "/usr/local/lib/python3.7/dist-packages/insightface/__init__.py", line 16, in <module>
    from . import model_zoo
  File "/usr/local/lib/python3.7/dist-packages/insightface/model_zoo/__init__.py", line 1, in <module>
    from .model_zoo import get_model
  File "/usr/local/lib/python3.7/dist-packages/insightface/model_zoo/model_zoo.py", line 11, in <module>
    from .arcface_onnx import *
  File "/usr/local/lib/python3.7/dist-packages/insightface/model_zoo/arcface_onnx.py", line 12, in <module>
    from ..utils import face_align
  File "/usr/local/lib/python3.7/dist-packages/insightface/utils/face_align.py", line 29, in <module>
    src_map = {112: src, 224: src * 2}
NameError: name 'src' is not defined

If i dont change face_align.py, it just show:

find model: ./insightface_func/models/antelope/glintr100.onnx recognition
find model: ./insightface_func/models/antelope/scrfd_10g_bnkps.onnx detection
set det-size: (640, 640)
0it [00:00, ?it/s]

and not make dataset, just make empty folders - imgs and latents.

Images from CelebA dataset are in the root of the folderSimSwap-train/dataset/CelebA

If i run CUDA_VISIBLE_DEVICES=0 python train.py --name CelebA_512_finetune --dataroot /content/SimSwap-train/dataset/CelebA --image_size 512 --display_winsize 512 --continue_train it show

Traceback (most recent call last):
  File "train.py", line 14, in <module>
    from util.visualizer import Visualizer
  File "/content/SimSwap-train/util/visualizer.py", line 6, in <module>
    from . import html
  File "/content/SimSwap-train/util/html.py", line 1, in <module>
    import dominate
ModuleNotFoundError: No module named 'dominate'

I would be glad for any help or if someone shared his pretrained model.

netrunner-exe commented 2 years ago

ModuleNotFoundError: No module named 'dominate' - this problem is being solved by installing pip install dominate.

File "/usr/local/lib/python3.7/dist-packages/insightface/utils/face_align.py", line 29, in <module>
    src_map = {112: src, 224: src * 2}
NameError: name 'src' is not defined

Anyone please help about it

I8Robot commented 2 years ago

src_all = np.array([src1, src2, src3, src4, src5]) src_map = {112: src_all, 224: src_all * 2}

netrunner-exe commented 2 years ago

Thank you, it works!