Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

faceit.py convert throws error if imagemagick not installed (if running GAN model) #10

Open
tauhlim opened this issue Nov 13, 2018 · 2 comments

Comments

@tauhlim
Copy link

tauhlim commented Nov 13, 2018

Running faceit.py convert throws error if ImageMagick is not installed. moviepy states that ImageMagick is required for writing text, and more specifically is required for TextClip. Suggest updating requirements.txt or making text optional.

(tensorflow_p36) ubuntu@instance-1:~/GAN/faceit$ python3.6 faceit.py convert stark_to_hulk stark_suitup.mp4 --start 40 --duration 55 --side-by-side --use-gan --face-filter --width 800
Using TensorFlow backend.

Loading Model from Model_GAN plugin...
Discriminator models loaded.
Generator models loaded.
Loading Convert from Convert_GAN plugin...
Traceback (most recent call last):
  File "/home/ubuntu/miniconda3/envs/tensorflow_p36/lib/python3.6/site-packages/moviepy/video/VideoClip.py", line 1164, in __init__
    subprocess_call(cmd, verbose=False)
  File "/home/ubuntu/miniconda3/envs/tensorflow_p36/lib/python3.6/site-packages/moviepy/tools.py", line 42, in subprocess_call
    proc = sp.Popen(cmd, **popen_params)
  File "/home/ubuntu/miniconda3/envs/tensorflow_p36/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/home/ubuntu/miniconda3/envs/tensorflow_p36/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'unset': 'unset'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "faceit.py", line 365, in <module>
    faceit.convert(args.video, duration = args.duration, swap_model = args.swap_model, face_filter = args.face_filter, start_time = args.start_time, use_gan = args.use_gan, photos = args.photos, crop_x = args.crop_x, width = args.width, side_by_side = args.side_by_side)
  File "faceit.py", line 274, in convert
    video = add_caption("Original", video)
  File "faceit.py", line 269, in add_caption
    text = (TextClip(caption, font='Amiri-regular', color='white', fontsize=80).
  File "/home/ubuntu/miniconda3/envs/tensorflow_p36/lib/python3.6/site-packages/moviepy/video/VideoClip.py", line 1173, in __init__
    raise IOError(error)
OSError: MoviePy Error: creation of None failed because of the following error:

[Errno 2] No such file or directory: 'unset': 'unset'.

.This error can be due to the fact that ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary in file conf.py, or that the path you specified is incorrect
@tauhlim
Copy link
Author

tauhlim commented Nov 13, 2018

Can verify that commenting out lines to add_caption avoid this error

        # Stack clips side by side
        if side_by_side:
            def add_caption(caption, clip):
                text = (TextClip(caption, font='Amiri-regular', color='white', fontsize=80).
                        margin(40).
                        set_duration(clip.duration).
                        on_color(color=(0,0,0), col_opacity=0.6))
                return CompositeVideoClip([clip, text])
            #video = add_caption("Original", video)
            #new_video = add_caption("Swapped", new_video)                
            final_video = clips_array([[video], [new_video]])
        else:
            final_video = new_video

@Nivratti
Copy link

Nivratti commented Sep 29, 2020

Running command without
--side-by-side
option worked for me

python faceit.py convert fallon_to_oliver fallon_emmastone.mp4 --start 40 --duration 55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants