---
title: "Python facetool : Modification d’un visage par une image dans un MP4."
url: https://www.cyber-neurones.org/2020/10/python-facetool-modification-dun-visage-par-une-image-dans-un-mp4/
date: 2020-10-12
modified: 2024-12-09
lang: fr
author: "Frederic"
description: "J'ai téléchargé https://github.com/hay/facetool afin de faire la modification des visages via une commande du type : ./facetool.py swap -i smiley.jpg -t output-bicyle.mp4 -o swap-bicyle.mp4 D'abord j'ai eu un premier problème..."
categories:
  - "Dev"
  - "Ubuntu"
word_count: 164
---

# Python facetool : Modification d’un visage par une image dans un MP4.

J'ai téléchargé [https://github.com/hay/facetool](https://github.com/hay/facetool) afin de faire la modification des visages via une commande du type :

**./facetool.py swap -i smiley.jpg -t output-bicyle.mp4 -o swap-bicyle.mp4**

D'abord j'ai eu un premier problème que j'ai fixé ainsi :`
cd /usr/lib/python3/dist-packages
sudo cp apt_pkg.cpython-36m-x86_64-linux-gnu.so apt_pkg.so`

Et maintenant j'ai un bug dans le programme :
No faces found, could not swap (Faceswapping smiley.jpg on head-tmp-jdrmcn3j/2357.jpg, saving to out-tmp-jdrmcn3j/2357.jpg)
100%|███████████████████████████████████████████████████████████████████▉| 2671/2672 [25:15<00:00, 2.30it/s]
No faces found, could not swap (Faceswapping smiley.jpg on head-tmp-jdrmcn3j/1180.jpg, saving to out-tmp-jdrmcn3j/1180.jpg)
Traceback (most recent call last):
File "./facetool.py", line 591, in <module>
main(args)
File "./facetool.py", line 565, in main
swapper.swap_image_to_video(args.target, args.input, args.output)
File "./github/facetool/facetool/swapper.py", line 206, in swap_image_to_video
combineframes(self.tempdirs.out, out)
File "./github/facetool/facetool/media.py", line 49, in combineframes
**first_file = list(glob(f"{inp}/*"))[0]**
**IndexError: list index out of range**
Bref j'ai l'impression que cela ne détecte aucun visage :
~/github/facetool$ ls -al head-tmp-jdrmcn3j/*.jpg | wc -l
2672
~/github/facetool$ ls -al out-tmp-jdrmcn3j/*.jpg | wc -l
ls: cannot access 'out-tmp-jdrmcn3j/*.jpg': No such file or directory
0

Je vais devoir chercher ailleur.