Merge pull request #4 from ilian6806/develop

mmdet and its dependencies removed for now
pull/14/head 1.0.0
Ilian Iliev 2023-05-15 16:52:31 +03:00 committed by GitHub
commit b811a0c54c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 23 deletions

View File

@ -26,29 +26,18 @@ Put all wildcards files in */wildcards* dir.
Use *Install from URL* option with this repo url.
### Requirements
- openmim==0.3.5
- mmcv-full==1.7.1
- mmdet==2.27.0
- lightning-utilities==0.4.0
- pytorch-lightning==1.7.6
- dlib==19.24.0
- setuptools
- cmake
All requirements will be installed on first use.
**NOTE:** Some of these packages are incompatible with newer versions of **lightning-utilities** and **pytorch-lightning**. If some other extensions you use require newer versions, they will be incompatible with this extension.
### Mask types
1. Eyes dlib
2. Face dlib
3. Face depthmask
4. Body depthmask
5. Face mmdet
6. Body mmdet
### Examples

View File

@ -7,8 +7,10 @@ from modules.sd_models import model_hash
from modules import modelloader
from basicsr.utils.download_util import load_file_from_url
include_mmdet = False
dd_models_path = os.path.join(models_path, "mmdet")
def list_models(model_path):
model_list = modelloader.load_models(model_path=model_path, ext_filter=[".pth"])
@ -37,30 +39,34 @@ def list_models(model_path):
python = sys.executable
run(f'"{python}" -m pip install -U openmim', desc=None, errdesc="Couldn't install openmim")
run(f'"{python}" -m pip install lightning-utilities==0.4.0', desc=None, errdesc=f"Couldn't install lightning-utilities")
run(f'"{python}" -m pip install pytorch-lightning==1.7.6', desc=None, errdesc=f"Couldn't install pytorch-lightning")
if include_mmdet:
run(f'"{python}" -m pip install lightning-utilities==0.4.0', desc=None, errdesc=f"Couldn't install lightning-utilities")
run(f'"{python}" -m pip install pytorch-lightning==1.7.6', desc=None, errdesc=f"Couldn't install pytorch-lightning")
if not is_installed("cmake"):
run(f'"{python}" -m pip install cmake', desc="Installing cmake", errdesc="Couldn't install cmake")
if not is_installed("dlib"):
if not is_installed("setuptools"):
run(f'"{python}" -m pip install setuptools', desc="Installing setuptools", errdesc="Couldn't install setuptools")
if not is_installed("dlib"):
try:
run(f'"{python}" -m pip install dlib==19.24.0', desc="Installing dlib", errdesc="Couldn't install dlib")
except Exception as e:
print("----------------------------------------")
print(e)
print("----------------------------------------------")
print("Failed building wheel for dlib")
print("ERROR: CMake must be installed to build dlib")
print("Install cmake from https://cmake.org/download/")
print("----------------------------------------")
print("----------------------------------------------")
if not is_installed("mmdet"):
run(f'"{python}" -m mim install mmcv-full', desc=f"Installing mmcv-full", errdesc=f"Couldn't install mmcv-full")
if include_mmdet and not is_installed("mmdet"):
run(f'"{python}" -m pip install -U openmim==0.3.3', desc=None, errdesc="Couldn't install openmim")
run(f'"{python}" -m mim install mmcv-full==1.7.1', desc=f"Installing mmcv-full", errdesc=f"Couldn't install mmcv-full")
run(f'"{python}" -m pip install mmdet==2.27.0', desc=f"Installing mmdet", errdesc=f"Couldn't install mmdet")
if (len(list_models(dd_models_path)) == 0):
if include_mmdet and (len(list_models(dd_models_path)) == 0):
print("No detection models found, downloading...")
bbox_path = os.path.join(dd_models_path, "bbox")
segm_path = os.path.join(dd_models_path, "segm")

View File

@ -7,7 +7,12 @@ import numpy as np
from PIL import Image, ImageDraw
from .constants import script_models_dir
from .utils import expand_polygon, calculate_distance
from .modules import depthmap, mmdetdd
from .modules import depthmap
try:
from .modules import mmdetdd
except Exception as e:
pass
depthmap_generator = depthmap.SimpleDepthMapGenerator()

View File

@ -16,8 +16,8 @@ class EyeMasksCore():
'Face dlib',
'Face depth',
'Body depth',
'Face mmdet',
'Body mmdet'
# 'Face mmdet',
# 'Body mmdet'
]
MASK_TYPE_EYES_DLIB = utils.index(MASK_TYPES, 'Eyes dlib')

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 64 KiB