Spaces:
Running
on
Zero
Running
on
Zero
File size: 1,198 Bytes
8ed2f16 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
#################################################
# Copyright (c) 2021-present, xiaobing.ai, Inc. #
# All rights reserved. #
#################################################
# CV Research, DEV(USA) xiaobing. #
# Written by [email protected] #
#################################################
import torch
import lib.models as models
def make_model(cfg):
"""
Build and initialize the models based on the given configuration.
Args:
cfg: Configuration object containing model specifications.
Returns:
list: A list containing the initialized models [fd, ldmk, ldmk_3d].
"""
return_list = []
# Create face detection (fd) model
fd = models.define_networks(cfg, cfg.model.fd.model_type, cfg.model.fd.model_cls)
return_list.append(fd)
# Create landmark (ldmk) model
ldmk = models.define_networks(cfg, cfg.model.ldmk.model_type, cfg.model.ldmk.model_cls)
return_list.append(ldmk)
# Create 3D landmark (ldmk_3d) model
ldmk_3d = models.define_networks(cfg, cfg.model.ldmk_3d.model_type, cfg.model.ldmk_3d.model_cls)
return_list.append(ldmk_3d)
return return_list |