YuvalNirkin / fsgan

FSGAN - Official PyTorch Implementation
https://nirkin.com/fsgan
Creative Commons Zero v1.0 Universal
749 stars 147 forks source link

Collab problem #14

Closed theridefox closed 4 years ago

theridefox commented 4 years ago

Hello, in the process I have a problem, after the process is completed - it runs indefinitely and the finished file weighs 44kb

=> Detecting faces in video: "source.mp4..."
100%|██████████| 250/250 [01:48<00:00,  2.29frames/s]
100%|██████████| 251/251 [00:00<00:00, 8262.21it/s]=> Extracting sequences from detections in video: "source.mp4"...
=> Cropping video sequences from video: "source.mp4"...
  3%|▎         | 8/250 [00:00<00:03, 75.44it/s]
100%|██████████| 250/250 [00:02<00:00, 124.51it/s]
=> Computing face poses for video: "source_seq00.mp4"...
100%|██████████| 2/2 [00:01<00:00,  1.90batches/s]
=> Computing face landmarks for video: "source_seq00.mp4"...
100%|██████████| 4/4 [00:01<00:00,  2.98batches/s]
=> Computing face segmentation for video: "source_seq00.mp4"...
100%|██████████| 6/6 [00:03<00:00,  1.96batches/s]  0%|          | 0/150 [00:00<?, ?frames/s]
=> Detecting faces in video: "target.mp4..."
100%|██████████| 150/150 [01:05<00:00,  2.30frames/s]
100%|██████████| 151/151 [00:00<00:00, 2776.19it/s]=> Extracting sequences from detections in video: "target.mp4"...
=> Cropping video sequences from video: "target.mp4"...
  5%|▌         | 8/150 [00:00<00:01, 77.80it/s]
100%|██████████| 150/150 [00:01<00:00, 111.29it/s]
=> Computing face poses for video: "target_seq00.mp4"...
100%|██████████| 2/2 [00:00<00:00,  2.67batches/s]
=> Computing face poses for video: "target_seq01.mp4"...
100%|██████████| 2/2 [00:00<00:00,  2.77batches/s]
=> Computing face landmarks for video: "target_seq00.mp4"...
100%|██████████| 3/3 [00:00<00:00,  3.32batches/s]
=> Computing face landmarks for video: "target_seq01.mp4"...
100%|██████████| 3/3 [00:00<00:00,  3.32batches/s]
=> Computing face segmentation for video: "target_seq00.mp4"...
100%|██████████| 4/4 [00:01<00:00,  2.11batches/s]
=> Computing face segmentation for video: "target_seq01.mp4"...
100%|██████████| 4/4 [00:01<00:00,  2.11batches/s]
=> Finetuning the reenactment generator on: "source_seq00.mp4"...
100%|██████████| 200/200 [02:55<00:00,  1.14batches/s]
=> Face swapping: "source_seq00.mp4" -> "target_seq00.mp4"...
100%|██████████| 10/10 [00:31<00:00,  3.12s/batches]
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-7-70ebda5b5352> in <module>()
     10 output_path = '/content/output.mp4'
     11 face_swapping(source_path, target_path, output_tmp_path,
---> 12               select_source, select_target, finetune)
     13 
     14 # Encode with audio and display result

5 frames
/usr/lib/python3.6/multiprocessing/connection.py in _recv(self, size, read)
    377         remaining = size
    378         while remaining > 0:
--> 379             chunk = read(handle, remaining)
    380             n = len(chunk)
    381             if n == 0:

KeyboardInterrupt: 
YuvalNirkin commented 4 years ago

Does this happen on the first time you run the last section?

theridefox commented 4 years ago

Does this happen on the first time you run the last section?

Yes, right

jjandnn commented 4 years ago

@YuvalNirkin Your colab is so beautiful! 你的代码很流畅,改进极为干净利落。 Your code is very streamlined and the improvements are extremely clean。 我测试下来很棒! @theridefox 你的问题是不是用了youtube下载的obama视频,并且直接命名为source覆盖流程中本来就存在的source? Did you use the Obama video downloaded from youtube and directly name it as the existing source in the source coverage process?

theridefox commented 4 years ago

@YuvalNirkin Your colab is so beautiful! 你的代码很流程,改进极为干净利落。 Your code is very streamlined and the improvements are extremely clean。 我测试下来很棒! @theridefox 你的问题是不是用了youtube下载的obama视频,并且直接命名为source覆盖流程中本来就存在的source? Did you use the Obama video downloaded from youtube and directly name it as the existing source in the source coverage process?

