mirror of
https://github.com/facefusion/facefusion.git
synced 2026-05-15 19:27:59 +02:00
Refactor/windows libraries (#1099)
* ship libssl and libcrypto in windows * ship libssl and libcrypto in windows
This commit is contained in:
@@ -15,16 +15,16 @@ def create_static_library_set() -> Optional[LibrarySet]:
|
||||
{
|
||||
'hashes':
|
||||
{
|
||||
'datachannel':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'linux/libdatachannel.hash'),
|
||||
'path': resolve_relative_path('../.libraries/libdatachannel.hash')
|
||||
},
|
||||
'crypto':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'linux/libcrypto.hash'),
|
||||
'path': resolve_relative_path('../.libraries/libcrypto.hash')
|
||||
},
|
||||
'datachannel':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'linux/libdatachannel.hash'),
|
||||
'path': resolve_relative_path('../.libraries/libdatachannel.hash')
|
||||
},
|
||||
'ssl':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'linux/libssl.hash'),
|
||||
@@ -33,16 +33,16 @@ def create_static_library_set() -> Optional[LibrarySet]:
|
||||
},
|
||||
'sources':
|
||||
{
|
||||
'datachannel':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'linux/libdatachannel.so'),
|
||||
'path': resolve_relative_path('../.libraries/libdatachannel.so')
|
||||
},
|
||||
'crypto':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'linux/libcrypto.so'),
|
||||
'path': resolve_relative_path('../.libraries/libcrypto.so')
|
||||
},
|
||||
'datachannel':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'linux/libdatachannel.so'),
|
||||
'path': resolve_relative_path('../.libraries/libdatachannel.so')
|
||||
},
|
||||
'ssl':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'linux/libssl.so'),
|
||||
@@ -55,16 +55,16 @@ def create_static_library_set() -> Optional[LibrarySet]:
|
||||
{
|
||||
'hashes':
|
||||
{
|
||||
'datachannel':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'macos/libdatachannel.hash'),
|
||||
'path': resolve_relative_path('../.libraries/libdatachannel.hash')
|
||||
},
|
||||
'crypto':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'macos/libcrypto.hash'),
|
||||
'path': resolve_relative_path('../.libraries/libcrypto.hash')
|
||||
},
|
||||
'datachannel':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'macos/libdatachannel.hash'),
|
||||
'path': resolve_relative_path('../.libraries/libdatachannel.hash')
|
||||
},
|
||||
'ssl':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'macos/libssl.hash'),
|
||||
@@ -73,16 +73,16 @@ def create_static_library_set() -> Optional[LibrarySet]:
|
||||
},
|
||||
'sources':
|
||||
{
|
||||
'datachannel':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'macos/libdatachannel.dylib'),
|
||||
'path': resolve_relative_path('../.libraries/libdatachannel.dylib')
|
||||
},
|
||||
'crypto':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'macos/libcrypto.dylib'),
|
||||
'path': resolve_relative_path('../.libraries/libcrypto.dylib')
|
||||
},
|
||||
'datachannel':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'macos/libdatachannel.dylib'),
|
||||
'path': resolve_relative_path('../.libraries/libdatachannel.dylib')
|
||||
},
|
||||
'ssl':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'macos/libssl.dylib'),
|
||||
@@ -95,18 +95,38 @@ def create_static_library_set() -> Optional[LibrarySet]:
|
||||
{
|
||||
'hashes':
|
||||
{
|
||||
'crypto':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'windows/crypto.hash'),
|
||||
'path': resolve_relative_path('../.libraries/crypto.hash')
|
||||
},
|
||||
'datachannel':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0', 'windows/datachannel.hash'),
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'windows/datachannel.hash'),
|
||||
'path': resolve_relative_path('../.libraries/datachannel.hash')
|
||||
},
|
||||
'ssl':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'windows/ssl.hash'),
|
||||
'path': resolve_relative_path('../.libraries/ssl.hash')
|
||||
}
|
||||
},
|
||||
'sources':
|
||||
{
|
||||
'crypto':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'windows/crypto.dll'),
|
||||
'path': resolve_relative_path('../.libraries/crypto.dll')
|
||||
},
|
||||
'datachannel':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0', 'windows/datachannel.dll'),
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'windows/datachannel.dll'),
|
||||
'path': resolve_relative_path('../.libraries/datachannel.dll')
|
||||
},
|
||||
'ssl':
|
||||
{
|
||||
'url': resolve_download_url_by_provider('huggingface', 'libraries-4.0.0-a', 'windows/ssl.dll'),
|
||||
'path': resolve_relative_path('../.libraries/ssl.dll')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -123,18 +143,18 @@ def pre_check() -> bool:
|
||||
|
||||
@lru_cache
|
||||
def create_static_library() -> Optional[ctypes.CDLL]:
|
||||
datachannel_source_path = create_static_library_set().get('sources').get('datachannel').get('path')
|
||||
crypto_source_path = create_static_library_set().get('sources').get('crypto').get('path')
|
||||
datachannel_source_path = create_static_library_set().get('sources').get('datachannel').get('path')
|
||||
ssl_source_path = create_static_library_set().get('sources').get('ssl').get('path')
|
||||
|
||||
if datachannel_source_path:
|
||||
if crypto_source_path and ssl_source_path:
|
||||
ctypes.CDLL(crypto_source_path)
|
||||
ctypes.CDLL(ssl_source_path)
|
||||
|
||||
if crypto_source_path and datachannel_source_path and ssl_source_path:
|
||||
if is_windows():
|
||||
ctypes.CDLL(crypto_source_path, winmode = 0)
|
||||
ctypes.CDLL(ssl_source_path, winmode = 0)
|
||||
library = ctypes.CDLL(datachannel_source_path, winmode = 0)
|
||||
else:
|
||||
ctypes.CDLL(crypto_source_path)
|
||||
ctypes.CDLL(ssl_source_path)
|
||||
library = ctypes.CDLL(datachannel_source_path)
|
||||
|
||||
if library:
|
||||
|
||||
@@ -3,6 +3,7 @@ onnx==1.20.1
|
||||
onnxruntime==1.24.1
|
||||
opencv-python==4.13.0.92
|
||||
psutil==7.2.2
|
||||
python-multipart==0.0.28
|
||||
tqdm==4.67.3
|
||||
scipy==1.16.3
|
||||
starlette==0.52.1
|
||||
|
||||
Reference in New Issue
Block a user