config updates and pathes to xseg / q96

This commit is contained in:
Jan 2021-12-05 15:54:57 +01:00
commit 8cb37f3f28
5 changed files with 74 additions and 1 deletions

View file

@ -185,7 +185,8 @@
"type": "boolean"
},
"batch_size": {
"type": "integer"
"type": "integer",
"minimum": 1
},
"gan_power": {
"type": "number",

View file

@ -10,6 +10,8 @@ from facelib import FaceType
from models import ModelBase
from samplelib import *
from pathlib import Path
class QModel(ModelBase):
#override
def on_initialize(self):
@ -317,5 +319,9 @@ class QModel(ModelBase):
return self.predictor_func, (self.resolution, self.resolution, 3), merger.MergerConfigMasked(face_type=self.face_type,
default_mode = 'overlay',
)
#override
def get_config_schema_path(self):
config_path = Path(__file__).parent.absolute() / Path("config_schema.json")
return config_path
Model = QModel

View file

@ -0,0 +1,20 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/dfl_config",
"definitions": {
"dfl_config": {
"type": "object",
"additionalProperties": false,
"properties": {
"batch_size": {
"type": "integer",
"minimum": 1
}
},
"required": [
"batch_size",
],
"title": "dfl_config"
}
}
}

View file

@ -11,6 +11,8 @@ from facelib import FaceType, XSegNet
from models import ModelBase
from samplelib import *
from pathlib import Path
class XSegModel(ModelBase):
def __init__(self, *args, **kwargs):
@ -279,5 +281,10 @@ class XSegModel(ModelBase):
output_names=['out_mask:0'],
opset=13,
output_path=output_path)
#override
def get_config_schema_path(self):
config_path = Path(__file__).parent.absolute() / Path("config_schema.json")
return config_path
Model = XSegModel

View file

@ -0,0 +1,39 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/dfl_config",
"definitions": {
"dfl_config": {
"type": "object",
"additionalProperties": false,
"properties": {
"use_fp16": {
"type": "boolean"
},
"face_type": {
"type": "string",
"enum": [
"h",
"mf",
"f",
"wf",
"head",
"custom"
]
},
"pretrain": {
"type": "boolean"
},
"batch_size": {
"type": "integer",
"minimum": 1
}
},
"required": [
"batch_size",
"face_type",
"pretrain",
],
"title": "dfl_config"
}
}
}