beautiful code, do you have any problems?

jjandnn commented 4 years ago

@YuvalNirkin Your colab is so beautiful! 你的代码很流程,改进极为干净利落。 Your code is very streamlined and the improvements are extremely clean。 我测试下来很棒! @theridefox 你的问题是不是用了youtube下载的obama视频,并且直接命名为source覆盖流程中本来就存在的source? Did you use the Obama video downloaded from youtube and directly name it as the existing source in the source coverage process?

beautiful code, do you have any problems? I met your problem before he adjusted it, and I met it once after the adjustment, mainly because I used youtube to download, and I changed the parameter of longest。 我的方法是重命名文件,不用source,并且重新初始化一次。 My method is to rename the file, do not use source, and reinitialize it once。

theridefox commented 4 years ago

@YuvalNirkin Your colab is so beautiful! 你的代码很流程,改进极为干净利落。 Your code is very streamlined and the improvements are extremely clean。 我测试下来很棒! @theridefox 你的问题是不是用了youtube下载的obama视频,并且直接命名为source覆盖流程中本来就存在的source? Did you use the Obama video downloaded from youtube and directly name it as the existing source in the source coverage process?

beautiful code, do you have any problems? I met your problem before he adjusted it, and I met it once after the adjustment, mainly because I used youtube to download, and I changed the parameter of longest。 我的方法是重命名文件,不用source,并且重新初始化一次。 My method is to rename the file, do not use source, and reinitialize it once。

Thanks, i try this

mzmfarid commented 4 years ago

@YuvalNirkin I am facing same problem. After swapping source into target completely it just keeps running idle i think writing the output. I have taken 2 second videos still the same.

jjandnn commented 4 years ago

@mzmfarid test my colab.

mzmfarid commented 4 years ago

@jjandnn still the same

jjandnn commented 4 years ago

@mzmfarid 我提供了两个版本的colab,一个是修改5个文件,直接生成mp4v的版本。一个是一站式官方英文翻译版,我改动了DST和路径,防止大家出错。你检查一下自己的文件是否25帧,在自己本地检查一下。同时dst的秒数,增加到5秒。2秒的长度,我没测试过。我运行下来,一直没出过状况。只有当youtube下载(youtube默认为23帧)作为源时,出过一次错误。 I provide two versions of colab, one is to modify 5 files and directly generate mp4v version. One is a one-stop official English translation version. I changed the DST and path to prevent everyone from making mistakes. You check if your file is 25 frames, and check it locally. At the same time, the number of seconds in dst is increased to 5 seconds. The length of 2 seconds, I have not tested. I ran it down and never had a problem. Only when youtube download (youtube default is 23 frames) as the source, there was an error.

YuvalNirkin commented 4 years ago

The official colab also re-encodes the videos with 25 fps, this is not the issue.

The hang is caused by the separate video writing process. If I won't find the bug I'll just remove the separate process completely but it may impact the performance.

mzmfarid commented 4 years ago

So how can i proceed for now. like which function to comment out?

theridefox commented 4 years ago

@YuvalNirkin Your colab is so beautiful! 你的代码很流畅,改进极为干净利落。 Your code is very streamlined and the improvements are extremely clean。 我测试下来很棒! @theridefox 你的问题是不是用了youtube下载的obama视频,并且直接命名为source覆盖流程中本来就存在的source? Did you use the Obama video downloaded from youtube and directly name it as the existing source in the source coverage process?

我该如何联系您?我看到您对换脸技术感兴趣,我想单独谈一谈。

jjandnn commented 4 years ago

@theridefox 我的微信:dujun6227,杜俊。你是中国的,咱沟通没问题,你是老外,我就瞎了。你看到的,上面全部机翻。哈哈哈。 My WeChat: dujun6227, dujun you are Chinese, we communicate no problem, you are a foreigner, I blind you see, above all machine turn ha ha ha 另外,YN是大神。我不是。我只是大量测评,为实际生产做研发。 In addition, YN is a great god, I'm not I just do a lot of evaluation, research and development for actual production。 技术的革新是灵魂,我们这些应用者是追随者。 Technological innovation is the soul, and we who apply it are the followers。

jajube commented 4 years ago

Same thing is happening to me

YuvalNirkin commented 4 years ago

Should be working now.