mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 04:52:13 -07:00
refactoring
This commit is contained in:
parent
246129a964
commit
8153e90ba3
13 changed files with 80 additions and 186 deletions
|
@ -5,8 +5,7 @@ import cv2
|
|||
import numpy as np
|
||||
|
||||
from utils.cv2_utils import *
|
||||
from utils.DFLJPG import DFLJPG
|
||||
from utils.DFLPNG import DFLPNG
|
||||
from DFLIMG import *
|
||||
|
||||
|
||||
class SampleType(IntEnum):
|
||||
|
@ -87,13 +86,8 @@ class Sample(object):
|
|||
|
||||
def load_fanseg_mask(self):
|
||||
if self.fanseg_mask_exist:
|
||||
filepath = Path(self.filename)
|
||||
if filepath.suffix == '.png':
|
||||
dflimg = DFLPNG.load ( str(filepath), loader_func=self.read_raw_file )
|
||||
elif filepath.suffix == '.jpg':
|
||||
dflimg = DFLJPG.load ( str(filepath), loader_func=self.read_raw_file )
|
||||
else:
|
||||
dflimg = None
|
||||
filepath = Path(self.filename)
|
||||
dflimg = DFLIMG.load (filepath)
|
||||
return dflimg.get_fanseg_mask()
|
||||
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue