e904b667c6
Build/Publish Develop Docs / deploy (push) Failing after 1s
PaddleOCR Code Style Check / check-code-style (push) Failing after 1s
PaddleOCR PR Tests GPU / detect-changes (push) Failing after 1s
PaddleOCR PR Tests / detect-changes (push) Failing after 1s
PaddleOCR PR Tests GPU / test-pr-gpu (push) Has been cancelled
PaddleOCR PR Tests / test-pr (push) Has been cancelled
PaddleOCR PR Tests GPU / test-pr-gpu-impl (push) Has been cancelled
PaddleOCR PR Tests / test-pr-python (3.13) (push) Has been cancelled
PaddleOCR PR Tests / test-pr-python (3.8) (push) Has been cancelled
PaddleOCR PR Tests / test-pr-python (3.9) (push) Has been cancelled
17 lines
415 B
Python
17 lines
415 B
Python
# -*- coding: utf-8 -*-
|
|
# @Time : 2020/6/5 11:36
|
|
# @Author : zhoujun
|
|
import copy
|
|
from .DB_loss import DBLoss
|
|
|
|
__all__ = ["build_loss"]
|
|
support_loss = ["DBLoss"]
|
|
|
|
|
|
def build_loss(config):
|
|
copy_config = copy.deepcopy(config)
|
|
loss_type = copy_config.pop("type")
|
|
assert loss_type in support_loss, f"all support loss is {support_loss}"
|
|
criterion = eval(loss_type)(**copy_config)
|
|
return criterion
|