Browse Source

[to #42322933]update license

以下算法进行了header变更:
modelscope.models.cv.cmdssl_video_embedding
modelscope.models.cv.action_recognition 
modelscope.models.cv.animal_recognition
modelscope.models.multi_modal.multi_stage_diffusion
modelscope.models.multi_modal.gemm

modelscope.pipelines.cv.live_category_pipeline
modelscope.pipelines.cv.video_category_pipeline
modelscope.models.cv.image_to_image_translation
modelscope.models.cv.image_to_image_generation

modelscope.models.cv.video_inpainting
modelscope.models.multi_modal.diffusion
modelscope.models.multi_modal.team
modelscope.models.cv.shop_segmentation
modelscope.models.cv.text_driven_segmentation
modelscope.models.cv.action_recognition 


modelscope.models.cv.face_emotion
modelscope.models.cv.hand_static
        Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/10268474
master
chaojie.mcj yingda.chen 3 years ago
parent
commit
0e52a20d28
64 changed files with 188 additions and 106 deletions
  1. +3
    -0
      modelscope/models/cv/action_recognition/models.py
  2. +3
    -0
      modelscope/models/cv/action_recognition/s3dg.py
  3. +4
    -0
      modelscope/models/cv/action_recognition/tada_convnext.py
  4. +3
    -0
      modelscope/models/cv/animal_recognition/resnet.py
  5. +3
    -0
      modelscope/models/cv/animal_recognition/splat.py
  6. +2
    -1
      modelscope/models/cv/cmdssl_video_embedding/__init__.py
  7. +8
    -0
      modelscope/models/cv/cmdssl_video_embedding/c3d.py
  8. +8
    -0
      modelscope/models/cv/cmdssl_video_embedding/resnet2p1d.py
  9. +8
    -0
      modelscope/models/cv/cmdssl_video_embedding/resnet3d.py
  10. +6
    -8
      modelscope/models/cv/shop_segmentation/common.py
  11. +6
    -8
      modelscope/models/cv/shop_segmentation/head_fpn.py
  12. +6
    -8
      modelscope/models/cv/shop_segmentation/models.py
  13. +6
    -8
      modelscope/models/cv/shop_segmentation/neck_fpn.py
  14. +6
    -8
      modelscope/models/cv/shop_segmentation/shop_seg_base.py
  15. +2
    -0
      modelscope/models/cv/shop_segmentation/shop_seg_model.py
  16. +3
    -4
      modelscope/models/cv/shop_segmentation/utils.py
  17. +1
    -0
      modelscope/models/cv/text_driven_segmentation/__init__.py
  18. +3
    -4
      modelscope/models/cv/text_driven_segmentation/clip.py
  19. +2
    -4
      modelscope/models/cv/text_driven_segmentation/lseg_base.py
  20. +2
    -4
      modelscope/models/cv/text_driven_segmentation/lseg_blocks.py
  21. +2
    -0
      modelscope/models/cv/text_driven_segmentation/lseg_model.py
  22. +2
    -4
      modelscope/models/cv/text_driven_segmentation/lseg_net.py
  23. +2
    -4
      modelscope/models/cv/text_driven_segmentation/lseg_vit.py
  24. +2
    -4
      modelscope/models/cv/text_driven_segmentation/model.py
  25. +3
    -4
      modelscope/models/cv/text_driven_segmentation/simple_tokenizer.py
  26. +3
    -0
      modelscope/models/multi_modal/diffusion/diffusion.py
  27. +1
    -0
      modelscope/models/multi_modal/diffusion/model.py
  28. +3
    -0
      modelscope/models/multi_modal/diffusion/unet_generator.py
  29. +3
    -0
      modelscope/models/multi_modal/diffusion/unet_upsampler_1024.py
  30. +3
    -0
      modelscope/models/multi_modal/diffusion/unet_upsampler_256.py
  31. +11
    -6
      modelscope/models/multi_modal/gemm/gemm_base.py
  32. +2
    -0
      modelscope/models/multi_modal/gemm/gemm_model.py
  33. +8
    -4
      modelscope/models/multi_modal/gemm/tokenizer.py
  34. +2
    -0
      modelscope/models/multi_modal/mmr/__init__.py
  35. +3
    -0
      modelscope/models/multi_modal/mmr/dataloaders/rawvideo_util.py
  36. +2
    -0
      modelscope/models/multi_modal/mmr/models/__init__.py
  37. +3
    -0
      modelscope/models/multi_modal/mmr/models/clip_for_mm_video_embedding.py
  38. +3
    -0
      modelscope/models/multi_modal/mmr/models/dynamic_inverted_softmax.py
  39. +2
    -0
      modelscope/models/multi_modal/mmr/models/modeling.py
  40. +2
    -1
      modelscope/models/multi_modal/mmr/models/module_clip.py
  41. +3
    -0
      modelscope/models/multi_modal/mmr/models/module_cross.py
  42. +3
    -0
      modelscope/models/multi_modal/mmr/models/tokenization_clip.py
  43. +2
    -1
      modelscope/models/multi_modal/multi_stage_diffusion/clip.py
  44. +1
    -1
      modelscope/models/multi_modal/multi_stage_diffusion/decoder.py
  45. +3
    -2
      modelscope/models/multi_modal/multi_stage_diffusion/gaussian_diffusion.py
  46. +1
    -1
      modelscope/models/multi_modal/multi_stage_diffusion/model.py
  47. +1
    -1
      modelscope/models/multi_modal/multi_stage_diffusion/prior.py
  48. +2
    -1
      modelscope/models/multi_modal/multi_stage_diffusion/tokenizer.py
  49. +1
    -1
      modelscope/models/multi_modal/multi_stage_diffusion/upsampler.py
  50. +3
    -2
      modelscope/models/multi_modal/multi_stage_diffusion/xglm.py
  51. +1
    -0
      modelscope/models/multi_modal/team/team_model.py
  52. +7
    -4
      modelscope/models/multi_modal/team/utils.py
  53. +1
    -0
      modelscope/pipelines/cv/animal_recognition_pipeline.py
  54. +2
    -0
      modelscope/pipelines/cv/cmdssl_video_embedding_pipeline.py
  55. +1
    -0
      modelscope/pipelines/cv/general_recognition_pipeline.py
  56. +1
    -1
      modelscope/pipelines/cv/live_category_pipeline.py
  57. +1
    -0
      modelscope/pipelines/cv/shop_segmentation_pipleline.py
  58. +1
    -0
      modelscope/pipelines/cv/text_driven_segmentation_pipleline.py
  59. +1
    -1
      modelscope/pipelines/cv/video_category_pipeline.py
  60. +1
    -1
      modelscope/pipelines/multi_modal/generative_multi_modal_embedding_pipeline.py
  61. +1
    -2
      modelscope/pipelines/multi_modal/team_multi_modal_similarity_pipeline.py
  62. +1
    -1
      tests/pipelines/test_cmdssl_video_embedding.py
  63. +1
    -1
      tests/pipelines/test_generative_multi_modal_embedding.py
  64. +1
    -1
      tests/pipelines/test_multi_modal_similarity.py

+ 3
- 0
modelscope/models/cv/action_recognition/models.py View File

@@ -1,3 +1,6 @@
# The implementation is also open-sourced by the authors,
# and available at https://github.com/alibaba-mmai-research/TAdaConv
# Copyright 2021-2022 The Alibaba FVI Team Authors. All rights reserved.
import torch.nn as nn

from .s3dg import Inception3D


+ 3
- 0
modelscope/models/cv/action_recognition/s3dg.py View File

@@ -1,3 +1,6 @@
# The implementation is adopted from https://github.com/TengdaHan/CoCLR,
# made pubicly available under the Apache License, Version 2.0 at https://github.com/TengdaHan/CoCLR
# Copyright 2021-2022 The Alibaba FVI Team Authors. All rights reserved.
import torch
import torch.nn as nn



+ 4
- 0
modelscope/models/cv/action_recognition/tada_convnext.py View File

@@ -1,3 +1,7 @@
# The implementation is adopted from https://github.com/facebookresearch/ConvNeXt,
# made pubicly available under the MIT License at https://github.com/facebookresearch/ConvNeXt
# Copyright 2021-2022 The Alibaba FVI Team Authors. All rights reserved.

import math

import torch


+ 3
- 0
modelscope/models/cv/animal_recognition/resnet.py View File

@@ -1,3 +1,6 @@
# The implementation is adopted from Split-Attention Network, A New ResNet Variant,
# made pubicly available under the Apache License 2.0 License
# at https://github.com/zhanghang1989/ResNeSt/blob/master/resnest/torch/models/resnet.py
import math

import torch


+ 3
- 0
modelscope/models/cv/animal_recognition/splat.py View File

@@ -1,3 +1,6 @@
# The implementation is adopted from Split-Attention Network, A New ResNet Variant,
# made pubicly available under the Apache License 2.0 License
# at https://github.com/zhanghang1989/ResNeSt/blob/master/resnest/torch/models/splat.py
"""Split-Attention"""

import torch


+ 2
- 1
modelscope/models/cv/cmdssl_video_embedding/__init__.py View File

@@ -1,4 +1,5 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

from typing import TYPE_CHECKING

from modelscope.utils.import_utils import LazyImportModule


+ 8
- 0
modelscope/models/cv/cmdssl_video_embedding/c3d.py View File

@@ -1,3 +1,11 @@
# Copyright 2022 Davide Abati.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

# The implementation here is modified based on c3d-pytorch,
# originally MIT License, Copyright (c) 2022 Davide Abati,
# and publicly available at https://github.com/DavideA/c3d-pytorch
""" C3D Model Architecture."""

import torch
import torch.nn as nn



+ 8
- 0
modelscope/models/cv/cmdssl_video_embedding/resnet2p1d.py View File

@@ -1,3 +1,11 @@
# Copyright (c) 2022 Kensho Hara.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

# The implementation here is modified based on 3D-ResNets-PyTorch,
# originally MIT License, Copyright (c) 2022 Kensho Hara,
# and publicly available at https://github.com/kenshohara/3D-ResNets-PyTorch/blob/master/models/resnet2p1d.py
""" ResNet2plus1d Model Architecture."""

import torch
import torch.nn as nn



+ 8
- 0
modelscope/models/cv/cmdssl_video_embedding/resnet3d.py View File

@@ -1,3 +1,11 @@
# Copyright (c) 2022 Kensho Hara.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

# The implementation here is modified based on 3D-ResNets-PyTorch,
# originally MIT License, Copyright (c) 2022 Kensho Hara,
# and publicly available at https://github.com/kenshohara/3D-ResNets-PyTorch/blob/master/models/resnet.py
""" ResNet3D Model Architecture."""

import torch
import torch.nn as nn



+ 6
- 8
modelscope/models/cv/shop_segmentation/common.py View File

@@ -1,11 +1,9 @@
"""
Base modules are adapted from https://github.com/open-mmlab/mmcv/,
originally Apache 2.0 License, Copyright (c) 2018-2022 OpenMMLab,
https://github.com/open-mmlab/mmsegmentation/,
originally Apache 2.0 License, Copyright (c) 2020-2021 OpenMMLab,
and adapted from https://github.com/raoyongming/DenseCLIP/,
originally MIT License, Copyright (c) 2022 Rao, Yongming.
"""
# Base modules are adapted from https://github.com/open-mmlab/mmcv/,
# originally Apache 2.0 License, Copyright (c) 2018-2022 OpenMMLab,
# https://github.com/open-mmlab/mmsegmentation/,
# originally Apache 2.0 License, Copyright (c) 2020-2021 OpenMMLab,
# and adapted from https://github.com/raoyongming/DenseCLIP/,
# originally MIT License, Copyright (c) 2022 Rao, Yongming.

import warnings



+ 6
- 8
modelscope/models/cv/shop_segmentation/head_fpn.py View File

@@ -1,11 +1,9 @@
""" FPNHead
Base modules are adapted from https://github.com/open-mmlab/mmcv/,
originally Apache 2.0 License, Copyright (c) 2018-2022 OpenMMLab,
https://github.com/open-mmlab/mmsegmentation/,
originally Apache 2.0 License, Copyright (c) 2020-2021 OpenMMLab,
and adapted from https://github.com/raoyongming/DenseCLIP/,
originally MIT License, Copyright (c) 2022 Rao, Yongming.
"""
# Base modules are adapted from https://github.com/open-mmlab/mmcv/,
# originally Apache 2.0 License, Copyright (c) 2018-2022 OpenMMLab,
# https://github.com/open-mmlab/mmsegmentation/,
# originally Apache 2.0 License, Copyright (c) 2020-2021 OpenMMLab,
# and adapted from https://github.com/raoyongming/DenseCLIP/,
# originally MIT License, Copyright (c) 2022 Rao, Yongming.

import numpy as np
import torch


+ 6
- 8
modelscope/models/cv/shop_segmentation/models.py View File

@@ -1,11 +1,9 @@
"""
Base modules are adapted from https://github.com/open-mmlab/mmcv/,
originally Apache 2.0 License, Copyright (c) 2018-2022 OpenMMLab,
https://github.com/open-mmlab/mmsegmentation/,
originally Apache 2.0 License, Copyright (c) 2020-2021 OpenMMLab,
and adapted from https://github.com/raoyongming/DenseCLIP/,
originally MIT License, Copyright (c) 2022 Rao, Yongming.
"""
# Base modules are adapted from https://github.com/open-mmlab/mmcv/,
# originally Apache 2.0 License, Copyright (c) 2018-2022 OpenMMLab,
# https://github.com/open-mmlab/mmsegmentation/,
# originally Apache 2.0 License, Copyright (c) 2020-2021 OpenMMLab,
# and adapted from https://github.com/raoyongming/DenseCLIP/,
# originally MIT License, Copyright (c) 2022 Rao, Yongming.

import math
from collections import OrderedDict


+ 6
- 8
modelscope/models/cv/shop_segmentation/neck_fpn.py View File

@@ -1,11 +1,9 @@
""" FPNneck
Base modules are adapted from https://github.com/open-mmlab/mmcv/,
originally Apache 2.0 License, Copyright (c) 2018-2022 OpenMMLab,
https://github.com/open-mmlab/mmsegmentation/,
originally Apache 2.0 License, Copyright (c) 2020-2021 OpenMMLab,
and adapted from https://github.com/raoyongming/DenseCLIP/,
originally MIT License, Copyright (c) 2022 Rao, Yongming.
"""
# Base modules are adapted from https://github.com/open-mmlab/mmcv/,
# originally Apache 2.0 License, Copyright (c) 2018-2022 OpenMMLab,
# https://github.com/open-mmlab/mmsegmentation/,
# originally Apache 2.0 License, Copyright (c) 2020-2021 OpenMMLab,
# and adapted from https://github.com/raoyongming/DenseCLIP/,
# originally MIT License, Copyright (c) 2022 Rao, Yongming.

import torch.nn as nn
import torch.nn.functional as F


+ 6
- 8
modelscope/models/cv/shop_segmentation/shop_seg_base.py View File

@@ -1,11 +1,9 @@
"""
Base modules are adapted from https://github.com/open-mmlab/mmcv/,
originally Apache 2.0 License, Copyright (c) 2018-2022 OpenMMLab,
https://github.com/open-mmlab/mmsegmentation/,
originally Apache 2.0 License, Copyright (c) 2020-2021 OpenMMLab,
and adapted from https://github.com/raoyongming/DenseCLIP/,
originally MIT License, Copyright (c) 2022 Rao, Yongming.
"""
# Base modules are adapted from https://github.com/open-mmlab/mmcv/,
# originally Apache 2.0 License, Copyright (c) 2018-2022 OpenMMLab,
# https://github.com/open-mmlab/mmsegmentation/,
# originally Apache 2.0 License, Copyright (c) 2020-2021 OpenMMLab,
# and adapted from https://github.com/raoyongming/DenseCLIP/,
# originally MIT License, Copyright (c) 2022 Rao, Yongming.

import torch
import torch.nn as nn


+ 2
- 0
modelscope/models/cv/shop_segmentation/shop_seg_model.py View File

@@ -1,3 +1,5 @@
# Copyright (c) Alibaba, Inc. and its affiliates.

import os.path as osp
from typing import Any, Dict



+ 3
- 4
modelscope/models/cv/shop_segmentation/utils.py View File

@@ -1,7 +1,6 @@
""" CLIP Tokenizer
Adapted from https://github.com/openai/CLIP.
Originally MIT License, Copyright (c) 2021 OpenAI.
"""
# CLIP Tokenizer
# Adapted from https://github.com/openai/CLIP.
# Originally MIT License, Copyright (c) 2021 OpenAI.

import gzip
import html


+ 1
- 0
modelscope/models/cv/text_driven_segmentation/__init__.py View File

@@ -1 +1,2 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
from .lseg_base import TextDrivenSegmentation

+ 3
- 4
modelscope/models/cv/text_driven_segmentation/clip.py View File

@@ -1,7 +1,6 @@
""" CLIP
Adapted from https://github.com/openai/CLIP.
Originally MIT License, Copyright (c) 2021 OpenAI.
"""
# CLIP
# Adapted from https://github.com/openai/CLIP.
# Originally MIT License, Copyright (c) 2021 OpenAI.

import hashlib
import os


+ 2
- 4
modelscope/models/cv/text_driven_segmentation/lseg_base.py View File

@@ -1,7 +1,5 @@
"""
Adapted from https://github.com/isl-org/lang-seg.
Originally MIT License, Copyright (c) 2021 Intelligent Systems Lab Org.
"""
# Adapted from https://github.com/isl-org/lang-seg.
# Originally MIT License, Copyright (c) 2021 Intelligent Systems Lab Org.

import torch
import torch.nn as nn


+ 2
- 4
modelscope/models/cv/text_driven_segmentation/lseg_blocks.py View File

@@ -1,7 +1,5 @@
"""
Adapted from https://github.com/isl-org/lang-seg.
Originally MIT License, Copyright (c) 2021 Intelligent Systems Lab Org.
"""
# Adapted from https://github.com/isl-org/lang-seg.
# Originally MIT License, Copyright (c) 2021 Intelligent Systems Lab Org.

import torch
import torch.nn as nn


+ 2
- 0
modelscope/models/cv/text_driven_segmentation/lseg_model.py View File

@@ -1,3 +1,5 @@
# Copyright (c) Alibaba, Inc. and its affiliates.

import os.path as osp
from typing import Any, Dict



+ 2
- 4
modelscope/models/cv/text_driven_segmentation/lseg_net.py View File

@@ -1,7 +1,5 @@
"""
Adapted from https://github.com/isl-org/lang-seg.
Originally MIT License, Copyright (c) 2021 Intelligent Systems Lab Org.
"""
# Adapted from https://github.com/isl-org/lang-seg.
# Originally MIT License, Copyright (c) 2021 Intelligent Systems Lab Org.

import numpy as np
import torch


+ 2
- 4
modelscope/models/cv/text_driven_segmentation/lseg_vit.py View File

@@ -1,7 +1,5 @@
"""
Adapted from https://github.com/isl-org/lang-seg.
Originally MIT License, Copyright (c) 2021 Intelligent Systems Lab Org.
"""
# Adapted from https://github.com/isl-org/lang-seg.
# Originally MIT License, Copyright (c) 2021 Intelligent Systems Lab Org.

import math
import types


+ 2
- 4
modelscope/models/cv/text_driven_segmentation/model.py View File

@@ -1,7 +1,5 @@
"""
Adapted from https://github.com/isl-org/lang-seg.
Originally MIT License, Copyright (c) 2021 Intelligent Systems Lab Org.
"""
# Adapted from https://github.com/isl-org/lang-seg.
# Originally MIT License, Copyright (c) 2021 Intelligent Systems Lab Org.

from collections import OrderedDict
from typing import Tuple, Union


+ 3
- 4
modelscope/models/cv/text_driven_segmentation/simple_tokenizer.py View File

@@ -1,7 +1,6 @@
""" CLIP
Adapted from https://github.com/openai/CLIP.
Originally MIT License, Copyright (c) 2021 OpenAI.
"""
# CLIP
# Adapted from https://github.com/openai/CLIP.
# Originally MIT License, Copyright (c) 2021 OpenAI.

import gzip
import html


+ 3
- 0
modelscope/models/multi_modal/diffusion/diffusion.py View File

@@ -1,3 +1,6 @@
# Part of the implementation is borrowed and modified from latent-diffusion,
# publicly avaialbe at https://github.com/CompVis/latent-diffusion.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
import math

import torch


+ 1
- 0
modelscope/models/multi_modal/diffusion/model.py View File

@@ -1,3 +1,4 @@
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
import os.path as osp
from typing import Any, Dict



+ 3
- 0
modelscope/models/multi_modal/diffusion/unet_generator.py View File

@@ -1,3 +1,6 @@
# Part of the implementation is borrowed and modified from latent-diffusion,
# publicly avaialbe at https://github.com/CompVis/latent-diffusion.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
import math

import torch


+ 3
- 0
modelscope/models/multi_modal/diffusion/unet_upsampler_1024.py View File

@@ -1,3 +1,6 @@
# Part of the implementation is borrowed and modified from latent-diffusion,
# publicly avaialbe at https://github.com/CompVis/latent-diffusion.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
import math

import torch


+ 3
- 0
modelscope/models/multi_modal/diffusion/unet_upsampler_256.py View File

@@ -1,3 +1,6 @@
# Part of the implementation is borrowed and modified from latent-diffusion,
# publicly avaialbe at https://github.com/CompVis/latent-diffusion.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
import math
from functools import partial



+ 11
- 6
modelscope/models/multi_modal/gemm/gemm_base.py View File

@@ -1,9 +1,14 @@
""" Generative Multimodal Model
Base modules are adapted from https://github.com/openai/CLIP/,
originally MIT License, Copyright (c) 2021 OpenAI,
and adapted from https://github.com/lucidrains/CoCa-pytorch/,
originally MIT License, Copyright (c) 2022 Phil Wang.
"""
# Copyright 2021 The OpenAI Team Authors.
# Copyright 2022 Phil Wang.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
#
# The implementation here is modified based on OpenAI CLIP,
# originally MIT License, Copyright (c) 2021 OpenAI,
# and publicly available at https://github.com/openai/CLIP/.
# The implementation here is modified based on Coca-pytorch,
# originally MIT License, Copyright (c) 2022 Phil Wang,
# and publicly available at https://github.com/lucidrains/CoCa-pytorch/,
""" Generative Multimodal Model Architecture."""

import os
from collections import OrderedDict


+ 2
- 0
modelscope/models/multi_modal/gemm/gemm_model.py View File

@@ -1,3 +1,5 @@
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
""" Generative Multimodal Model Wrapper."""
import os.path as osp
from typing import Any, Dict



+ 8
- 4
modelscope/models/multi_modal/gemm/tokenizer.py View File

@@ -1,7 +1,11 @@
""" CLIP Tokenizer
Adapted from https://github.com/openai/CLIP.
Originally MIT License, Copyright (c) 2021 OpenAI.
"""
# Copyright 2021 The OpenAI Team Authors.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
#
# The implementation here is modified based on OpenAI CLIP,
# originally MIT License, Copyright (c) 2021 OpenAI,
# and publicly available at https://github.com/openai/CLIP/.
""" CLIP Tokenizer."""

import gzip
import html
import os


+ 2
- 0
modelscope/models/multi_modal/mmr/__init__.py View File

@@ -1 +1,3 @@
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

from .models import VideoCLIPForMultiModalEmbedding

+ 3
- 0
modelscope/models/multi_modal/mmr/dataloaders/rawvideo_util.py View File

@@ -1,3 +1,6 @@
# The implementation is adopted from Huaishao Luo,
# made pubicly available under the MIT License at https://github.com/ArrowLuo/CLIP4Clip

import cv2
import numpy as np
import torch as th


+ 2
- 0
modelscope/models/multi_modal/mmr/models/__init__.py View File

@@ -1 +1,3 @@
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

from .clip_for_mm_video_embedding import VideoCLIPForMultiModalEmbedding

+ 3
- 0
modelscope/models/multi_modal/mmr/models/clip_for_mm_video_embedding.py View File

@@ -1,3 +1,6 @@
# The implementation is adopated from the CLIP4Clip implementation,
# made pubicly available under Apache License, Version 2.0 at https://github.com/ArrowLuo/CLIP4Clip

import random
from os.path import exists
from typing import Any, Dict


+ 3
- 0
modelscope/models/multi_modal/mmr/models/dynamic_inverted_softmax.py View File

@@ -1,3 +1,6 @@
# The implementation is adopated from the CLIP4Clip implementation,
# made pubicly available under Apache License, Version 2.0 at https://github.com/ArrowLuo/CLIP4Clip

import numpy as np




+ 2
- 0
modelscope/models/multi_modal/mmr/models/modeling.py View File

@@ -1,3 +1,5 @@
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

import os
import platform
from collections import OrderedDict


+ 2
- 1
modelscope/models/multi_modal/mmr/models/module_clip.py View File

@@ -1,4 +1,5 @@
# Part of the implementation is borrowed and modified from The OpenAI CLIP project.
# The implementation is adopated from the CLIP4Clip implementation,
# made pubicly available under Apache License, Version 2.0 at https://github.com/ArrowLuo/CLIP4Clip

import hashlib
import os


+ 3
- 0
modelscope/models/multi_modal/mmr/models/module_cross.py View File

@@ -1,3 +1,6 @@
# The implementation is adopated from the CLIP4Clip implementation,
# made pubicly available under Apache License, Version 2.0 at https://github.com/ArrowLuo/CLIP4Clip

from __future__ import absolute_import, division, print_function
import logging
from collections import OrderedDict


+ 3
- 0
modelscope/models/multi_modal/mmr/models/tokenization_clip.py View File

@@ -1,3 +1,6 @@
# The implementation is adopated from the CLIP4Clip implementation,
# made pubicly available under Apache License, Version 2.0 at https://github.com/ArrowLuo/CLIP4Clip

import gzip
import html
import os


+ 2
- 1
modelscope/models/multi_modal/multi_stage_diffusion/clip.py View File

@@ -1,4 +1,5 @@
# The implementation here is modified based on OpenAI CLIP, publicly available at https://github.com/openai/CLIP.
# Part of the implementation is borrowed and modified from CLIP, publicly avaialbe at https://github.com/openai/CLIP.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

import math



+ 1
- 1
modelscope/models/multi_modal/multi_stage_diffusion/decoder.py View File

@@ -1,4 +1,4 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

import math



+ 3
- 2
modelscope/models/multi_modal/multi_stage_diffusion/gaussian_diffusion.py View File

@@ -1,5 +1,6 @@
# The implementation here is modified based on latent diffusion, publicly available
# at https://github.com/CompVis/latent-diffusion.
# Part of the implementation is borrowed and modified from latent-diffusion,
# publicly avaialbe at https://github.com/CompVis/latent-diffusion.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

import math



+ 1
- 1
modelscope/models/multi_modal/multi_stage_diffusion/model.py View File

@@ -1,4 +1,4 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

import math
import os.path as osp


+ 1
- 1
modelscope/models/multi_modal/multi_stage_diffusion/prior.py View File

@@ -1,4 +1,4 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

import math



+ 2
- 1
modelscope/models/multi_modal/multi_stage_diffusion/tokenizer.py View File

@@ -1,4 +1,5 @@
# The implementation here is modified based on OpenAI CLIP, publicly available at https://github.com/openai/CLIP.
# Part of the implementation is borrowed and modified from CLIP, publicly avaialbe at https://github.com/openai/CLIP.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

import gzip
import html


+ 1
- 1
modelscope/models/multi_modal/multi_stage_diffusion/upsampler.py View File

@@ -1,4 +1,4 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

import math



+ 3
- 2
modelscope/models/multi_modal/multi_stage_diffusion/xglm.py View File

@@ -1,5 +1,6 @@
# The implementation here is modified based on HuggingFace XGLM, publicly available
# at https://github.com/huggingface/transformers.
# Part of the implementation is borrowed and modified from HuggingFace XGLM,
# publicly avaialbe at https://github.com/huggingface/transformers.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

import math



+ 1
- 0
modelscope/models/multi_modal/team/team_model.py View File

@@ -1,3 +1,4 @@
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
from typing import Any, Dict

import cv2


+ 7
- 4
modelscope/models/multi_modal/team/utils.py View File

@@ -1,7 +1,10 @@
""" Generative Multimodal Model
Base Transformer code is adapted from https://github.com/openai/CLIP/,
originally MIT License, Copyright (c) 2021 OpenAI,
"""
# Copyright 2021 The OpenAI Team Authors.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
#
# The implementation here is modified based on OpenAI CLIP,
# originally MIT License, Copyright (c) 2021 OpenAI,
# and publicly available at https://github.com/openai/CLIP/.

from collections import OrderedDict
from typing import Tuple, Union



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

@@ -1,3 +1,4 @@
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
import os.path as osp
from typing import Any, Dict



+ 2
- 0
modelscope/pipelines/cv/cmdssl_video_embedding_pipeline.py View File

@@ -1,3 +1,5 @@
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

import os.path as osp
from typing import Any, Dict



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

@@ -1,3 +1,4 @@
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
import os.path as osp
from typing import Any, Dict



+ 1
- 1
modelscope/pipelines/cv/live_category_pipeline.py View File

@@ -1,4 +1,4 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
import os.path as osp
from typing import Any, Dict



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

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

from modelscope.metainfo import Pipelines


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

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

from modelscope.metainfo import Pipelines


+ 1
- 1
modelscope/pipelines/cv/video_category_pipeline.py View File

@@ -1,4 +1,4 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
import os.path as osp
from typing import Any, Dict



+ 1
- 1
modelscope/pipelines/multi_modal/generative_multi_modal_embedding_pipeline.py View File

@@ -1,4 +1,4 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

from typing import Any, Dict



+ 1
- 2
modelscope/pipelines/multi_modal/team_multi_modal_similarity_pipeline.py View File

@@ -1,5 +1,4 @@
# Copyright (c) Alibaba, Inc. and its affiliates.

# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
from typing import Any, Dict

from modelscope.metainfo import Pipelines


+ 1
- 1
tests/pipelines/test_cmdssl_video_embedding.py View File

@@ -1,4 +1,4 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
# !/usr/bin/env python
import unittest



+ 1
- 1
tests/pipelines/test_generative_multi_modal_embedding.py View File

@@ -1,4 +1,4 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

import unittest



+ 1
- 1
tests/pipelines/test_multi_modal_similarity.py View File

@@ -1,4 +1,4 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.

import unittest



Loading…
Cancel
Save