mirror of
https://github.com/facefusion/facefusion.git
synced 2026-07-08 03:27:52 +02:00
setup_platform is no longer needed, bring back conda.py
This commit is contained in:
+2
-3
@@ -4,9 +4,8 @@ import os
|
|||||||
|
|
||||||
os.environ['OMP_NUM_THREADS'] = '1'
|
os.environ['OMP_NUM_THREADS'] = '1'
|
||||||
|
|
||||||
from facefusion import core, environment
|
from facefusion import conda, core
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
environment.setup_conda()
|
conda.setup()
|
||||||
environment.setup_platform()
|
|
||||||
core.cli()
|
core.cli()
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from facefusion.common_helper import is_linux, is_macos, is_windows
|
from facefusion.common_helper import is_linux, is_windows
|
||||||
|
|
||||||
|
|
||||||
def setup_conda() -> None:
|
def setup() -> None:
|
||||||
conda_prefix = os.getenv('CONDA_PREFIX')
|
conda_prefix = os.getenv('CONDA_PREFIX')
|
||||||
conda_ready = os.getenv('CONDA_READY')
|
conda_ready = os.getenv('CONDA_READY')
|
||||||
|
|
||||||
@@ -39,23 +39,3 @@ def setup_conda() -> None:
|
|||||||
library_paths.append(os.getenv('PATH'))
|
library_paths.append(os.getenv('PATH'))
|
||||||
os.environ['PATH'] = os.pathsep.join(library_paths)
|
os.environ['PATH'] = os.pathsep.join(library_paths)
|
||||||
os.environ['CONDA_READY'] = '1'
|
os.environ['CONDA_READY'] = '1'
|
||||||
|
|
||||||
|
|
||||||
def setup_platform() -> None:
|
|
||||||
homebrew_prefix = os.environ.get('HOMEBREW_PREFIX')
|
|
||||||
platform_ready = os.getenv('PLATFORM_READY')
|
|
||||||
|
|
||||||
if homebrew_prefix and not platform_ready:
|
|
||||||
if is_macos():
|
|
||||||
library_paths =\
|
|
||||||
[
|
|
||||||
os.path.join(homebrew_prefix, 'lib'),
|
|
||||||
os.path.join(homebrew_prefix, 'opt', 'openssl', 'lib')
|
|
||||||
]
|
|
||||||
library_paths = list(filter(os.path.exists, library_paths))
|
|
||||||
|
|
||||||
if library_paths:
|
|
||||||
if os.getenv('DYLD_LIBRARY_PATH'):
|
|
||||||
library_paths.append(os.getenv('DYLD_LIBRARY_PATH'))
|
|
||||||
os.environ['DYLD_LIBRARY_PATH'] = os.pathsep.join(library_paths)
|
|
||||||
os.environ['PLATFORM_READY'] = '1'
|
|
||||||
@@ -7,7 +7,7 @@ import numpy
|
|||||||
import pytest
|
import pytest
|
||||||
from starlette.testclient import TestClient
|
from starlette.testclient import TestClient
|
||||||
|
|
||||||
from facefusion import environment, metadata, session_manager, state_manager
|
from facefusion import metadata, session_manager, state_manager
|
||||||
from facefusion.apis import asset_store
|
from facefusion.apis import asset_store
|
||||||
from facefusion.apis.core import create_api
|
from facefusion.apis.core import create_api
|
||||||
from facefusion.core import common_pre_check, processors_pre_check
|
from facefusion.core import common_pre_check, processors_pre_check
|
||||||
@@ -36,8 +36,6 @@ def before_all() -> None:
|
|||||||
state_manager.init_item('face_swapper_model', 'hyperswap_1a_256')
|
state_manager.init_item('face_swapper_model', 'hyperswap_1a_256')
|
||||||
state_manager.init_item('face_swapper_pixel_boost', '256x256')
|
state_manager.init_item('face_swapper_pixel_boost', '256x256')
|
||||||
|
|
||||||
environment.setup_platform()
|
|
||||||
|
|
||||||
common_pre_check()
|
common_pre_check()
|
||||||
processors_pre_check()
|
processors_pre_check()
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import ctypes
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from facefusion import environment, state_manager
|
from facefusion import state_manager
|
||||||
from facefusion.libraries import datachannel as datachannel_module
|
from facefusion.libraries import datachannel as datachannel_module
|
||||||
|
|
||||||
|
|
||||||
@@ -10,8 +10,6 @@ from facefusion.libraries import datachannel as datachannel_module
|
|||||||
def before_all() -> None:
|
def before_all() -> None:
|
||||||
state_manager.init_item('download_providers', [ 'github', 'huggingface' ])
|
state_manager.init_item('download_providers', [ 'github', 'huggingface' ])
|
||||||
|
|
||||||
environment.setup_platform()
|
|
||||||
|
|
||||||
datachannel_module.pre_check()
|
datachannel_module.pre_check()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -2,7 +2,7 @@ from typing import List
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from facefusion import environment, rtc, state_manager
|
from facefusion import rtc, state_manager
|
||||||
from facefusion.libraries import datachannel as datachannel_module, opus as opus_module, vpx as vpx_module
|
from facefusion.libraries import datachannel as datachannel_module, opus as opus_module, vpx as vpx_module
|
||||||
from facefusion.types import RtcPeer
|
from facefusion.types import RtcPeer
|
||||||
|
|
||||||
@@ -11,8 +11,6 @@ from facefusion.types import RtcPeer
|
|||||||
def before_all() -> None:
|
def before_all() -> None:
|
||||||
state_manager.init_item('download_providers', [ 'github', 'huggingface' ])
|
state_manager.init_item('download_providers', [ 'github', 'huggingface' ])
|
||||||
|
|
||||||
environment.setup_platform()
|
|
||||||
|
|
||||||
datachannel_module.pre_check()
|
datachannel_module.pre_check()
|
||||||
opus_module.pre_check()
|
opus_module.pre_check()
|
||||||
vpx_module.pre_check()
|
vpx_module.pre_check()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from facefusion import environment, state_manager
|
from facefusion import state_manager
|
||||||
from facefusion.libraries import datachannel as datachannel_module, opus as opus_module, vpx as vpx_module
|
from facefusion.libraries import datachannel as datachannel_module, opus as opus_module, vpx as vpx_module
|
||||||
|
|
||||||
|
|
||||||
@@ -8,8 +8,6 @@ from facefusion.libraries import datachannel as datachannel_module, opus as opus
|
|||||||
def before_all() -> None:
|
def before_all() -> None:
|
||||||
state_manager.init_item('download_providers', [ 'github', 'huggingface' ])
|
state_manager.init_item('download_providers', [ 'github', 'huggingface' ])
|
||||||
|
|
||||||
environment.setup_platform()
|
|
||||||
|
|
||||||
datachannel_module.pre_check()
|
datachannel_module.pre_check()
|
||||||
opus_module.pre_check()
|
opus_module.pre_check()
|
||||||
vpx_module.pre_check()
|
vpx_module.pre_check()
|
||||||
|
|||||||
Reference in New Issue
Block a user