okaris/roop 🖼️✓ → 🖼️

▶️ 9.0M runs 📅 May 2023 ⚙️ Cog 0.8.5
image-face-swap video-editing video-face-swap

About

chameleonn: one-click face swap (formerly roop)

Example Output

Output

Performance Metrics

74.42s Prediction Time
334.98s Total Time
All Input Parameters
{
  "source": "https://replicate.delivery/pbxt/Iuqa9NKGjfnWYxsRDRzTsHEvRDzAlmv2u20mk2PsLZ1ZRR8k/Reunia%CC%83o_com_o_ator_norte-americano_Keanu_Reeves_%28cropped%29.jpg",
  "target": "https://replicate.delivery/pbxt/Iuqa9ruhfJLtB38Xqlzkdq4EcbsXHJRiG9DDqJ66gPdibjDw/Terminator%202_%20%20Hasta%20La%20Vista%20Baby%204K%20Remastered%202017%20_%203D.mp4",
  "keep_fps": true,
  "keep_frames": true
}
Input Parameters
source Type: string
Source
target Type: string
Target
keep_fps Type: booleanDefault: true
Keep FPS
keep_frames Type: booleanDefault: true
Keep Frames
enhance_face Type: booleanDefault: false
Enhance Face
Output Schema

Output

Type: arrayItems Type: stringItems Format: uri

Example Execution Logs
source:  /tmp/tmp_1wqat1uReunia%CC%83o_com_o_ator_norte-americano_Keanu_Reeves_(cropped).jpg
target:  /tmp/tmpyuqlcs_7Terminator%202_%20%20Hasta%20La%20Vista%20Baby%204K%20Remastered%202017%20_%203D.mp4
keep_fps:  True
keep_frames:  True
/root/.pyenv/versions/3.8.16/lib/python3.8/site-packages/insightface/utils/transform.py:68: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.
P = np.linalg.lstsq(X_homo, Y)[0].T # Affine matrix. 3 x 4
Status: detecting video's FPS...
Status: extracting frames...
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
libpostproc    55.  9.100 / 55.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/tmpyuqlcs_7Terminator%202_%20%20Hasta%20La%20Vista%20Baby%204K%20Remastered%202017%20_%203D.mp4':
Metadata:
major_brand     : mp42
minor_version   : 1
compatible_brands: isommp41mp42
creation_time   : 2023-05-30T21:46:31.000000Z
Duration: 00:00:05.83, start: 0.000000, bitrate: 2770 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 1614 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
Metadata:
creation_time   : 2023-05-30T21:46:31.000000Z
handler_name    : Core Media Video
vendor_id       : [0][0][0][0]
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
creation_time   : 2023-05-30T21:46:31.000000Z
handler_name    : Core Media Audio
vendor_id       : [0][0][0][0]
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> png (native))
Press [q] to stop, [?] for help
Output #0, image2, to './output/%04d.png':
Metadata:
major_brand     : mp42
minor_version   : 1
compatible_brands: isommp41mp42
encoder         : Lavf58.76.100
Stream #0:0(und): Video: png, rgb24(pc, gbr/bt709/bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 29.97 fps, 29.97 tbn (default)
Metadata:
creation_time   : 2023-05-30T21:46:31.000000Z
handler_name    : Core Media Video
vendor_id       : [0][0][0][0]
encoder         : Lavc58.134.100 png
frame=    1 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed=   0x
frame=   52 fps=0.0 q=-0.0 size=N/A time=00:00:01.33 bitrate=N/A speed=2.13x
frame=  106 fps= 94 q=-0.0 size=N/A time=00:00:03.13 bitrate=N/A speed=2.78x
frame=  160 fps= 98 q=-0.0 size=N/A time=00:00:04.93 bitrate=N/A speed=3.03x
frame=  175 fps= 94 q=-0.0 Lsize=N/A time=00:00:05.83 bitrate=N/A speed=3.14x
video:117575kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Status: swapping in progress...
..........................................................................................................................................S......................SS..SS.....SS.Processing time: 65.28 seconds
Status: creating video...
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
libpostproc    55.  9.100 / 55.  9.100
Input #0, image2, from './output/%04d.png':
Duration: 00:00:06.03, start: 0.000000, bitrate: N/A
Stream #0:0: Video: png, rgb24(pc), 1280x720, 29 fps, 29 tbr, 29 tbn, 29 tbc
Stream mapping:
Stream #0:0 -> #0:0 (png (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x5577903f6b00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512
[libx264 @ 0x5577903f6b00] profile High, level 3.1, 4:2:0, 8-bit
[libx264 @ 0x5577903f6b00] 264 - core 163 r3060 5db6aa6 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=18 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to './output/output.mp4':
Metadata:
encoder         : Lavf58.76.100
Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, progressive), 1280x720, q=2-31, 29 fps, 14848 tbn
Metadata:
encoder         : Lavc58.134.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x
frame=   52 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x
frame=   97 fps= 93 q=29.0 size=     256kB time=00:00:01.10 bitrate=1900.8kbits/s speed=1.06x
frame=  146 fps= 94 q=29.0 size=     512kB time=00:00:02.79 bitrate=1501.8kbits/s speed=1.81x
frame=  175 fps= 74 q=-1.0 Lsize=    1252kB time=00:00:05.93 bitrate=1729.8kbits/s speed=2.52x
video:1250kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.228834%
[libx264 @ 0x5577903f6b00] frame I:3     Avg QP:19.68  size: 31322
[libx264 @ 0x5577903f6b00] frame P:48    Avg QP:22.74  size: 11841
[libx264 @ 0x5577903f6b00] frame B:124   Avg QP:25.69  size:  4972
[libx264 @ 0x5577903f6b00] consecutive B-frames:  5.1%  0.0%  3.4% 91.4%
[libx264 @ 0x5577903f6b00] mb I  I16..4: 29.3% 55.7% 15.1%
[libx264 @ 0x5577903f6b00] mb P  I16..4:  7.2% 16.7%  1.2%  P16..4: 26.2%  6.9%  1.8%  0.0%  0.0%    skip:40.1%
[libx264 @ 0x5577903f6b00] mb B  I16..4:  1.1%  2.9%  0.1%  B16..8: 24.0%  3.7%  0.6%  direct: 2.3%  skip:65.3%  L0:46.4% L1:48.4% BI: 5.2%
[libx264 @ 0x5577903f6b00] 8x8 transform intra:65.9% inter:85.9%
[libx264 @ 0x5577903f6b00] coded y,uvDC,uvAC intra: 38.6% 67.0% 21.2% inter: 8.1% 13.0% 0.2%
[libx264 @ 0x5577903f6b00] i16 v,h,dc,p: 29% 25%  7% 38%
[libx264 @ 0x5577903f6b00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 19% 18%  4%  6%  8%  5%  6%  5%
[libx264 @ 0x5577903f6b00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 24% 18%  5%  7%  6%  6%  5%  4%
[libx264 @ 0x5577903f6b00] i8c dc,h,v,p: 38% 21% 25% 15%
[libx264 @ 0x5577903f6b00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x5577903f6b00] ref P L0: 61.2% 12.1% 19.4%  7.3%
[libx264 @ 0x5577903f6b00] ref B L0: 84.5% 12.3%  3.2%
[libx264 @ 0x5577903f6b00] ref B L1: 94.6%  5.4%
[libx264 @ 0x5577903f6b00] kb/s:1695.37
Status: adding audio...
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
libpostproc    55.  9.100 / 55.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './output/output.mp4':
Metadata:
major_brand     : isom
minor_version   : 512
compatible_brands: isomiso2avc1mp41
encoder         : Lavf58.76.100
Duration: 00:00:06.04, start: 0.000000, bitrate: 1700 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 1696 kb/s, 29 fps, 29 tbr, 14848 tbn, 58 tbc (default)
Metadata:
handler_name    : VideoHandler
vendor_id       : [0][0][0][0]
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from './output/tmpyuqlcs_7Terminator%202_%20%20Hasta%20La%20Vista%20Baby%204K%20Remastered%202017%20_%203D.mp4':
Metadata:
major_brand     : mp42
minor_version   : 1
compatible_brands: isommp41mp42
creation_time   : 2023-05-30T21:46:31.000000Z
Duration: 00:00:05.83, start: 0.000000, bitrate: 2770 kb/s
Stream #1:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 1614 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
Metadata:
creation_time   : 2023-05-30T21:46:31.000000Z
handler_name    : Core Media Video
vendor_id       : [0][0][0][0]
Stream #1:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
creation_time   : 2023-05-30T21:46:31.000000Z
handler_name    : Core Media Audio
vendor_id       : [0][0][0][0]
Output ./output/output.mp4 same as Input #0 - exiting
FFmpeg cannot edit existing files in-place.
Video saved as: ./output/output.mp4
Status: swap successful!
Version Details
Version ID
8c1e100ecabb3151cf1e6c62879b6de7a4b84602de464ed249b6cff0b86211d8
Version Created
August 8, 2023
Run on Replicate →