add gender selection in build
This commit is contained in:
@@ -73,14 +73,14 @@ def get_current_swap_model() -> str:
|
||||
model = models[0] if len(models) else None
|
||||
logger.info("Try to use model : %s", model)
|
||||
try:
|
||||
if not os.path.isfile(model): # type: ignore
|
||||
if not model or not os.path.isfile(model): # type: ignore
|
||||
logger.error("The model %s cannot be found or loaded", model)
|
||||
raise FileNotFoundError(
|
||||
"No faceswap model found. Please add it to the faceswaplab directory."
|
||||
"No faceswap model found. Please add it to the faceswaplab directory. Ensure the model is in the proper directory (<sdwebui>/models/faceswaplab/inswapper_128.onnx)"
|
||||
)
|
||||
except:
|
||||
raise FileNotFoundError(
|
||||
"Was not able to check model, please ensure the model is in the proper directory"
|
||||
"No faceswap model found. Please add it to the faceswaplab directory. Ensure the model is in the proper directory (<sdwebui>/models/faceswaplab/inswapper_128.onnx)"
|
||||
)
|
||||
|
||||
assert model is not None
|
||||
|
||||
@@ -3,8 +3,15 @@ from numpy import uint8
|
||||
from insightface.app.common import Face as IFace
|
||||
from PIL import Image
|
||||
import numpy as np
|
||||
from enum import Enum
|
||||
|
||||
PILImage = Image.Image
|
||||
CV2ImgU8 = np.ndarray[int, np.dtype[uint8]]
|
||||
Face = IFace
|
||||
BoxCoords = Tuple[int, int, int, int]
|
||||
|
||||
|
||||
class Gender(Enum):
|
||||
AUTO = -1
|
||||
FEMALE = 0
|
||||
MALE = 1
|
||||
|
||||
Reference in New Issue
Block a user