Advertisement
Guest User

Untitled

a guest
Feb 10th, 2018
5,321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.50 KB | None | 0 0
  1. FakeApp: A Desktop Tool for Creating Deepfakes (self.deepfakes)
  2.  
  3.  
  4. Update 2/4: FakeApp v2.1, the Electron recreation of FakeApp, is finished. You can download it and find screenshots of it working here.
  5.  
  6. Changelog:
  7.  
  8. One-button video creation
  9.  
  10. One-button dataset creation
  11.  
  12. More streamlined, cohesive UI
  13.  
  14. Packaged into one installer, potential for desktop/start menu shorcuts
  15.  
  16. Abstracted out command prompts
  17.  
  18. Packaged FFMPEG, removing the need for manual video-to-image conversion
  19.  
  20. Text fields replaced with more intuitive dropdowns
  21.  
  22. Single error log
  23.  
  24. Thanks again to the community for the support, I hope this version is helpful.
  25.  
  26.  
  27.  
  28. EDIT 1/26: I am releasing a preliminary version of the new, streamlined version of FakeApp made with Electron. A screenshot of this app working is here.
  29.  
  30. This version reduces the video creation process to a single button, and is meant to make it easy for users to rapidly create multiple videos with the same model (without shuffling through folders, tabs, and settings every time) as well as make the general process of creating swaps easier. The new file is also packaged in a single executable with an installer and taskbar/desktop shortcuts. Command prompts have been abstracted out, and errors are now written to a blanket log.txt file. The limitation of this version is that it doesn't yet support training of new models, but I am adding that function in an update that should be finished soon -- I'm releasing it early so that it can be crash-tested to some extent.
  31.  
  32. Also, a 1.1 video tutorial has been made.
  33.  
  34. EDIT 1/25: A MEGA mirror of the app has been posted. The recent influx of downloads has caused Google Drive to temporarily take down the main download link.
  35.  
  36. A tutorial has been created for using this app.
  37.  
  38. EDIT 1/13: Thanks for all the feedback and interest so far, I'm glad people have found the app useful. Here is the download for the latest version, released yesterday (indirect, because direct DL links are filtered).
  39.  
  40. I've completed a desktop app /w GUI to create deepfakes. Here is a what it looks like. For anyone unfamiliar with this subreddit, deepfakes are neural network-generated faceswap videos created with a machine learning algorithm designed by /u/deepfakes. Check the sub wiki for more info. Here is an excellent example of a deepfake of Daisy Ridley produced with this app in less than a day by /u/nuttynutter6969. This app is intended to allow users to move through the full deepfake creation pipeline—creating training data, training a model, and creating fakes with that model—without the need to install Python and other dependencies or parse code. The download link is in the comments.
  41.  
  42. Instructions:
  43.  
  44. Download CUDA 8.0 and store it's bin folder in the PATH environment variable
  45.  
  46. Split some videos with your two desired faces into two sets of a few hundred frames each with a tool like FFMPEG. If you use FFMPEG, the command you want is: ffmpeg -i scene.mp4 -vf fps=[FPS OF VIDEO] "out%d.png". After splitting, run both directories of split frames through the "Extract" tool to produce training data
  47.  
  48. Switch to the "Train" tool, and input the paths of the training data produced in step 1 (it should be in a folder called "aligned") as well as the "models" folder along with this project (which you can move somewhere convenient)
  49.  
  50. Train until the preview window shows results you are satisfied with
  51.  
  52. Split the video to be faked into frames and run the "Convert" tool on them to create faked frames, which can then be remerged into a deepfaked video
  53.  
  54. Copy and reuse the same encoders for faster results in future fakes
  55.  
  56. Requirements:
  57.  
  58. -CUDA 8.0 must be installed, and its bin folder must be included in the PATH environment variable.
  59.  
  60. -At least a few GB of free space on disk to allow the app to create Temp files
  61.  
  62. Notes:
  63.  
  64. -Run fakeapp.bat to launch the app
  65.  
  66. -RuntimeError: module compiled against api version 0xc but this version numpy is 0xb is just a warning related to how the alignment libraries were installed, the app will run properly despite it appearing if no other errors occur
  67.  
  68. -It may take 30-45 seconds after pressing the Start button for the app to unpack and start the training/merging scripts the first time
  69.  
  70. -You can still quit training by focusing the training window and pressing "q"
  71.  
  72. -Paths to models/data must be absolute, not relative
  73.  
  74. If it doesn't work for you:
  75.  
  76. The console for the tool you are using (Align, Train, or Merge) will output a full error log if the tool fails. Here are some known errors with solutions:
  77.  
  78. General Issues
  79.  
  80. All directories used by the app should have names comprised of only English characters. Many users have had issues with directories with Cyrillic or Chinese characters, so if you have directories like this make sure to use different directories with English character names when running the app.
  81.  
  82. If any tool's log contains AssertionError: dir.isDir(), the tool cannot find your directories. Make sure they are typed into the app correctly. Error message added in 1.1
  83.  
  84. Extract Issues
  85.  
  86. If the Extract log contains from torch._C import *, your computer is out-date-on on Visual C++ Redistributable packages. Download an update by Googling "vc redist." (I cannot include an actual link in this post.)
  87.  
  88. If the Align log contains KeyError: state_dict, your version of a dynamic library called2DFan-4.pth.tar is corrupted. This is a library downloaded the first time the Align tool is run, and it is possible for that download to fail to produce a working 2DFan file. Download a working version from the link in the comments (this link is not allowed to be in the post), and replace the corrupted version in C:\Users\[NAME]\AppData\Local\face_alignment\data. Fixed in 1.1
  89.  
  90. If the Align log contains AssertionError: can't find input files make sure the File Type parameter is set to the same image type as the images in your data folder (i.e. png, jpg, etc.) Error message added in 1.1
  91.  
  92. If the Extract log contains error while calling cudaMalloc() reason: out of memory, you are probably training with images that are too large. Make sure images are not greater than 1200x700 in resolution, this resolution is plenty to produce a good model
  93.  
  94. Train Issues
  95.  
  96. If the Train log contains AssertionError in image_augmentation.py you are training with images of the wrong size, make sure you are only training with the 256x256 images created using the Align tool
  97.  
  98. If the Train log contains Missing cudart_64.dll you have the wrong version of CUDA installed (Tensorflow requires 8.0)
  99.  
  100. If the Train log contains MemoryError train.py line 60/line 61 you are probably training with too many images at once for your GPU to handle and should reduce the number of images you are training with (500 is more than sufficient)
  101.  
  102. If the Train log contains OOM when allocating tensor with shape [W, X, Y, Z] the current model is too intensive for your GPU. Try lowering the batch size (to a lower power of 2 than 64) and see if that helps.
  103.  
  104. If the Train log mentions Theano Keras is wrongly trying to use Theano as a backend. Setting the KERAS_BACKEND environment variable to "tensorflow" should fix it. Fixed in 1.1
  105.  
  106. Convert Issues
  107.  
  108. If Convert outputs faces with visible boxes around them, make sure that Seamless is set to 'true' and faces are not too close up in the images you are working with. The scripts this app works with cannot always avoid creating a box on very large faces, but will almost always create a seamless merge with moderately-sized faces.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement