Browse Source

[to #42322933]license supplement for face_detection andd face_recognition

Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/10192162

    * license supplement for face_detection andd face_recognition
master
yuxiang.tyx yingda.chen 3 years ago
parent
commit
83ab586a65
23 changed files with 62 additions and 14 deletions
  1. +2
    -3
      modelscope/models/cv/face_detection/mmdet_patch/__init__.py
  2. +4
    -0
      modelscope/models/cv/face_detection/mmdet_patch/core/bbox/__init__.py
  3. +2
    -1
      modelscope/models/cv/face_detection/mmdet_patch/core/bbox/transforms.py
  4. +4
    -0
      modelscope/models/cv/face_detection/mmdet_patch/core/post_processing/__init__.py
  5. +2
    -1
      modelscope/models/cv/face_detection/mmdet_patch/core/post_processing/bbox_nms.py
  6. +4
    -0
      modelscope/models/cv/face_detection/mmdet_patch/datasets/__init__.py
  7. +4
    -0
      modelscope/models/cv/face_detection/mmdet_patch/datasets/pipelines/__init__.py
  8. +2
    -1
      modelscope/models/cv/face_detection/mmdet_patch/datasets/pipelines/transforms.py
  9. +2
    -1
      modelscope/models/cv/face_detection/mmdet_patch/datasets/retinaface.py
  10. +4
    -0
      modelscope/models/cv/face_detection/mmdet_patch/models/__init__.py
  11. +4
    -0
      modelscope/models/cv/face_detection/mmdet_patch/models/backbones/__init__.py
  12. +2
    -1
      modelscope/models/cv/face_detection/mmdet_patch/models/backbones/resnet.py
  13. +4
    -0
      modelscope/models/cv/face_detection/mmdet_patch/models/dense_heads/__init__.py
  14. +2
    -1
      modelscope/models/cv/face_detection/mmdet_patch/models/dense_heads/scrfd_head.py
  15. +4
    -0
      modelscope/models/cv/face_detection/mmdet_patch/models/detectors/__init__.py
  16. +2
    -1
      modelscope/models/cv/face_detection/mmdet_patch/models/detectors/scrfd.py
  17. +4
    -0
      modelscope/models/cv/face_recognition/align_face.py
  18. +2
    -0
      modelscope/models/cv/face_recognition/torchkit/backbone/__init__.py
  19. +2
    -0
      modelscope/models/cv/face_recognition/torchkit/backbone/common.py
  20. +2
    -2
      modelscope/models/cv/face_recognition/torchkit/backbone/model_irse.py
  21. +2
    -2
      modelscope/models/cv/face_recognition/torchkit/backbone/model_resnet.py
  22. +1
    -0
      modelscope/pipelines/cv/face_detection_pipeline.py
  23. +1
    -0
      modelscope/pipelines/cv/face_recognition_pipeline.py

+ 2
- 3
modelscope/models/cv/face_detection/mmdet_patch/__init__.py View File

@@ -1,5 +1,4 @@
""" """
mmdet_patch is based on
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet,
all duplicate functions from official mmdetection are removed.
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet
""" """

+ 4
- 0
modelscope/models/cv/face_detection/mmdet_patch/core/bbox/__init__.py View File

@@ -1,3 +1,7 @@
"""
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/core/bbox
"""
from .transforms import bbox2result, distance2kps, kps2distance from .transforms import bbox2result, distance2kps, kps2distance


__all__ = ['bbox2result', 'distance2kps', 'kps2distance'] __all__ = ['bbox2result', 'distance2kps', 'kps2distance']

+ 2
- 1
modelscope/models/cv/face_detection/mmdet_patch/core/bbox/transforms.py View File

@@ -1,5 +1,6 @@
""" """
based on https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/core/bbox/transforms.py
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/core/bbox/transforms.py
""" """
import numpy as np import numpy as np
import torch import torch


+ 4
- 0
modelscope/models/cv/face_detection/mmdet_patch/core/post_processing/__init__.py View File

@@ -1,3 +1,7 @@
"""
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/core/post_processing/bbox_nms.py
"""
from .bbox_nms import multiclass_nms from .bbox_nms import multiclass_nms


__all__ = ['multiclass_nms'] __all__ = ['multiclass_nms']

+ 2
- 1
modelscope/models/cv/face_detection/mmdet_patch/core/post_processing/bbox_nms.py View File

@@ -1,5 +1,6 @@
""" """
based on https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/core/post_processing/bbox_nms.py
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/core/post_processing/bbox_nms.py
""" """
import torch import torch




+ 4
- 0
modelscope/models/cv/face_detection/mmdet_patch/datasets/__init__.py View File

@@ -1,3 +1,7 @@
"""
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/datasets
"""
from .retinaface import RetinaFaceDataset from .retinaface import RetinaFaceDataset


__all__ = ['RetinaFaceDataset'] __all__ = ['RetinaFaceDataset']

+ 4
- 0
modelscope/models/cv/face_detection/mmdet_patch/datasets/pipelines/__init__.py View File

@@ -1,3 +1,7 @@
"""
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/datasets/pipelines
"""
from .transforms import RandomSquareCrop from .transforms import RandomSquareCrop


__all__ = ['RandomSquareCrop'] __all__ = ['RandomSquareCrop']

+ 2
- 1
modelscope/models/cv/face_detection/mmdet_patch/datasets/pipelines/transforms.py View File

@@ -1,5 +1,6 @@
""" """
based on https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/datasets/pipelines/transforms.py
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/datasets/pipelines/transforms.py
""" """
import numpy as np import numpy as np
from mmdet.datasets.builder import PIPELINES from mmdet.datasets.builder import PIPELINES


+ 2
- 1
modelscope/models/cv/face_detection/mmdet_patch/datasets/retinaface.py View File

@@ -1,5 +1,6 @@
""" """
based on https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/datasets/retinaface.py
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/datasets/retinaface.py
""" """
import numpy as np import numpy as np
from mmdet.datasets.builder import DATASETS from mmdet.datasets.builder import DATASETS


+ 4
- 0
modelscope/models/cv/face_detection/mmdet_patch/models/__init__.py View File

@@ -1,2 +1,6 @@
"""
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/models
"""
from .dense_heads import * # noqa: F401,F403 from .dense_heads import * # noqa: F401,F403
from .detectors import * # noqa: F401,F403 from .detectors import * # noqa: F401,F403

+ 4
- 0
modelscope/models/cv/face_detection/mmdet_patch/models/backbones/__init__.py View File

@@ -1,3 +1,7 @@
"""
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/models/backbones
"""
from .resnet import ResNetV1e from .resnet import ResNetV1e


__all__ = ['ResNetV1e'] __all__ = ['ResNetV1e']

+ 2
- 1
modelscope/models/cv/face_detection/mmdet_patch/models/backbones/resnet.py View File

@@ -1,5 +1,6 @@
""" """
based on https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/models/backbones/resnet.py
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/models/backbones/resnet.py
""" """
import torch.nn as nn import torch.nn as nn
import torch.utils.checkpoint as cp import torch.utils.checkpoint as cp


+ 4
- 0
modelscope/models/cv/face_detection/mmdet_patch/models/dense_heads/__init__.py View File

@@ -1,3 +1,7 @@
"""
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/models/dense_heads
"""
from .scrfd_head import SCRFDHead from .scrfd_head import SCRFDHead


__all__ = ['SCRFDHead'] __all__ = ['SCRFDHead']

+ 2
- 1
modelscope/models/cv/face_detection/mmdet_patch/models/dense_heads/scrfd_head.py View File

@@ -1,5 +1,6 @@
""" """
based on https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/models/dense_heads/scrfd_head.py
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/models/dense_heads/scrfd_head.py
""" """
import numpy as np import numpy as np
import torch import torch


+ 4
- 0
modelscope/models/cv/face_detection/mmdet_patch/models/detectors/__init__.py View File

@@ -1,3 +1,7 @@
"""
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/models/detectors
"""
from .scrfd import SCRFD from .scrfd import SCRFD


__all__ = ['SCRFD'] __all__ = ['SCRFD']

+ 2
- 1
modelscope/models/cv/face_detection/mmdet_patch/models/detectors/scrfd.py View File

@@ -1,5 +1,6 @@
""" """
based on https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/models/detectors/scrfd.py
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/tree/master/detection/scrfd/mmdet/models/detectors/scrfd.py
""" """
import torch import torch
from mmdet.models.builder import DETECTORS from mmdet.models.builder import DETECTORS


+ 4
- 0
modelscope/models/cv/face_recognition/align_face.py View File

@@ -1,3 +1,7 @@
"""
The implementation here is modified based on insightface, originally MIT license and publicly avaialbe at
https://github.com/deepinsight/insightface/blob/master/python-package/insightface/utils/face_align.py
"""
import cv2 import cv2
import numpy as np import numpy as np
from skimage import transform as trans from skimage import transform as trans


+ 2
- 0
modelscope/models/cv/face_recognition/torchkit/backbone/__init__.py View File

@@ -1,3 +1,5 @@
# The implementation is adopted from TFace,made pubicly available under the Apache-2.0 license at
# https://github.com/Tencent/TFace/blob/master/recognition/torchkit/backbone
from .model_irse import (IR_18, IR_34, IR_50, IR_101, IR_152, IR_200, IR_SE_50, from .model_irse import (IR_18, IR_34, IR_50, IR_101, IR_152, IR_200, IR_SE_50,
IR_SE_101, IR_SE_152, IR_SE_200) IR_SE_101, IR_SE_152, IR_SE_200)
from .model_resnet import ResNet_50, ResNet_101, ResNet_152 from .model_resnet import ResNet_50, ResNet_101, ResNet_152


+ 2
- 0
modelscope/models/cv/face_recognition/torchkit/backbone/common.py View File

@@ -1,3 +1,5 @@
# The implementation is adopted from TFace,made pubicly available under the Apache-2.0 license at
# https://github.com/Tencent/TFace/blob/master/recognition/torchkit/backbone/common.py
import torch import torch
import torch.nn as nn import torch.nn as nn
from torch.nn import (BatchNorm1d, BatchNorm2d, Conv2d, Linear, Module, ReLU, from torch.nn import (BatchNorm1d, BatchNorm2d, Conv2d, Linear, Module, ReLU,


+ 2
- 2
modelscope/models/cv/face_recognition/torchkit/backbone/model_irse.py View File

@@ -1,5 +1,5 @@
# based on:
# https://github.com/ZhaoJ9014/face.evoLVe.PyTorch/blob/master/backbone/model_irse.py
# The implementation is adopted from TFace,made pubicly available under the Apache-2.0 license at
# https://github.com/Tencent/TFace/blob/master/recognition/torchkit/backbone/model_irse.py
from collections import namedtuple from collections import namedtuple


from torch.nn import (BatchNorm1d, BatchNorm2d, Conv2d, Dropout, Linear, from torch.nn import (BatchNorm1d, BatchNorm2d, Conv2d, Dropout, Linear,


+ 2
- 2
modelscope/models/cv/face_recognition/torchkit/backbone/model_resnet.py View File

@@ -1,5 +1,5 @@
# based on:
# https://github.com/ZhaoJ9014/face.evoLVe.PyTorch/blob/master/backbone/model_resnet.py
# The implementation is adopted from TFace,made pubicly available under the Apache-2.0 license at
# https://github.com/Tencent/TFace/blob/master/recognition/torchkit/backbone/model_resnet.py
import torch.nn as nn import torch.nn as nn
from torch.nn import (BatchNorm1d, BatchNorm2d, Conv2d, Dropout, Linear, from torch.nn import (BatchNorm1d, BatchNorm2d, Conv2d, Dropout, Linear,
MaxPool2d, Module, ReLU, Sequential) MaxPool2d, Module, ReLU, Sequential)


+ 1
- 0
modelscope/pipelines/cv/face_detection_pipeline.py View File

@@ -1,3 +1,4 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
import os.path as osp import os.path as osp
from typing import Any, Dict from typing import Any, Dict




+ 1
- 0
modelscope/pipelines/cv/face_recognition_pipeline.py View File

@@ -1,3 +1,4 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
import os.path as osp import os.path as osp
from typing import Any, Dict from typing import Any, Dict




Loading…
Cancel
Save