mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-15 01:23:44 -07:00
Added faceset resize tool via
4.2) data_src util faceset resize.bat 5.2) data_dst util faceset resize.bat Resize faceset to match model resolution to reduce CPU load during training. Don’t forget to keep original faceset.
This commit is contained in:
parent
e47b602ec8
commit
f387179cba
2 changed files with 17 additions and 1 deletions
|
@ -77,6 +77,8 @@ class SegIEPoly():
|
||||||
self.pts = np.array(pts)
|
self.pts = np.array(pts)
|
||||||
self.n_max = self.n = len(pts)
|
self.n_max = self.n = len(pts)
|
||||||
|
|
||||||
|
def mult_points(self, val):
|
||||||
|
self.pts *= val
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -137,6 +139,10 @@ class SegIEPolys():
|
||||||
def dump(self):
|
def dump(self):
|
||||||
return {'polys' : [ poly.dump() for poly in self.polys ] }
|
return {'polys' : [ poly.dump() for poly in self.polys ] }
|
||||||
|
|
||||||
|
def mult_points(self, val):
|
||||||
|
for poly in self.polys:
|
||||||
|
poly.mult_points(val)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def load(data=None):
|
def load(data=None):
|
||||||
ie_polys = SegIEPolys()
|
ie_polys = SegIEPolys()
|
||||||
|
|
10
main.py
10
main.py
|
@ -255,6 +255,16 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
p.set_defaults(func=process_faceset_enhancer)
|
p.set_defaults(func=process_faceset_enhancer)
|
||||||
|
|
||||||
|
|
||||||
|
p = facesettool_parser.add_parser ("resize", help="Resize DFL faceset.")
|
||||||
|
p.add_argument('--input-dir', required=True, action=fixPathAction, dest="input_dir", help="Input directory of aligned faces.")
|
||||||
|
|
||||||
|
def process_faceset_resizer(arguments):
|
||||||
|
osex.set_process_lowest_prio()
|
||||||
|
from mainscripts import FacesetResizer
|
||||||
|
FacesetResizer.process_folder ( Path(arguments.input_dir) )
|
||||||
|
p.set_defaults(func=process_faceset_resizer)
|
||||||
|
|
||||||
def process_dev_test(arguments):
|
def process_dev_test(arguments):
|
||||||
osex.set_process_lowest_prio()
|
osex.set_process_lowest_prio()
|
||||||
from mainscripts import dev_misc
|
from mainscripts import dev_misc
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue