{"id":205,"date":"2024-02-24T21:17:34","date_gmt":"2024-02-24T21:17:34","guid":{"rendered":"https:\/\/zahiralam.com\/blog\/?p=205"},"modified":"2024-07-29T12:01:12","modified_gmt":"2024-07-29T12:01:12","slug":"faceswapping-on-mac-m1-m2-and-m3-a-guide-to-the-roop-project","status":"publish","type":"post","link":"https:\/\/zahiralam.com\/blog\/faceswapping-on-mac-m1-m2-and-m3-a-guide-to-the-roop-project\/","title":{"rendered":"Face swapping on Mac M1, M2, and M3: A Guide to the Roop Project"},"content":{"rendered":"\n<p><strong>Note:<\/strong> The Roop project has been discontinued by its creator. The latest open-source technology for face swapping on Mac systems is <a href=\"https:\/\/zahiralam.com\/blog\/how-to-install-facefusion-on-mac-m1-m2-m3-swap-faces-in-pictures-and-videos-without-any-hassle\/\">FaceFusion<\/a>. While the instructions in this article for the Roop Project will still work in most cases, it&#8217;s recommended to use the latest technology.\n\n\n\n<p>To install <a href=\"https:\/\/zahiralam.com\/blog\/how-to-install-facefusion-on-mac-m1-m2-m3-swap-faces-in-pictures-and-videos-without-any-hassle\/\">FaceFusion<\/a> on your system, follow the instructions in this link:\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-zahirs-blog wp-block-embed-zahirs-blog\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"mBsKDRpJ0I\"><a href=\"https:\/\/zahiralam.com\/blog\/how-to-install-facefusion-on-mac-m1-m2-m3-swap-faces-in-pictures-and-videos-without-any-hassle\/\">How to Install FaceFusion on Mac M1, M2, M3: Swap Faces in Pictures and Videos Without Any Hassle<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;How to Install FaceFusion on Mac M1, M2, M3: Swap Faces in Pictures and Videos Without Any Hassle&#8221; &#8212; Zahirs Blog\" src=\"https:\/\/zahiralam.com\/blog\/how-to-install-facefusion-on-mac-m1-m2-m3-swap-faces-in-pictures-and-videos-without-any-hassle\/embed\/#?secret=A0nuLG8NEO#?secret=mBsKDRpJ0I\" data-secret=\"mBsKDRpJ0I\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Face swapping, the process of seamlessly replacing one face with another in images or videos, has become increasingly accessible thanks to advances in deep learning and projects like Roop. While traditionally resource-intensive, Roop aims to bring face swapping capabilities to powerful machines like the Apple Silicon-powered M1, M2, and M3 Macs.\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Setting Up Your Environment<\/strong><\/h2>\n\n\n\n<p><strong>Install Conda:<\/strong> Download and install Miniconda or Anaconda to manage your Python environment. Check below mentioned article. \n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-zahirs-blog wp-block-embed-zahirs-blog\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"aUgBytznMf\"><a href=\"https:\/\/zahiralam.com\/blog\/conda-installation-on-apple-silicon-mac-simplified-step-by-step-instructions\/\">Conda Installation on Apple Silicon Mac: Simplified Step-by-Step Instructions<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Conda Installation on Apple Silicon Mac: Simplified Step-by-Step Instructions&#8221; &#8212; Zahirs Blog\" src=\"https:\/\/zahiralam.com\/blog\/conda-installation-on-apple-silicon-mac-simplified-step-by-step-instructions\/embed\/#?secret=UeXp0mzEtl#?secret=aUgBytznMf\" data-secret=\"aUgBytznMf\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><strong>Create Environment:<\/strong>\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-1\">conda create -n roop-faceswap python=3.10\nconda activate roop-faceswap<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#conda%20create%20-n%20roop-faceswap%20python%3D3.10%0Aconda%20activate%20roop-faceswap\">\n                            <button class=\"copy-button\" data-label=\"conda create -n roop-faceswap python=3.10\nconda activate roop-faceswap\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p><strong>Clone the Roop Repository:<\/strong>\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-2\">git clone https:\/\/github.com\/s0md3v\/roop.git\ncd roop<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#git%20clone%20https%3A%2F%2Fgithub.com%2Fs0md3v%2Froop.git%0Acd%20roop\">\n                            <button class=\"copy-button\" data-label=\"git clone https:\/\/github.com\/s0md3v\/roop.git\ncd roop\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p><strong>Install FFmpeg<\/strong>:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-3\">brew install ffmpeg<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#brew%20install%20ffmpeg\">\n                            <button class=\"copy-button\" data-label=\"brew install ffmpeg\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p><strong>Install Initial Dependencies:<\/strong>\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-4\">pip install -r requirements.txt<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#pip%20install%20-r%20requirements.txt\">\n                            <button class=\"copy-button\" data-label=\"pip install -r requirements.txt\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Troubleshooting M1-Specific Issues<\/strong>:<\/h2>\n\n\n\n<p>If you encounter errors during installation, you likely need to adapt the <code>requirements.txt<\/code> file for compatibility. Edit <code>requirements.txt<\/code> and paste below lines:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-5\"># PyTorch should be installed according to the official instructions for M1 Macs from the PyTorch website\n\nnumpy==1.24.3\nopencv-python==4.8.0.74  # Ensure this version is compatible with M1, or consider using opencv-python-headless if GUI is not required\nonnx==1.14.0\n\n# insightface should be verified for compatibility or installed from source if needed\ninsightface==0.7.3\n\npsutil==5.9.5\ntk==0.1.0  # GUI libraries may have issues on M1; verify compatibility\ncustomtkinter==5.2.0  # Same as above regarding GUI libraries\n\n# Conditional installation for tkinterdnd2 based on platform; this should be fine as is\ntkinterdnd2==0.3.0; sys_platform != &#039;darwin&#039; and platform_machine != &#039;arm64&#039;\ntkinterdnd2-universal==1.7.3; sys_platform == &#039;darwin&#039; and platform_machine == &#039;arm64&#039;\n\npillow==10.0.0\n\n# Specific onnxruntime version for M1 Mac\nonnxruntime-silicon==1.13.1; sys_platform == &#039;darwin&#039; and platform_machine == &#039;arm64&#039;\n\n# TensorFlow installation should be adapted for M1 Macs, possibly using a version built for ARM64 or TensorFlow-Metal\ntensorflow==2.13.0  # Verify compatibility or consider TensorFlow-Metal for M1 Macs\n\nopennsfw2==0.10.2  # Verify compatibility\nprotobuf==4.23.4\ntqdm==4.65.0\n\n# gfpgan should be verified for compatibility or installed from source if needed\ngfpgan==1.3.8<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#%23%20PyTorch%20should%20be%20installed%20according%20to%20the%20official%20instructions%20for%20M1%20Macs%20from%20the%20PyTorch%20website%0A%0Anumpy%3D%3D1.24.3%0Aopencv-python%3D%3D4.8.0.74%20%20%23%20Ensure%20this%20version%20is%20compatible%20with%20M1%2C%20or%20consider%20using%20opencv-python-headless%20if%20GUI%20is%20not%20required%0Aonnx%3D%3D1.14.0%0A%0A%23%20insightface%20should%20be%20verified%20for%20compatibility%20or%20installed%20from%20source%20if%20needed%0Ainsightface%3D%3D0.7.3%0A%0Apsutil%3D%3D5.9.5%0Atk%3D%3D0.1.0%20%20%23%20GUI%20libraries%20may%20have%20issues%20on%20M1%3B%20verify%20compatibility%0Acustomtkinter%3D%3D5.2.0%20%20%23%20Same%20as%20above%20regarding%20GUI%20libraries%0A%0A%23%20Conditional%20installation%20for%20tkinterdnd2%20based%20on%20platform%3B%20this%20should%20be%20fine%20as%20is%0Atkinterdnd2%3D%3D0.3.0%3B%20sys_platform%20%21%3D%20%27darwin%27%20and%20platform_machine%20%21%3D%20%27arm64%27%0Atkinterdnd2-universal%3D%3D1.7.3%3B%20sys_platform%20%3D%3D%20%27darwin%27%20and%20platform_machine%20%3D%3D%20%27arm64%27%0A%0Apillow%3D%3D10.0.0%0A%0A%23%20Specific%20onnxruntime%20version%20for%20M1%20Mac%0Aonnxruntime-silicon%3D%3D1.13.1%3B%20sys_platform%20%3D%3D%20%27darwin%27%20and%20platform_machine%20%3D%3D%20%27arm64%27%0A%0A%23%20TensorFlow%20installation%20should%20be%20adapted%20for%20M1%20Macs%2C%20possibly%20using%20a%20version%20built%20for%20ARM64%20or%20TensorFlow-Metal%0Atensorflow%3D%3D2.13.0%20%20%23%20Verify%20compatibility%20or%20consider%20TensorFlow-Metal%20for%20M1%20Macs%0A%0Aopennsfw2%3D%3D0.10.2%20%20%23%20Verify%20compatibility%0Aprotobuf%3D%3D4.23.4%0Atqdm%3D%3D4.65.0%0A%0A%23%20gfpgan%20should%20be%20verified%20for%20compatibility%20or%20installed%20from%20source%20if%20needed%0Agfpgan%3D%3D1.3.8\">\n                            <button class=\"copy-button\" data-label=\"# PyTorch should be installed according to the official instructions for M1 Macs from the PyTorch website\n\nnumpy==1.24.3\nopencv-python==4.8.0.74  # Ensure this version is compatible with M1, or consider using opencv-python-headless if GUI is not required\nonnx==1.14.0\n\n# insightface should be verified for compatibility or installed from source if needed\ninsightface==0.7.3\n\npsutil==5.9.5\ntk==0.1.0  # GUI libraries may have issues on M1; verify compatibility\ncustomtkinter==5.2.0  # Same as above regarding GUI libraries\n\n# Conditional installation for tkinterdnd2 based on platform; this should be fine as is\ntkinterdnd2==0.3.0; sys_platform != &#039;darwin&#039; and platform_machine != &#039;arm64&#039;\ntkinterdnd2-universal==1.7.3; sys_platform == &#039;darwin&#039; and platform_machine == &#039;arm64&#039;\n\npillow==10.0.0\n\n# Specific onnxruntime version for M1 Mac\nonnxruntime-silicon==1.13.1; sys_platform == &#039;darwin&#039; and platform_machine == &#039;arm64&#039;\n\n# TensorFlow installation should be adapted for M1 Macs, possibly using a version built for ARM64 or TensorFlow-Metal\ntensorflow==2.13.0  # Verify compatibility or consider TensorFlow-Metal for M1 Macs\n\nopennsfw2==0.10.2  # Verify compatibility\nprotobuf==4.23.4\ntqdm==4.65.0\n\n# gfpgan should be verified for compatibility or installed from source if needed\ngfpgan==1.3.8\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>Additionally, install PyTorch and its related libraries with:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-6\">pip install torch torchvision torchaudio<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#pip%20install%20torch%20torchvision%20torchaudio\">\n                            <button class=\"copy-button\" data-label=\"pip install torch torchvision torchaudio\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Running Roop<\/strong>:<\/h2>\n\n\n\n<p>Once all dependencies are successfully installed:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-7\">python run.py<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#python%20run.py\">\n                            <button class=\"copy-button\" data-label=\"python run.py\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>Keep in mind that the first time you run Roop, it will download necessary models, which might take some time depending on your internet connection.\n\n\n\n<p>It will open a window: \n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"662\" src=\"https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/02\/roop-first-page-1024x662.png\" alt=\"\" class=\"wp-image-206\" srcset=\"https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/02\/roop-first-page-1024x662.png 1024w, https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/02\/roop-first-page-300x194.png 300w, https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/02\/roop-first-page-768x496.png 768w, https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/02\/roop-first-page-1536x993.png 1536w, https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/02\/roop-first-page-2048x1324.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><code>Select a face<\/code> as a source (image) and in <code>Select a target<\/code> as a target (image or video) and click <code>Start<\/code>.\n\n\n\n<p>Enjoy Face Swap \n\n\n\n<h2 class=\"wp-block-heading\">Conclusion:<\/h2>\n\n\n\n<p>Running faceswap projects like Roop on the latest Apple silicon requires careful configuration to ensure compatibility and performance. By following the steps outlined in this guide, users can set up their Mac M1, M2, or M3 for efficient faceswap operations with the Roop project. This opens up exciting possibilities for creators and developers in various multimedia and creative fields.\n","protected":false},"excerpt":{"rendered":"<p>Note: The Roop project has been discontinued by its creator. The latest open-source technology for face swapping on Mac systems is FaceFusion. While the instructions [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":766,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[214],"tags":[28,36,46,17],"class_list":["post-205","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-installation","tag-apple-silicon","tag-conda","tag-faceswap","tag-mac-m1-m2-m3"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/comments?post=205"}],"version-history":[{"count":7,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/205\/revisions"}],"predecessor-version":[{"id":814,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/205\/revisions\/814"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/media\/766"}],"wp:attachment":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/media?parent=205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/categories?post=205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/tags?post=205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}