From c9681cbe5745f1afedb8c975464c024c2d629062 Mon Sep 17 00:00:00 2001 From: "yili.li" Date: Mon, 21 Nov 2022 18:24:35 +0800 Subject: [PATCH 01/10] add license --- cv/detection/autoassign/pytorch/dist_train.sh | 1 + .../autoassign/pytorch/mmdet/datasets/__init__.py | 1 + .../pytorch/mmdet/datasets/pipelines/__init__.py | 1 + .../pytorch/mmdet/models/backbones/__init__.py | 1 + .../pytorch/mmdet/models/dense_heads/__init__.py | 1 + .../pytorch/mmdet/models/detectors/__init__.py | 1 + .../pytorch/mmdet/models/losses/__init__.py | 1 + .../pytorch/mmdet/models/necks/__init__.py | 1 + cv/detection/autoassign/pytorch/setup.py | 1 + .../basicvsr_plusplus_c64n7_8x1_600k_reds4.py | 1 + .../basicVSR++/pytorch/dist_train.sh | 1 + .../cuda/modulated_deform_conv_cuda_kernel.cuh | 2 ++ .../ops/csrc/common/cuda/sync_bn_cuda_kernel.cuh | 1 + .../pytorch/cuda/modulated_deform_conv_cuda.cu | 1 + .../mmcv/ops/csrc/pytorch/cuda/sync_bn_cuda.cu | 1 + .../pytorch/mmedit/datasets/__init__.py | 1 + .../pytorch/mmedit/datasets/pipelines/__init__.py | 1 + .../basicVSR++/pytorch/mmedit/models/__init__.py | 1 + .../pytorch/mmedit/models/backbones/__init__.py | 1 + .../models/backbones/sr_backbones/__init__.py | 1 + .../pytorch/mmedit/models/losses/__init__.py | 1 + .../pytorch/mmedit/models/restorers/__init__.py | 1 + cv/super_resolution/basicVSR++/pytorch/setup.py | 1 + cv/super_resolution/basicVSR++/pytorch/train.py | 1 + .../pytorch/configs/basicvsr/basicvsr_reds4.py | 1 + .../pytorch/configs/iconvsr/iconvsr_reds4.py | 1 + .../basicVSR/pytorch/dist_train.sh | 1 + .../cuda/modulated_deform_conv_cuda_kernel.cuh | 1 + .../ops/csrc/common/cuda/sync_bn_cuda_kernel.cuh | 1 + .../pytorch/mmedit/datasets/pipelines/__init__.py | 1 + .../pytorch/mmedit/models/backbones/__init__.py | 1 + .../models/backbones/sr_backbones/__init__.py | 1 + .../pytorch/mmedit/models/losses/__init__.py | 1 + .../pytorch/mmedit/models/restorers/__init__.py | 1 + .../basicVSR/pytorch/requirements.txt | 1 + cv/super_resolution/basicVSR/pytorch/setup.py | 1 + cv/super_resolution/basicVSR/pytorch/train.py | 1 + .../esrgan_psnr_x4c64b23g32_g1_1000k_div2k.py | 3 ++- cv/super_resolution/esrgan/pytorch/dist_train.sh | 1 + .../esrgan/pytorch/get_div2k_anno.py | 1 + .../esrgan/pytorch/mmedit/datasets/__init__.py | 1 + .../pytorch/mmedit/datasets/pipelines/__init__.py | 1 + .../esrgan/pytorch/mmedit/models/__init__.py | 1 + .../pytorch/mmedit/models/backbones/__init__.py | 1 + .../models/backbones/sr_backbones/__init__.py | 1 + .../pytorch/mmedit/models/components/__init__.py | 1 + .../models/components/discriminators/__init__.py | 1 + .../pytorch/mmedit/models/losses/__init__.py | 1 + .../pytorch/mmedit/models/restorers/__init__.py | 1 + cv/super_resolution/esrgan/pytorch/train.py | 1 + .../liif/liif_edsr_norm_c64b16_g1_1000k_div2k.py | 2 ++ .../liif_rdn_norm_x2-4_c64b16_g1_1000k_div2k.py | 2 ++ cv/super_resolution/liif/pytorch/dist_test.sh | 15 +++++++++++++++ cv/super_resolution/liif/pytorch/dist_train.sh | 15 +++++++++++++++ .../liif/pytorch/mmedit/__init__.py | 1 + .../liif/pytorch/mmedit/apis/__init__.py | 1 + .../liif/pytorch/mmedit/core/__init__.py | 1 + .../pytorch/mmedit/core/evaluation/__init__.py | 1 + .../liif/pytorch/mmedit/datasets/__init__.py | 1 + .../pytorch/mmedit/datasets/pipelines/__init__.py | 1 + .../liif/pytorch/mmedit/models/__init__.py | 1 + .../pytorch/mmedit/models/backbones/__init__.py | 1 + .../models/backbones/sr_backbones/__init__.py | 1 + .../mmedit/models/backbones/sr_backbones/rdn.py | 1 + .../pytorch/mmedit/models/components/__init__.py | 1 + .../mmedit/models/components/refiners/__init__.py | 1 + .../liif/pytorch/mmedit/models/losses/__init__.py | 1 + .../liif/pytorch/mmedit/models/losses/utils.py | 1 + .../pytorch/mmedit/models/restorers/__init__.py | 1 + cv/super_resolution/liif/pytorch/requirements.txt | 15 +++++++++++++++ cv/super_resolution/liif/pytorch/test.py | 1 + cv/super_resolution/liif/pytorch/train.py | 1 + ...realbasicvsr_c64b20_1x30x8_lr5e-5_150k_reds.py | 1 + ...sicvsr_wogan_c64b20_2x30x8_lr1e-4_300k_reds.py | 1 + .../real_basicVSR/pytorch/crop_sub_images.py | 1 + .../real_basicVSR/pytorch/dist_test.sh | 1 + .../real_basicVSR/pytorch/dist_train.sh | 1 + .../pytorch/mmedit/datasets/__init__.py | 1 + .../pytorch/mmedit/datasets/pipelines/__init__.py | 1 + .../pytorch/mmedit/models/__init__.py | 1 + .../pytorch/mmedit/models/backbones/__init__.py | 1 + .../models/backbones/sr_backbones/__init__.py | 1 + .../models/components/discriminators/__init__.py | 1 + .../pytorch/mmedit/models/losses/__init__.py | 1 + .../pytorch/mmedit/models/restorers/__init__.py | 1 + .../real_basicVSR/pytorch/setup.py | 1 + cv/super_resolution/real_basicVSR/pytorch/test.py | 1 + .../real_basicVSR/pytorch/train.py | 1 + .../ttsr/pytorch/dataset/dataloader.py | 3 +++ cv/super_resolution/ttsr/pytorch/loss/loss.py | 3 +++ cv/super_resolution/ttsr/pytorch/main.py | 3 +++ cv/super_resolution/ttsr/pytorch/train.sh | 3 +++ cv/super_resolution/ttsr/pytorch/trainer.py | 2 ++ cv/super_resolution/ttsr/pytorch/utils.py | 3 +++ .../ttvsr/pytorch/configs/TTVSR_reds4.py | 1 + cv/super_resolution/ttvsr/pytorch/dist_train.sh | 2 ++ .../ttvsr/pytorch/mmcv/cnn/bricks/activation.py | 1 + .../pytorch/mmcv/cnn/bricks/context_block.py | 1 + .../ttvsr/pytorch/mmedit/apis/__init__.py | 1 + .../pytorch/mmedit/models/common/__init__.py | 1 + .../pytorch/mmedit/models/losses/__init__.py | 1 + .../ttvsr/pytorch/requirements.txt | 1 + cv/super_resolution/ttvsr/pytorch/setup.py | 15 +++++++++++++++ cv/super_resolution/ttvsr/pytorch/train.py | 2 ++ 104 files changed, 177 insertions(+), 1 deletion(-) diff --git a/cv/detection/autoassign/pytorch/dist_train.sh b/cv/detection/autoassign/pytorch/dist_train.sh index 2f0807c47..9c50dce46 100755 --- a/cv/detection/autoassign/pytorch/dist_train.sh +++ b/cv/detection/autoassign/pytorch/dist_train.sh @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. #!/usr/bin/env bash CONFIG=$1 diff --git a/cv/detection/autoassign/pytorch/mmdet/datasets/__init__.py b/cv/detection/autoassign/pytorch/mmdet/datasets/__init__.py index e1ecd4ae4..8ac07ae5b 100755 --- a/cv/detection/autoassign/pytorch/mmdet/datasets/__init__.py +++ b/cv/detection/autoassign/pytorch/mmdet/datasets/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .builder import DATASETS, PIPELINES, build_dataloader, build_dataset from .coco import CocoDataset diff --git a/cv/detection/autoassign/pytorch/mmdet/datasets/pipelines/__init__.py b/cv/detection/autoassign/pytorch/mmdet/datasets/pipelines/__init__.py index 9ee5191c1..0d21d21f6 100755 --- a/cv/detection/autoassign/pytorch/mmdet/datasets/pipelines/__init__.py +++ b/cv/detection/autoassign/pytorch/mmdet/datasets/pipelines/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .compose import Compose from .formatting import (Collect, DefaultFormatBundle, ImageToTensor, diff --git a/cv/detection/autoassign/pytorch/mmdet/models/backbones/__init__.py b/cv/detection/autoassign/pytorch/mmdet/models/backbones/__init__.py index 4c4d970f4..7180d08be 100755 --- a/cv/detection/autoassign/pytorch/mmdet/models/backbones/__init__.py +++ b/cv/detection/autoassign/pytorch/mmdet/models/backbones/__init__.py @@ -1,2 +1,3 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .resnet import ResNet, ResNetV1d diff --git a/cv/detection/autoassign/pytorch/mmdet/models/dense_heads/__init__.py b/cv/detection/autoassign/pytorch/mmdet/models/dense_heads/__init__.py index c9a4e0f5f..06cd1b42f 100755 --- a/cv/detection/autoassign/pytorch/mmdet/models/dense_heads/__init__.py +++ b/cv/detection/autoassign/pytorch/mmdet/models/dense_heads/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .anchor_free_head import AnchorFreeHead from .atss_head import ATSSHead diff --git a/cv/detection/autoassign/pytorch/mmdet/models/detectors/__init__.py b/cv/detection/autoassign/pytorch/mmdet/models/detectors/__init__.py index 2514fb66d..fb8ce183a 100755 --- a/cv/detection/autoassign/pytorch/mmdet/models/detectors/__init__.py +++ b/cv/detection/autoassign/pytorch/mmdet/models/detectors/__init__.py @@ -1,2 +1,3 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .autoassign import AutoAssign diff --git a/cv/detection/autoassign/pytorch/mmdet/models/losses/__init__.py b/cv/detection/autoassign/pytorch/mmdet/models/losses/__init__.py index 1312bb4b7..7741cb605 100755 --- a/cv/detection/autoassign/pytorch/mmdet/models/losses/__init__.py +++ b/cv/detection/autoassign/pytorch/mmdet/models/losses/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .accuracy import Accuracy, accuracy from .cross_entropy_loss import (CrossEntropyLoss, binary_cross_entropy, diff --git a/cv/detection/autoassign/pytorch/mmdet/models/necks/__init__.py b/cv/detection/autoassign/pytorch/mmdet/models/necks/__init__.py index 1a8131554..e3f6a68a2 100755 --- a/cv/detection/autoassign/pytorch/mmdet/models/necks/__init__.py +++ b/cv/detection/autoassign/pytorch/mmdet/models/necks/__init__.py @@ -1,2 +1,3 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .fpn import FPN diff --git a/cv/detection/autoassign/pytorch/setup.py b/cv/detection/autoassign/pytorch/setup.py index e9ea12f3d..3cc9f7a46 100755 --- a/cv/detection/autoassign/pytorch/setup.py +++ b/cv/detection/autoassign/pytorch/setup.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. import glob import os import re diff --git a/cv/super_resolution/basicVSR++/pytorch/configs/basicvsr_plusplus/basicvsr_plusplus_c64n7_8x1_600k_reds4.py b/cv/super_resolution/basicVSR++/pytorch/configs/basicvsr_plusplus/basicvsr_plusplus_c64n7_8x1_600k_reds4.py index 7906cd818..2db94b926 100755 --- a/cv/super_resolution/basicVSR++/pytorch/configs/basicvsr_plusplus/basicvsr_plusplus_c64n7_8x1_600k_reds4.py +++ b/cv/super_resolution/basicVSR++/pytorch/configs/basicvsr_plusplus/basicvsr_plusplus_c64n7_8x1_600k_reds4.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. exp_name = 'basicvsr_plusplus_c64n7_8x1_600k_reds4' # model settings diff --git a/cv/super_resolution/basicVSR++/pytorch/dist_train.sh b/cv/super_resolution/basicVSR++/pytorch/dist_train.sh index 9ebbcc8a7..87c687cd7 100755 --- a/cv/super_resolution/basicVSR++/pytorch/dist_train.sh +++ b/cv/super_resolution/basicVSR++/pytorch/dist_train.sh @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. #!/usr/bin/env bash CONFIG=$1 diff --git a/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/common/cuda/modulated_deform_conv_cuda_kernel.cuh b/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/common/cuda/modulated_deform_conv_cuda_kernel.cuh index ca0e91a25..bf402a5f3 100755 --- a/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/common/cuda/modulated_deform_conv_cuda_kernel.cuh +++ b/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/common/cuda/modulated_deform_conv_cuda_kernel.cuh @@ -1,3 +1,5 @@ + +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. /*! ******************* BEGIN Caffe Copyright Notice and Disclaimer ***************** diff --git a/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/common/cuda/sync_bn_cuda_kernel.cuh b/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/common/cuda/sync_bn_cuda_kernel.cuh index 4ec6a4668..506dde9a9 100755 --- a/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/common/cuda/sync_bn_cuda_kernel.cuh +++ b/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/common/cuda/sync_bn_cuda_kernel.cuh @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. // Copyright (c) OpenMMLab. All rights reserved #ifndef SYNCBN_CUDA_KERNEL_CUH #define SYNCBN_CUDA_KERNEL_CUH diff --git a/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/pytorch/cuda/modulated_deform_conv_cuda.cu b/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/pytorch/cuda/modulated_deform_conv_cuda.cu index 27b706702..d0703f190 100755 --- a/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/pytorch/cuda/modulated_deform_conv_cuda.cu +++ b/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/pytorch/cuda/modulated_deform_conv_cuda.cu @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. // Copyright (c) OpenMMLab. All rights reserved #include "modulated_deform_conv_cuda_kernel.cuh" #include "pytorch_cuda_helper.hpp" diff --git a/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/pytorch/cuda/sync_bn_cuda.cu b/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/pytorch/cuda/sync_bn_cuda.cu index 657c81701..1f4b4565d 100755 --- a/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/pytorch/cuda/sync_bn_cuda.cu +++ b/cv/super_resolution/basicVSR++/pytorch/mmcv/ops/csrc/pytorch/cuda/sync_bn_cuda.cu @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. // Copyright (c) OpenMMLab. All rights reserved #include "pytorch_cuda_helper.hpp" #include "sync_bn_cuda_kernel.cuh" diff --git a/cv/super_resolution/basicVSR++/pytorch/mmedit/datasets/__init__.py b/cv/super_resolution/basicVSR++/pytorch/mmedit/datasets/__init__.py index 4b12041d6..ddc851190 100755 --- a/cv/super_resolution/basicVSR++/pytorch/mmedit/datasets/__init__.py +++ b/cv/super_resolution/basicVSR++/pytorch/mmedit/datasets/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .base_dataset import BaseDataset from .base_sr_dataset import BaseSRDataset diff --git a/cv/super_resolution/basicVSR++/pytorch/mmedit/datasets/pipelines/__init__.py b/cv/super_resolution/basicVSR++/pytorch/mmedit/datasets/pipelines/__init__.py index ed09b4e21..99f89af3b 100755 --- a/cv/super_resolution/basicVSR++/pytorch/mmedit/datasets/pipelines/__init__.py +++ b/cv/super_resolution/basicVSR++/pytorch/mmedit/datasets/pipelines/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .augmentation import (BinarizeImage, ColorJitter, CopyValues, Flip, GenerateFrameIndices, diff --git a/cv/super_resolution/basicVSR++/pytorch/mmedit/models/__init__.py b/cv/super_resolution/basicVSR++/pytorch/mmedit/models/__init__.py index c6c6bf58e..0a9fc9499 100755 --- a/cv/super_resolution/basicVSR++/pytorch/mmedit/models/__init__.py +++ b/cv/super_resolution/basicVSR++/pytorch/mmedit/models/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .backbones import * # noqa: F401, F403 from .base import BaseModel diff --git a/cv/super_resolution/basicVSR++/pytorch/mmedit/models/backbones/__init__.py b/cv/super_resolution/basicVSR++/pytorch/mmedit/models/backbones/__init__.py index 807771ea0..ce2c0f37f 100755 --- a/cv/super_resolution/basicVSR++/pytorch/mmedit/models/backbones/__init__.py +++ b/cv/super_resolution/basicVSR++/pytorch/mmedit/models/backbones/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .sr_backbones import (BasicVSRNet, BasicVSRPlusPlus, diff --git a/cv/super_resolution/basicVSR++/pytorch/mmedit/models/backbones/sr_backbones/__init__.py b/cv/super_resolution/basicVSR++/pytorch/mmedit/models/backbones/sr_backbones/__init__.py index 30fab41b3..9d976a991 100755 --- a/cv/super_resolution/basicVSR++/pytorch/mmedit/models/backbones/sr_backbones/__init__.py +++ b/cv/super_resolution/basicVSR++/pytorch/mmedit/models/backbones/sr_backbones/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .basicvsr_net import BasicVSRNet from .basicvsr_pp import BasicVSRPlusPlus diff --git a/cv/super_resolution/basicVSR++/pytorch/mmedit/models/losses/__init__.py b/cv/super_resolution/basicVSR++/pytorch/mmedit/models/losses/__init__.py index 9c791e7f3..339ee05c3 100755 --- a/cv/super_resolution/basicVSR++/pytorch/mmedit/models/losses/__init__.py +++ b/cv/super_resolution/basicVSR++/pytorch/mmedit/models/losses/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .pixelwise_loss import CharbonnierLoss, L1Loss, MaskedTVLoss, MSELoss from .utils import mask_reduce_loss, reduce_loss diff --git a/cv/super_resolution/basicVSR++/pytorch/mmedit/models/restorers/__init__.py b/cv/super_resolution/basicVSR++/pytorch/mmedit/models/restorers/__init__.py index 9ea22bb27..0583dd029 100755 --- a/cv/super_resolution/basicVSR++/pytorch/mmedit/models/restorers/__init__.py +++ b/cv/super_resolution/basicVSR++/pytorch/mmedit/models/restorers/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .basic_restorer import BasicRestorer from .basicvsr import BasicVSR diff --git a/cv/super_resolution/basicVSR++/pytorch/setup.py b/cv/super_resolution/basicVSR++/pytorch/setup.py index e9ea12f3d..3cc9f7a46 100755 --- a/cv/super_resolution/basicVSR++/pytorch/setup.py +++ b/cv/super_resolution/basicVSR++/pytorch/setup.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. import glob import os import re diff --git a/cv/super_resolution/basicVSR++/pytorch/train.py b/cv/super_resolution/basicVSR++/pytorch/train.py index 3bb7b5d5b..3da19786e 100755 --- a/cv/super_resolution/basicVSR++/pytorch/train.py +++ b/cv/super_resolution/basicVSR++/pytorch/train.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import argparse import copy diff --git a/cv/super_resolution/basicVSR/pytorch/configs/basicvsr/basicvsr_reds4.py b/cv/super_resolution/basicVSR/pytorch/configs/basicvsr/basicvsr_reds4.py index 73eb865ea..770877044 100755 --- a/cv/super_resolution/basicVSR/pytorch/configs/basicvsr/basicvsr_reds4.py +++ b/cv/super_resolution/basicVSR/pytorch/configs/basicvsr/basicvsr_reds4.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. exp_name = 'basicvsr_reds4' # model settings diff --git a/cv/super_resolution/basicVSR/pytorch/configs/iconvsr/iconvsr_reds4.py b/cv/super_resolution/basicVSR/pytorch/configs/iconvsr/iconvsr_reds4.py index 47f0ee53a..a62d9ab4d 100755 --- a/cv/super_resolution/basicVSR/pytorch/configs/iconvsr/iconvsr_reds4.py +++ b/cv/super_resolution/basicVSR/pytorch/configs/iconvsr/iconvsr_reds4.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. exp_name = 'iconvsr_reds4' # model settings diff --git a/cv/super_resolution/basicVSR/pytorch/dist_train.sh b/cv/super_resolution/basicVSR/pytorch/dist_train.sh index 9ebbcc8a7..87c687cd7 100755 --- a/cv/super_resolution/basicVSR/pytorch/dist_train.sh +++ b/cv/super_resolution/basicVSR/pytorch/dist_train.sh @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. #!/usr/bin/env bash CONFIG=$1 diff --git a/cv/super_resolution/basicVSR/pytorch/mmcv/ops/csrc/common/cuda/modulated_deform_conv_cuda_kernel.cuh b/cv/super_resolution/basicVSR/pytorch/mmcv/ops/csrc/common/cuda/modulated_deform_conv_cuda_kernel.cuh index ca0e91a25..8b1de4112 100755 --- a/cv/super_resolution/basicVSR/pytorch/mmcv/ops/csrc/common/cuda/modulated_deform_conv_cuda_kernel.cuh +++ b/cv/super_resolution/basicVSR/pytorch/mmcv/ops/csrc/common/cuda/modulated_deform_conv_cuda_kernel.cuh @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. /*! ******************* BEGIN Caffe Copyright Notice and Disclaimer ***************** diff --git a/cv/super_resolution/basicVSR/pytorch/mmcv/ops/csrc/common/cuda/sync_bn_cuda_kernel.cuh b/cv/super_resolution/basicVSR/pytorch/mmcv/ops/csrc/common/cuda/sync_bn_cuda_kernel.cuh index 4ec6a4668..506dde9a9 100755 --- a/cv/super_resolution/basicVSR/pytorch/mmcv/ops/csrc/common/cuda/sync_bn_cuda_kernel.cuh +++ b/cv/super_resolution/basicVSR/pytorch/mmcv/ops/csrc/common/cuda/sync_bn_cuda_kernel.cuh @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. // Copyright (c) OpenMMLab. All rights reserved #ifndef SYNCBN_CUDA_KERNEL_CUH #define SYNCBN_CUDA_KERNEL_CUH diff --git a/cv/super_resolution/basicVSR/pytorch/mmedit/datasets/pipelines/__init__.py b/cv/super_resolution/basicVSR/pytorch/mmedit/datasets/pipelines/__init__.py index ed09b4e21..99f89af3b 100755 --- a/cv/super_resolution/basicVSR/pytorch/mmedit/datasets/pipelines/__init__.py +++ b/cv/super_resolution/basicVSR/pytorch/mmedit/datasets/pipelines/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .augmentation import (BinarizeImage, ColorJitter, CopyValues, Flip, GenerateFrameIndices, diff --git a/cv/super_resolution/basicVSR/pytorch/mmedit/models/backbones/__init__.py b/cv/super_resolution/basicVSR/pytorch/mmedit/models/backbones/__init__.py index dd9292780..1135342f3 100755 --- a/cv/super_resolution/basicVSR/pytorch/mmedit/models/backbones/__init__.py +++ b/cv/super_resolution/basicVSR/pytorch/mmedit/models/backbones/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .sr_backbones import (BasicVSRNet, IconVSR) diff --git a/cv/super_resolution/basicVSR/pytorch/mmedit/models/backbones/sr_backbones/__init__.py b/cv/super_resolution/basicVSR/pytorch/mmedit/models/backbones/sr_backbones/__init__.py index 5f2560d0f..ae4736fd2 100755 --- a/cv/super_resolution/basicVSR/pytorch/mmedit/models/backbones/sr_backbones/__init__.py +++ b/cv/super_resolution/basicVSR/pytorch/mmedit/models/backbones/sr_backbones/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .basicvsr_net import BasicVSRNet from .iconvsr import IconVSR diff --git a/cv/super_resolution/basicVSR/pytorch/mmedit/models/losses/__init__.py b/cv/super_resolution/basicVSR/pytorch/mmedit/models/losses/__init__.py index 9c791e7f3..339ee05c3 100755 --- a/cv/super_resolution/basicVSR/pytorch/mmedit/models/losses/__init__.py +++ b/cv/super_resolution/basicVSR/pytorch/mmedit/models/losses/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .pixelwise_loss import CharbonnierLoss, L1Loss, MaskedTVLoss, MSELoss from .utils import mask_reduce_loss, reduce_loss diff --git a/cv/super_resolution/basicVSR/pytorch/mmedit/models/restorers/__init__.py b/cv/super_resolution/basicVSR/pytorch/mmedit/models/restorers/__init__.py index c14589be4..2493e965a 100755 --- a/cv/super_resolution/basicVSR/pytorch/mmedit/models/restorers/__init__.py +++ b/cv/super_resolution/basicVSR/pytorch/mmedit/models/restorers/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .basic_restorer import BasicRestorer from .basicvsr import BasicVSR diff --git a/cv/super_resolution/basicVSR/pytorch/requirements.txt b/cv/super_resolution/basicVSR/pytorch/requirements.txt index 033fc2d21..02481cb65 100755 --- a/cv/super_resolution/basicVSR/pytorch/requirements.txt +++ b/cv/super_resolution/basicVSR/pytorch/requirements.txt @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. yapf addict opencv-python<=4.5.4.60 diff --git a/cv/super_resolution/basicVSR/pytorch/setup.py b/cv/super_resolution/basicVSR/pytorch/setup.py index e9ea12f3d..3cc9f7a46 100755 --- a/cv/super_resolution/basicVSR/pytorch/setup.py +++ b/cv/super_resolution/basicVSR/pytorch/setup.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. import glob import os import re diff --git a/cv/super_resolution/basicVSR/pytorch/train.py b/cv/super_resolution/basicVSR/pytorch/train.py index 3bb7b5d5b..3da19786e 100755 --- a/cv/super_resolution/basicVSR/pytorch/train.py +++ b/cv/super_resolution/basicVSR/pytorch/train.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import argparse import copy diff --git a/cv/super_resolution/esrgan/pytorch/configs/esrgan_psnr_x4c64b23g32_g1_1000k_div2k.py b/cv/super_resolution/esrgan/pytorch/configs/esrgan_psnr_x4c64b23g32_g1_1000k_div2k.py index bc56b7edc..806fb64b4 100755 --- a/cv/super_resolution/esrgan/pytorch/configs/esrgan_psnr_x4c64b23g32_g1_1000k_div2k.py +++ b/cv/super_resolution/esrgan/pytorch/configs/esrgan_psnr_x4c64b23g32_g1_1000k_div2k.py @@ -1,4 +1,5 @@ -exp_name = 'esrgan_psnr_x4c64b23g32_g1_1000k_div2k' + # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. + exp_name = 'esrgan_psnr_x4c64b23g32_g1_1000k_div2k' scale = 4 # model settings diff --git a/cv/super_resolution/esrgan/pytorch/dist_train.sh b/cv/super_resolution/esrgan/pytorch/dist_train.sh index 9ebbcc8a7..87c687cd7 100755 --- a/cv/super_resolution/esrgan/pytorch/dist_train.sh +++ b/cv/super_resolution/esrgan/pytorch/dist_train.sh @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. #!/usr/bin/env bash CONFIG=$1 diff --git a/cv/super_resolution/esrgan/pytorch/get_div2k_anno.py b/cv/super_resolution/esrgan/pytorch/get_div2k_anno.py index feaba4197..7c4684644 100755 --- a/cv/super_resolution/esrgan/pytorch/get_div2k_anno.py +++ b/cv/super_resolution/esrgan/pytorch/get_div2k_anno.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. import mmcv from os import path as osp from PIL import Image diff --git a/cv/super_resolution/esrgan/pytorch/mmedit/datasets/__init__.py b/cv/super_resolution/esrgan/pytorch/mmedit/datasets/__init__.py index 063304a82..4de1c3ca2 100755 --- a/cv/super_resolution/esrgan/pytorch/mmedit/datasets/__init__.py +++ b/cv/super_resolution/esrgan/pytorch/mmedit/datasets/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .base_dataset import BaseDataset from .base_sr_dataset import BaseSRDataset diff --git a/cv/super_resolution/esrgan/pytorch/mmedit/datasets/pipelines/__init__.py b/cv/super_resolution/esrgan/pytorch/mmedit/datasets/pipelines/__init__.py index 8c9f0c70a..3b854fbba 100755 --- a/cv/super_resolution/esrgan/pytorch/mmedit/datasets/pipelines/__init__.py +++ b/cv/super_resolution/esrgan/pytorch/mmedit/datasets/pipelines/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .augmentation import (BinarizeImage, ColorJitter, CopyValues, Flip, GenerateFrameIndices, diff --git a/cv/super_resolution/esrgan/pytorch/mmedit/models/__init__.py b/cv/super_resolution/esrgan/pytorch/mmedit/models/__init__.py index bb87d2de1..6f60e2644 100755 --- a/cv/super_resolution/esrgan/pytorch/mmedit/models/__init__.py +++ b/cv/super_resolution/esrgan/pytorch/mmedit/models/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .backbones import * # noqa: F401, F403 from .base import BaseModel diff --git a/cv/super_resolution/esrgan/pytorch/mmedit/models/backbones/__init__.py b/cv/super_resolution/esrgan/pytorch/mmedit/models/backbones/__init__.py index 4d68d0ad6..c9e85d4eb 100755 --- a/cv/super_resolution/esrgan/pytorch/mmedit/models/backbones/__init__.py +++ b/cv/super_resolution/esrgan/pytorch/mmedit/models/backbones/__init__.py @@ -1,2 +1,3 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .sr_backbones import RRDBNet diff --git a/cv/super_resolution/esrgan/pytorch/mmedit/models/backbones/sr_backbones/__init__.py b/cv/super_resolution/esrgan/pytorch/mmedit/models/backbones/sr_backbones/__init__.py index 15268dc20..4351612b9 100755 --- a/cv/super_resolution/esrgan/pytorch/mmedit/models/backbones/sr_backbones/__init__.py +++ b/cv/super_resolution/esrgan/pytorch/mmedit/models/backbones/sr_backbones/__init__.py @@ -1,2 +1,3 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .rrdb_net import RRDBNet diff --git a/cv/super_resolution/esrgan/pytorch/mmedit/models/components/__init__.py b/cv/super_resolution/esrgan/pytorch/mmedit/models/components/__init__.py index 349e3f876..269a88f5c 100755 --- a/cv/super_resolution/esrgan/pytorch/mmedit/models/components/__init__.py +++ b/cv/super_resolution/esrgan/pytorch/mmedit/models/components/__init__.py @@ -1,2 +1,3 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .discriminators import ModifiedVGG diff --git a/cv/super_resolution/esrgan/pytorch/mmedit/models/components/discriminators/__init__.py b/cv/super_resolution/esrgan/pytorch/mmedit/models/components/discriminators/__init__.py index fa38305c7..b40cb7c29 100755 --- a/cv/super_resolution/esrgan/pytorch/mmedit/models/components/discriminators/__init__.py +++ b/cv/super_resolution/esrgan/pytorch/mmedit/models/components/discriminators/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .modified_vgg import ModifiedVGG diff --git a/cv/super_resolution/esrgan/pytorch/mmedit/models/losses/__init__.py b/cv/super_resolution/esrgan/pytorch/mmedit/models/losses/__init__.py index 98caae99b..a55b2aab2 100755 --- a/cv/super_resolution/esrgan/pytorch/mmedit/models/losses/__init__.py +++ b/cv/super_resolution/esrgan/pytorch/mmedit/models/losses/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .gan_loss import DiscShiftLoss, GANLoss, GaussianBlur, GradientPenaltyLoss from .perceptual_loss import (PerceptualLoss, PerceptualVGG, diff --git a/cv/super_resolution/esrgan/pytorch/mmedit/models/restorers/__init__.py b/cv/super_resolution/esrgan/pytorch/mmedit/models/restorers/__init__.py index 974fd0c56..7cc6a41c6 100755 --- a/cv/super_resolution/esrgan/pytorch/mmedit/models/restorers/__init__.py +++ b/cv/super_resolution/esrgan/pytorch/mmedit/models/restorers/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .esrgan import ESRGAN from .srgan import SRGAN diff --git a/cv/super_resolution/esrgan/pytorch/train.py b/cv/super_resolution/esrgan/pytorch/train.py index 59df219ad..7f36ed42a 100755 --- a/cv/super_resolution/esrgan/pytorch/train.py +++ b/cv/super_resolution/esrgan/pytorch/train.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import argparse import copy diff --git a/cv/super_resolution/liif/pytorch/configs/restorers/liif/liif_edsr_norm_c64b16_g1_1000k_div2k.py b/cv/super_resolution/liif/pytorch/configs/restorers/liif/liif_edsr_norm_c64b16_g1_1000k_div2k.py index ba46fe8ad..515c7de05 100755 --- a/cv/super_resolution/liif/pytorch/configs/restorers/liif/liif_edsr_norm_c64b16_g1_1000k_div2k.py +++ b/cv/super_resolution/liif/pytorch/configs/restorers/liif/liif_edsr_norm_c64b16_g1_1000k_div2k.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. + exp_name = 'liif_edsr_norm_c64b16_g1_1000k_div2k' scale_min, scale_max = 1, 4 diff --git a/cv/super_resolution/liif/pytorch/configs/restorers/liif/liif_rdn_norm_x2-4_c64b16_g1_1000k_div2k.py b/cv/super_resolution/liif/pytorch/configs/restorers/liif/liif_rdn_norm_x2-4_c64b16_g1_1000k_div2k.py index b5d8e3276..2dc933f1c 100755 --- a/cv/super_resolution/liif/pytorch/configs/restorers/liif/liif_rdn_norm_x2-4_c64b16_g1_1000k_div2k.py +++ b/cv/super_resolution/liif/pytorch/configs/restorers/liif/liif_rdn_norm_x2-4_c64b16_g1_1000k_div2k.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. + exp_name = 'liif_rdn_norm_x2-4_c64b16_g1_1000k_div2k' scale_min, scale_max = 1, 4 diff --git a/cv/super_resolution/liif/pytorch/dist_test.sh b/cv/super_resolution/liif/pytorch/dist_test.sh index a98e49f97..f5490ffba 100755 --- a/cv/super_resolution/liif/pytorch/dist_test.sh +++ b/cv/super_resolution/liif/pytorch/dist_test.sh @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + #!/usr/bin/env bash CONFIG=$1 diff --git a/cv/super_resolution/liif/pytorch/dist_train.sh b/cv/super_resolution/liif/pytorch/dist_train.sh index 9ebbcc8a7..0d970826f 100755 --- a/cv/super_resolution/liif/pytorch/dist_train.sh +++ b/cv/super_resolution/liif/pytorch/dist_train.sh @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + #!/usr/bin/env bash CONFIG=$1 diff --git a/cv/super_resolution/liif/pytorch/mmedit/__init__.py b/cv/super_resolution/liif/pytorch/mmedit/__init__.py index 05d4c20b7..d54482a88 100755 --- a/cv/super_resolution/liif/pytorch/mmedit/__init__.py +++ b/cv/super_resolution/liif/pytorch/mmedit/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import mmcv diff --git a/cv/super_resolution/liif/pytorch/mmedit/apis/__init__.py b/cv/super_resolution/liif/pytorch/mmedit/apis/__init__.py index e44ccbee6..3bdc96db8 100755 --- a/cv/super_resolution/liif/pytorch/mmedit/apis/__init__.py +++ b/cv/super_resolution/liif/pytorch/mmedit/apis/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .restoration_inference import restoration_inference from .test import multi_gpu_test, single_gpu_test diff --git a/cv/super_resolution/liif/pytorch/mmedit/core/__init__.py b/cv/super_resolution/liif/pytorch/mmedit/core/__init__.py index 2b24ce348..4c22f3be3 100755 --- a/cv/super_resolution/liif/pytorch/mmedit/core/__init__.py +++ b/cv/super_resolution/liif/pytorch/mmedit/core/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .evaluation import (DistEvalIterHook, EvalIterHook, L1Evaluation, mae, mse, psnr, reorder_image, sad, ssim) diff --git a/cv/super_resolution/liif/pytorch/mmedit/core/evaluation/__init__.py b/cv/super_resolution/liif/pytorch/mmedit/core/evaluation/__init__.py index 6e2f575c8..71f73c8c0 100755 --- a/cv/super_resolution/liif/pytorch/mmedit/core/evaluation/__init__.py +++ b/cv/super_resolution/liif/pytorch/mmedit/core/evaluation/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .eval_hooks import DistEvalIterHook, EvalIterHook from .metrics import (L1Evaluation, connectivity, gradient_error, mae, mse, diff --git a/cv/super_resolution/liif/pytorch/mmedit/datasets/__init__.py b/cv/super_resolution/liif/pytorch/mmedit/datasets/__init__.py index eb0daab93..b9cdcefd8 100755 --- a/cv/super_resolution/liif/pytorch/mmedit/datasets/__init__.py +++ b/cv/super_resolution/liif/pytorch/mmedit/datasets/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .base_dataset import BaseDataset from .base_sr_dataset import BaseSRDataset diff --git a/cv/super_resolution/liif/pytorch/mmedit/datasets/pipelines/__init__.py b/cv/super_resolution/liif/pytorch/mmedit/datasets/pipelines/__init__.py index 492615d83..aa37eaa1b 100755 --- a/cv/super_resolution/liif/pytorch/mmedit/datasets/pipelines/__init__.py +++ b/cv/super_resolution/liif/pytorch/mmedit/datasets/pipelines/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .augmentation import (BinarizeImage, ColorJitter, CopyValues, Flip, GenerateFrameIndices, diff --git a/cv/super_resolution/liif/pytorch/mmedit/models/__init__.py b/cv/super_resolution/liif/pytorch/mmedit/models/__init__.py index bce5a299e..d369082b6 100755 --- a/cv/super_resolution/liif/pytorch/mmedit/models/__init__.py +++ b/cv/super_resolution/liif/pytorch/mmedit/models/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .backbones import * # noqa: F401, F403 from .base import BaseModel diff --git a/cv/super_resolution/liif/pytorch/mmedit/models/backbones/__init__.py b/cv/super_resolution/liif/pytorch/mmedit/models/backbones/__init__.py index c2f351254..6170b0506 100755 --- a/cv/super_resolution/liif/pytorch/mmedit/models/backbones/__init__.py +++ b/cv/super_resolution/liif/pytorch/mmedit/models/backbones/__init__.py @@ -1,2 +1,3 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .sr_backbones import (LIIFEDSR, LIIFRDN, EDSR, RDN) diff --git a/cv/super_resolution/liif/pytorch/mmedit/models/backbones/sr_backbones/__init__.py b/cv/super_resolution/liif/pytorch/mmedit/models/backbones/sr_backbones/__init__.py index 10afada60..25e540a42 100755 --- a/cv/super_resolution/liif/pytorch/mmedit/models/backbones/sr_backbones/__init__.py +++ b/cv/super_resolution/liif/pytorch/mmedit/models/backbones/sr_backbones/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .liif_net import LIIFEDSR, LIIFRDN from .edsr import EDSR diff --git a/cv/super_resolution/liif/pytorch/mmedit/models/backbones/sr_backbones/rdn.py b/cv/super_resolution/liif/pytorch/mmedit/models/backbones/sr_backbones/rdn.py index 8a5ddd837..b4f073ae2 100644 --- a/cv/super_resolution/liif/pytorch/mmedit/models/backbones/sr_backbones/rdn.py +++ b/cv/super_resolution/liif/pytorch/mmedit/models/backbones/sr_backbones/rdn.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. import torch from mmcv.runner import load_checkpoint from torch import nn diff --git a/cv/super_resolution/liif/pytorch/mmedit/models/components/__init__.py b/cv/super_resolution/liif/pytorch/mmedit/models/components/__init__.py index 3b13f705e..6760f8852 100755 --- a/cv/super_resolution/liif/pytorch/mmedit/models/components/__init__.py +++ b/cv/super_resolution/liif/pytorch/mmedit/models/components/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .refiners import MLPRefiner diff --git a/cv/super_resolution/liif/pytorch/mmedit/models/components/refiners/__init__.py b/cv/super_resolution/liif/pytorch/mmedit/models/components/refiners/__init__.py index 5b6dc6adb..4ca125390 100755 --- a/cv/super_resolution/liif/pytorch/mmedit/models/components/refiners/__init__.py +++ b/cv/super_resolution/liif/pytorch/mmedit/models/components/refiners/__init__.py @@ -1,2 +1,3 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .mlp_refiner import MLPRefiner diff --git a/cv/super_resolution/liif/pytorch/mmedit/models/losses/__init__.py b/cv/super_resolution/liif/pytorch/mmedit/models/losses/__init__.py index b19b8e975..70f37077e 100755 --- a/cv/super_resolution/liif/pytorch/mmedit/models/losses/__init__.py +++ b/cv/super_resolution/liif/pytorch/mmedit/models/losses/__init__.py @@ -1,2 +1,3 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .pixelwise_loss import CharbonnierLoss, L1Loss, MaskedTVLoss, MSELoss diff --git a/cv/super_resolution/liif/pytorch/mmedit/models/losses/utils.py b/cv/super_resolution/liif/pytorch/mmedit/models/losses/utils.py index 2f536d924..75f1dae26 100755 --- a/cv/super_resolution/liif/pytorch/mmedit/models/losses/utils.py +++ b/cv/super_resolution/liif/pytorch/mmedit/models/losses/utils.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import functools diff --git a/cv/super_resolution/liif/pytorch/mmedit/models/restorers/__init__.py b/cv/super_resolution/liif/pytorch/mmedit/models/restorers/__init__.py index b1c6bc739..5b41b3d74 100755 --- a/cv/super_resolution/liif/pytorch/mmedit/models/restorers/__init__.py +++ b/cv/super_resolution/liif/pytorch/mmedit/models/restorers/__init__.py @@ -1,2 +1,3 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .liif import LIIF diff --git a/cv/super_resolution/liif/pytorch/requirements.txt b/cv/super_resolution/liif/pytorch/requirements.txt index a0505250c..781fccb74 100755 --- a/cv/super_resolution/liif/pytorch/requirements.txt +++ b/cv/super_resolution/liif/pytorch/requirements.txt @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + addict yapf opencv-python diff --git a/cv/super_resolution/liif/pytorch/test.py b/cv/super_resolution/liif/pytorch/test.py index b1dfd091f..0031ff75e 100755 --- a/cv/super_resolution/liif/pytorch/test.py +++ b/cv/super_resolution/liif/pytorch/test.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import argparse import os diff --git a/cv/super_resolution/liif/pytorch/train.py b/cv/super_resolution/liif/pytorch/train.py index d7a23f91b..9a1068ac9 100755 --- a/cv/super_resolution/liif/pytorch/train.py +++ b/cv/super_resolution/liif/pytorch/train.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import argparse import copy diff --git a/cv/super_resolution/real_basicVSR/pytorch/configs/real_basicvsr/realbasicvsr_c64b20_1x30x8_lr5e-5_150k_reds.py b/cv/super_resolution/real_basicVSR/pytorch/configs/real_basicvsr/realbasicvsr_c64b20_1x30x8_lr5e-5_150k_reds.py index 8fcce72f5..7f5354d4b 100755 --- a/cv/super_resolution/real_basicVSR/pytorch/configs/real_basicvsr/realbasicvsr_c64b20_1x30x8_lr5e-5_150k_reds.py +++ b/cv/super_resolution/real_basicVSR/pytorch/configs/real_basicvsr/realbasicvsr_c64b20_1x30x8_lr5e-5_150k_reds.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. exp_name = 'realbasicvsr_c64b20_1x30x8_lr5e-5_150k_reds' scale = 4 diff --git a/cv/super_resolution/real_basicVSR/pytorch/configs/real_basicvsr/realbasicvsr_wogan_c64b20_2x30x8_lr1e-4_300k_reds.py b/cv/super_resolution/real_basicVSR/pytorch/configs/real_basicvsr/realbasicvsr_wogan_c64b20_2x30x8_lr1e-4_300k_reds.py index eb5232af5..f6557e3b2 100755 --- a/cv/super_resolution/real_basicVSR/pytorch/configs/real_basicvsr/realbasicvsr_wogan_c64b20_2x30x8_lr1e-4_300k_reds.py +++ b/cv/super_resolution/real_basicVSR/pytorch/configs/real_basicvsr/realbasicvsr_wogan_c64b20_2x30x8_lr1e-4_300k_reds.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. exp_name = 'realbasicvsr_wogan_c64b20_2x30x8_lr1e-4_300k_reds' scale = 4 diff --git a/cv/super_resolution/real_basicVSR/pytorch/crop_sub_images.py b/cv/super_resolution/real_basicVSR/pytorch/crop_sub_images.py index 334c50cda..fd96ac790 100755 --- a/cv/super_resolution/real_basicVSR/pytorch/crop_sub_images.py +++ b/cv/super_resolution/real_basicVSR/pytorch/crop_sub_images.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import argparse import os diff --git a/cv/super_resolution/real_basicVSR/pytorch/dist_test.sh b/cv/super_resolution/real_basicVSR/pytorch/dist_test.sh index 1e7e7b49c..282eef5ff 100644 --- a/cv/super_resolution/real_basicVSR/pytorch/dist_test.sh +++ b/cv/super_resolution/real_basicVSR/pytorch/dist_test.sh @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. #!/usr/bin/env bash CONFIG=$1 diff --git a/cv/super_resolution/real_basicVSR/pytorch/dist_train.sh b/cv/super_resolution/real_basicVSR/pytorch/dist_train.sh index 9ebbcc8a7..87c687cd7 100755 --- a/cv/super_resolution/real_basicVSR/pytorch/dist_train.sh +++ b/cv/super_resolution/real_basicVSR/pytorch/dist_train.sh @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. #!/usr/bin/env bash CONFIG=$1 diff --git a/cv/super_resolution/real_basicVSR/pytorch/mmedit/datasets/__init__.py b/cv/super_resolution/real_basicVSR/pytorch/mmedit/datasets/__init__.py index 0dcf6b5a9..fffbe59a5 100755 --- a/cv/super_resolution/real_basicVSR/pytorch/mmedit/datasets/__init__.py +++ b/cv/super_resolution/real_basicVSR/pytorch/mmedit/datasets/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .base_dataset import BaseDataset from .base_sr_dataset import BaseSRDataset diff --git a/cv/super_resolution/real_basicVSR/pytorch/mmedit/datasets/pipelines/__init__.py b/cv/super_resolution/real_basicVSR/pytorch/mmedit/datasets/pipelines/__init__.py index 2c6ed9c87..8d0de436a 100755 --- a/cv/super_resolution/real_basicVSR/pytorch/mmedit/datasets/pipelines/__init__.py +++ b/cv/super_resolution/real_basicVSR/pytorch/mmedit/datasets/pipelines/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .augmentation import (BinarizeImage, ColorJitter, CopyValues, Flip, GenerateFrameIndices, diff --git a/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/__init__.py b/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/__init__.py index 18468b582..854a4acd7 100755 --- a/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/__init__.py +++ b/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .backbones import * # noqa: F401, F403 from .base import BaseModel diff --git a/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/backbones/__init__.py b/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/backbones/__init__.py index fd69ad543..210bb84f1 100755 --- a/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/backbones/__init__.py +++ b/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/backbones/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .sr_backbones import RealBasicVSRNet diff --git a/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/backbones/sr_backbones/__init__.py b/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/backbones/sr_backbones/__init__.py index ba628d5a9..b780bbd97 100755 --- a/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/backbones/sr_backbones/__init__.py +++ b/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/backbones/sr_backbones/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .basicvsr_net import BasicVSRNet from .real_basicvsr_net import RealBasicVSRNet diff --git a/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/components/discriminators/__init__.py b/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/components/discriminators/__init__.py index 52d484729..629a5d2ec 100755 --- a/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/components/discriminators/__init__.py +++ b/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/components/discriminators/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .unet_disc import UNetDiscriminatorWithSpectralNorm diff --git a/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/losses/__init__.py b/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/losses/__init__.py index 4860d35ba..434f552c5 100755 --- a/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/losses/__init__.py +++ b/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/losses/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .gan_loss import DiscShiftLoss, GANLoss, GaussianBlur, GradientPenaltyLoss from .perceptual_loss import (PerceptualLoss, PerceptualVGG, diff --git a/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/restorers/__init__.py b/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/restorers/__init__.py index 449415a3c..853a26590 100755 --- a/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/restorers/__init__.py +++ b/cv/super_resolution/real_basicVSR/pytorch/mmedit/models/restorers/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. from .basic_restorer import BasicRestorer from .real_basicvsr import RealBasicVSR diff --git a/cv/super_resolution/real_basicVSR/pytorch/setup.py b/cv/super_resolution/real_basicVSR/pytorch/setup.py index e9ea12f3d..3cc9f7a46 100755 --- a/cv/super_resolution/real_basicVSR/pytorch/setup.py +++ b/cv/super_resolution/real_basicVSR/pytorch/setup.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. import glob import os import re diff --git a/cv/super_resolution/real_basicVSR/pytorch/test.py b/cv/super_resolution/real_basicVSR/pytorch/test.py index 8313587b7..677290483 100644 --- a/cv/super_resolution/real_basicVSR/pytorch/test.py +++ b/cv/super_resolution/real_basicVSR/pytorch/test.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import argparse import os diff --git a/cv/super_resolution/real_basicVSR/pytorch/train.py b/cv/super_resolution/real_basicVSR/pytorch/train.py index 3bb7b5d5b..3da19786e 100755 --- a/cv/super_resolution/real_basicVSR/pytorch/train.py +++ b/cv/super_resolution/real_basicVSR/pytorch/train.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import argparse import copy diff --git a/cv/super_resolution/ttsr/pytorch/dataset/dataloader.py b/cv/super_resolution/ttsr/pytorch/dataset/dataloader.py index 326031d8b..51d5a536b 100755 --- a/cv/super_resolution/ttsr/pytorch/dataset/dataloader.py +++ b/cv/super_resolution/ttsr/pytorch/dataset/dataloader.py @@ -1,3 +1,6 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. + + from torch.utils.data import DataLoader import torch from importlib import import_module diff --git a/cv/super_resolution/ttsr/pytorch/loss/loss.py b/cv/super_resolution/ttsr/pytorch/loss/loss.py index a3566a88e..f0f9d7aa5 100755 --- a/cv/super_resolution/ttsr/pytorch/loss/loss.py +++ b/cv/super_resolution/ttsr/pytorch/loss/loss.py @@ -1,3 +1,6 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. + + from loss import discriminator import os import torch diff --git a/cv/super_resolution/ttsr/pytorch/main.py b/cv/super_resolution/ttsr/pytorch/main.py index 3331953e5..01cf673b1 100755 --- a/cv/super_resolution/ttsr/pytorch/main.py +++ b/cv/super_resolution/ttsr/pytorch/main.py @@ -1,3 +1,6 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. + + from option import args from utils import mkExpDir,Logger from dataset import dataloader diff --git a/cv/super_resolution/ttsr/pytorch/train.sh b/cv/super_resolution/ttsr/pytorch/train.sh index 4f24a6b03..7b5b312d9 100755 --- a/cv/super_resolution/ttsr/pytorch/train.sh +++ b/cv/super_resolution/ttsr/pytorch/train.sh @@ -1,3 +1,6 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. + + ### training TTSR GPUS=$1 diff --git a/cv/super_resolution/ttsr/pytorch/trainer.py b/cv/super_resolution/ttsr/pytorch/trainer.py index c28cb0c21..e41495818 100755 --- a/cv/super_resolution/ttsr/pytorch/trainer.py +++ b/cv/super_resolution/ttsr/pytorch/trainer.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. + from utils import calc_psnr_and_ssim from model import Vgg19 diff --git a/cv/super_resolution/ttsr/pytorch/utils.py b/cv/super_resolution/ttsr/pytorch/utils.py index 84ece82c4..685b2713f 100755 --- a/cv/super_resolution/ttsr/pytorch/utils.py +++ b/cv/super_resolution/ttsr/pytorch/utils.py @@ -1,3 +1,6 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. + + import math import numpy as np import logging diff --git a/cv/super_resolution/ttvsr/pytorch/configs/TTVSR_reds4.py b/cv/super_resolution/ttvsr/pytorch/configs/TTVSR_reds4.py index 73019ae58..9163be06c 100755 --- a/cv/super_resolution/ttvsr/pytorch/configs/TTVSR_reds4.py +++ b/cv/super_resolution/ttvsr/pytorch/configs/TTVSR_reds4.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. exp_name = 'ttvsr_reds4' # model settings diff --git a/cv/super_resolution/ttvsr/pytorch/dist_train.sh b/cv/super_resolution/ttvsr/pytorch/dist_train.sh index 1dd1da802..5879576a4 100755 --- a/cv/super_resolution/ttvsr/pytorch/dist_train.sh +++ b/cv/super_resolution/ttvsr/pytorch/dist_train.sh @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. + #!/usr/bin/env bash CONFIG=$1 diff --git a/cv/super_resolution/ttvsr/pytorch/mmcv/cnn/bricks/activation.py b/cv/super_resolution/ttvsr/pytorch/mmcv/cnn/bricks/activation.py index 79f198838..9940266cf 100755 --- a/cv/super_resolution/ttvsr/pytorch/mmcv/cnn/bricks/activation.py +++ b/cv/super_resolution/ttvsr/pytorch/mmcv/cnn/bricks/activation.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn diff --git a/cv/super_resolution/ttvsr/pytorch/mmcv/cnn/bricks/context_block.py b/cv/super_resolution/ttvsr/pytorch/mmcv/cnn/bricks/context_block.py index d60fdb904..9d48ab1df 100755 --- a/cv/super_resolution/ttvsr/pytorch/mmcv/cnn/bricks/context_block.py +++ b/cv/super_resolution/ttvsr/pytorch/mmcv/cnn/bricks/context_block.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import torch from torch import nn diff --git a/cv/super_resolution/ttvsr/pytorch/mmedit/apis/__init__.py b/cv/super_resolution/ttvsr/pytorch/mmedit/apis/__init__.py index a3820a0a7..5ac99284b 100755 --- a/cv/super_resolution/ttvsr/pytorch/mmedit/apis/__init__.py +++ b/cv/super_resolution/ttvsr/pytorch/mmedit/apis/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. from .test import multi_gpu_test, single_gpu_test from .train import set_random_seed, train_model diff --git a/cv/super_resolution/ttvsr/pytorch/mmedit/models/common/__init__.py b/cv/super_resolution/ttvsr/pytorch/mmedit/models/common/__init__.py index a140dff6b..45c0a6801 100755 --- a/cv/super_resolution/ttvsr/pytorch/mmedit/models/common/__init__.py +++ b/cv/super_resolution/ttvsr/pytorch/mmedit/models/common/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. from .flow_warp import flow_warp from .sr_backbone_utils import (ResidualBlockNoBN, default_init_weights, make_layer) diff --git a/cv/super_resolution/ttvsr/pytorch/mmedit/models/losses/__init__.py b/cv/super_resolution/ttvsr/pytorch/mmedit/models/losses/__init__.py index 51ef22c4d..67a36857f 100755 --- a/cv/super_resolution/ttvsr/pytorch/mmedit/models/losses/__init__.py +++ b/cv/super_resolution/ttvsr/pytorch/mmedit/models/losses/__init__.py @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. from .pixelwise_loss import CharbonnierLoss, L1Loss, MSELoss from .utils import mask_reduce_loss, reduce_loss diff --git a/cv/super_resolution/ttvsr/pytorch/requirements.txt b/cv/super_resolution/ttvsr/pytorch/requirements.txt index 31e529951..a1b0ddc8b 100755 --- a/cv/super_resolution/ttvsr/pytorch/requirements.txt +++ b/cv/super_resolution/ttvsr/pytorch/requirements.txt @@ -1,3 +1,4 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. lmdb scikit-image yapf diff --git a/cv/super_resolution/ttvsr/pytorch/setup.py b/cv/super_resolution/ttvsr/pytorch/setup.py index e9ea12f3d..890ede23c 100755 --- a/cv/super_resolution/ttvsr/pytorch/setup.py +++ b/cv/super_resolution/ttvsr/pytorch/setup.py @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import glob import os import re diff --git a/cv/super_resolution/ttvsr/pytorch/train.py b/cv/super_resolution/ttvsr/pytorch/train.py index b197f2f6e..d15e7e991 100755 --- a/cv/super_resolution/ttvsr/pytorch/train.py +++ b/cv/super_resolution/ttvsr/pytorch/train.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. + import argparse import copy import os -- Gitee From 07edb20879bc32990ab522af32994d2fd2b1a75d Mon Sep 17 00:00:00 2001 From: "wenfeng.zhang" Date: Tue, 22 Nov 2022 14:59:38 +0800 Subject: [PATCH 02/10] add license for yolof --- cv/detection/yolof/pytorch/mmcv/__init__.py | 14 ++++++++++++++ .../yolof/pytorch/mmcv/cnn/bricks/__init__.py | 2 ++ cv/detection/yolof/pytorch/mmcv/ops/__init__.py | 2 ++ .../yolof/pytorch/mmcv/ops/csrc/pytorch/pybind.cpp | 2 ++ cv/detection/yolof/pytorch/mmdet/apis/__init__.py | 2 ++ cv/detection/yolof/pytorch/mmdet/core/__init__.py | 2 ++ .../yolof/pytorch/mmdet/core/anchor/__init__.py | 2 ++ .../yolof/pytorch/mmdet/datasets/__init__.py | 2 ++ cv/detection/yolof/pytorch/train.sh | 2 ++ cv/detection/yolof/pytorch/train_dist.sh | 2 ++ 10 files changed, 32 insertions(+) diff --git a/cv/detection/yolof/pytorch/mmcv/__init__.py b/cv/detection/yolof/pytorch/mmcv/__init__.py index c612f8a34..b41b49aeb 100755 --- a/cv/detection/yolof/pytorch/mmcv/__init__.py +++ b/cv/detection/yolof/pytorch/mmcv/__init__.py @@ -1,4 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # flake8: noqa from .fileio import * from .image import * diff --git a/cv/detection/yolof/pytorch/mmcv/cnn/bricks/__init__.py b/cv/detection/yolof/pytorch/mmcv/cnn/bricks/__init__.py index 26b7fb491..02ec44932 100755 --- a/cv/detection/yolof/pytorch/mmcv/cnn/bricks/__init__.py +++ b/cv/detection/yolof/pytorch/mmcv/cnn/bricks/__init__.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. from .activation import build_activation_layer from .conv import build_conv_layer diff --git a/cv/detection/yolof/pytorch/mmcv/ops/__init__.py b/cv/detection/yolof/pytorch/mmcv/ops/__init__.py index cdd234917..b2063c0f9 100755 --- a/cv/detection/yolof/pytorch/mmcv/ops/__init__.py +++ b/cv/detection/yolof/pytorch/mmcv/ops/__init__.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. from .info import (get_compiler_version, get_compiling_cuda_version) from .nms import nms, batched_nms diff --git a/cv/detection/yolof/pytorch/mmcv/ops/csrc/pytorch/pybind.cpp b/cv/detection/yolof/pytorch/mmcv/ops/csrc/pytorch/pybind.cpp index 5803dc10d..da2150834 100755 --- a/cv/detection/yolof/pytorch/mmcv/ops/csrc/pytorch/pybind.cpp +++ b/cv/detection/yolof/pytorch/mmcv/ops/csrc/pytorch/pybind.cpp @@ -1,3 +1,5 @@ +// Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +// All Rights Reserved. // Copyright (c) OpenMMLab. All rights reserved #include "pytorch_cpp_helper.hpp" diff --git a/cv/detection/yolof/pytorch/mmdet/apis/__init__.py b/cv/detection/yolof/pytorch/mmdet/apis/__init__.py index 27b00a661..664340f7b 100755 --- a/cv/detection/yolof/pytorch/mmdet/apis/__init__.py +++ b/cv/detection/yolof/pytorch/mmdet/apis/__init__.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. from .test import multi_gpu_test, single_gpu_test from .train import (get_root_logger, init_random_seed, set_random_seed, diff --git a/cv/detection/yolof/pytorch/mmdet/core/__init__.py b/cv/detection/yolof/pytorch/mmdet/core/__init__.py index a8b9cbd23..1c02fc739 100755 --- a/cv/detection/yolof/pytorch/mmdet/core/__init__.py +++ b/cv/detection/yolof/pytorch/mmdet/core/__init__.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. from .anchor import * # noqa: F401, F403 from .bbox import * # noqa: F401, F403 diff --git a/cv/detection/yolof/pytorch/mmdet/core/anchor/__init__.py b/cv/detection/yolof/pytorch/mmdet/core/anchor/__init__.py index 35140877c..4ee8ebadb 100755 --- a/cv/detection/yolof/pytorch/mmdet/core/anchor/__init__.py +++ b/cv/detection/yolof/pytorch/mmdet/core/anchor/__init__.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # # Copyright (c) OpenMMLab. All rights reserved. from .anchor_generator import AnchorGenerator from .builder import PRIOR_GENERATORS, build_prior_generator diff --git a/cv/detection/yolof/pytorch/mmdet/datasets/__init__.py b/cv/detection/yolof/pytorch/mmdet/datasets/__init__.py index 6852c38fe..7f1c7ace3 100755 --- a/cv/detection/yolof/pytorch/mmdet/datasets/__init__.py +++ b/cv/detection/yolof/pytorch/mmdet/datasets/__init__.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. from .builder import DATASETS, PIPELINES, build_dataloader, build_dataset from .coco import CocoDataset diff --git a/cv/detection/yolof/pytorch/train.sh b/cv/detection/yolof/pytorch/train.sh index 80009fd7a..906fa748c 100755 --- a/cv/detection/yolof/pytorch/train.sh +++ b/cv/detection/yolof/pytorch/train.sh @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # CONFIG=$1 # PYTHONPATH="$(dirname $0)/..":$PYTHONPATH \ diff --git a/cv/detection/yolof/pytorch/train_dist.sh b/cv/detection/yolof/pytorch/train_dist.sh index 9ebbcc8a7..44c980480 100755 --- a/cv/detection/yolof/pytorch/train_dist.sh +++ b/cv/detection/yolof/pytorch/train_dist.sh @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. #!/usr/bin/env bash CONFIG=$1 -- Gitee From 06deea2fe2c1a32a6a32234705c27dbd246a07ef Mon Sep 17 00:00:00 2001 From: "xiaomei.wang" Date: Wed, 23 Nov 2022 16:48:06 +0800 Subject: [PATCH 03/10] Add the license --- cv/classification/alexnet/pytorch/__init__.py | 15 + .../alexnet/pytorch/common_utils/__init__.py | 17 +- .../alexnet/pytorch/common_utils/dist.py | 18 +- .../pytorch/common_utils/metric_logger.py | 18 +- .../alexnet/pytorch/common_utils/misc.py | 17 +- .../pytorch/common_utils/smooth_value.py | 19 +- .../alexnet/pytorch/dataloader/__init__.py | 14 + .../pytorch/dataloader/classification.py | 23 +- .../pytorch/dataloader/dali_classification.py | 26 +- .../pytorch/dataloader/utils/__init__.py | 14 + .../utils/presets_classification.py | 17 +- .../alexnet/pytorch/model/alexnet.py | 15 + .../pytorch/start_scripts/get_num_devices.sh | 14 + .../start_scripts/train_alexnet_amp_torch.sh | 14 + .../train_alexnet_dist_amp_torch.sh | 14 + .../start_scripts/train_alexnet_dist_torch.sh | 14 + .../start_scripts/train_alexnet_torch.sh | 14 + cv/classification/alexnet/pytorch/train.py | 17 +- .../alexnet/pytorch/train_horovod.py | 300 ----------------- cv/classification/alexnet/pytorch/utils_.py | 17 +- .../squeezenet/pytorch/__init__.py | 22 +- .../pytorch/common_utils/__init__.py | 23 +- .../squeezenet/pytorch/common_utils/dist.py | 17 +- .../pytorch/common_utils/metric_logger.py | 17 +- .../squeezenet/pytorch/common_utils/misc.py | 22 +- .../pytorch/common_utils/smooth_value.py | 17 +- .../squeezenet/pytorch/dataloader/__init__.py | 22 +- .../pytorch/dataloader/classification.py | 22 +- .../pytorch/dataloader/dali_classification.py | 22 +- .../pytorch/dataloader/utils/__init__.py | 22 +- .../utils/presets_classification.py | 17 +- .../squeezenet/pytorch/model/squeezenet.py | 23 +- cv/classification/squeezenet/pytorch/train.py | 17 +- .../squeezenet/pytorch/train_horovod.py | 308 ------------------ .../squeezenet/pytorch/utils_.py | 18 +- .../icnet/pytorch/model/builder.py | 16 + .../icnet/pytorch/run_train.py | 15 +- .../icnet/pytorch/train_icnet_r50_dist.sh | 15 + .../lednet/pytorch/model/__init__.py | 15 + .../lednet/pytorch/model/builder.py | 16 + .../lednet/pytorch/model/models/__init__.py | 15 + .../pytorch/model/models/backbones/build.py | 16 + .../pytorch/model/models/backbones/eespnet.py | 16 + .../pytorch/model/models/backbones/hrnet.py | 17 + .../model/models/backbones/mobilenet.py | 16 + .../pytorch/model/models/backbones/resnet.py | 17 + .../model/models/backbones/xception.py | 16 + .../lednet/pytorch/model/models/lednet.py | 16 + .../lednet/pytorch/model/models/segbase.py | 16 + .../lednet/pytorch/model/modules/module.py | 17 + .../lednet/pytorch/model/utils/__init__.py | 15 + .../lednet/pytorch/model/utils/registry.py | 17 + .../lednet/pytorch/run_train.py | 16 +- .../lednet/pytorch/train_lednet_dist.sh | 15 + .../ocnet/pytorch/model/__init__.py | 14 + .../ocnet/pytorch/model/builder.py | 16 + .../ocnet/pytorch/model/models/__init__.py | 16 + .../pytorch/model/models/backbones/build.py | 16 + .../pytorch/model/models/backbones/eespnet.py | 16 + .../pytorch/model/models/backbones/hrnet.py | 16 + .../model/models/backbones/mobilenet.py | 16 + .../pytorch/model/models/backbones/resnet.py | 16 + .../model/models/backbones/xception.py | 16 + .../ocnet/pytorch/model/models/ocnet.py | 16 + .../ocnet/pytorch/model/models/segbase.py | 16 + .../ocnet/pytorch/model/modules/module.py | 16 + .../ocnet/pytorch/model/utils/__init__.py | 14 + .../ocnet/pytorch/model/utils/registry.py | 16 + .../ocnet/pytorch/run_train.py | 16 +- .../ocnet/pytorch/train_ocnet_r50_dist.sh | 15 + .../psanet/pytorch/model/__init__.py | 14 + .../pytorch/model/base_model/__init__.py | 15 + .../psanet/pytorch/model/base_model/resnet.py | 15 + .../pytorch/model/base_model/xception.py | 15 + .../psanet/pytorch/model/psanet/__init__.py | 14 + .../pytorch/model/psanet/psanet_r101_v1c.py | 16 + .../pytorch/model/psanet/psanet_r50_v1c.py | 16 + .../psanet/pytorch/run_train.py | 16 +- .../psanet/pytorch/train_psanet_dist.sh | 15 + .../refinenet/pytorch/model/__init__.py | 14 + .../refinenet/pytorch/model/builder.py | 16 + .../pytorch/model/models/__init__.py | 16 + .../pytorch/model/models/backbones/build.py | 16 + .../pytorch/model/models/backbones/eespnet.py | 16 + .../pytorch/model/models/backbones/hrnet.py | 16 + .../model/models/backbones/mobilenet.py | 16 + .../pytorch/model/models/backbones/resnet.py | 17 + .../model/models/backbones/xception.py | 16 + .../pytorch/model/models/refinenet.py | 16 + .../refinenet/pytorch/model/models/segbase.py | 16 + .../refinenet/pytorch/model/modules/module.py | 16 + .../refinenet/pytorch/model/utils/__init__.py | 14 + .../refinenet/pytorch/model/utils/registry.py | 16 + .../refinenet/pytorch/run_train.py | 15 +- .../refinenet/pytorch/train_refinenet_dist.sh | 15 + .../unet/pytorch/model/__init__.py | 14 + .../unet/pytorch/model/builder.py | 16 + .../unet/pytorch/model/models/__init__.py | 16 + .../pytorch/model/models/backbones/build.py | 16 + .../pytorch/model/models/backbones/eespnet.py | 16 + .../pytorch/model/models/backbones/hrnet.py | 16 + .../model/models/backbones/mobilenet.py | 16 + .../pytorch/model/models/backbones/resnet.py | 16 + .../model/models/backbones/xception.py | 16 + .../unet/pytorch/model/models/segbase.py | 16 + .../unet/pytorch/model/models/unet.py | 16 + .../unet/pytorch/model/modules/module.py | 16 + .../unet/pytorch/model/utils/__init__.py | 14 + .../unet/pytorch/model/utils/registry.py | 16 + .../unet/pytorch/run_train.py | 16 +- .../unet/pytorch/train_unet_dist.sh | 15 + 111 files changed, 1672 insertions(+), 725 deletions(-) delete mode 100644 cv/classification/alexnet/pytorch/train_horovod.py delete mode 100644 cv/classification/squeezenet/pytorch/train_horovod.py diff --git a/cv/classification/alexnet/pytorch/__init__.py b/cv/classification/alexnet/pytorch/__init__.py index 6faec1658..011573976 100644 --- a/cv/classification/alexnet/pytorch/__init__.py +++ b/cv/classification/alexnet/pytorch/__init__.py @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + from .utils import * from .common_utils import * from .data_loader import * diff --git a/cv/classification/alexnet/pytorch/common_utils/__init__.py b/cv/classification/alexnet/pytorch/common_utils/__init__.py index 32e8c4f57..7d2e011f7 100644 --- a/cv/classification/alexnet/pytorch/common_utils/__init__.py +++ b/cv/classification/alexnet/pytorch/common_utils/__init__.py @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import random import numpy as np @@ -20,4 +35,4 @@ def manual_seed(seed, deterministic=False): torch.backends.cudnn.benchmark = False else: torch.backends.cudnn.deterministic = False - torch.backends.cudnn.benchmark = True \ No newline at end of file + torch.backends.cudnn.benchmark = True diff --git a/cv/classification/alexnet/pytorch/common_utils/dist.py b/cv/classification/alexnet/pytorch/common_utils/dist.py index ea56ca267..767b6ce00 100644 --- a/cv/classification/alexnet/pytorch/common_utils/dist.py +++ b/cv/classification/alexnet/pytorch/common_utils/dist.py @@ -1,6 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from collections import defaultdict, deque import datetime diff --git a/cv/classification/alexnet/pytorch/common_utils/metric_logger.py b/cv/classification/alexnet/pytorch/common_utils/metric_logger.py index 960641c4d..ab9c61b0b 100644 --- a/cv/classification/alexnet/pytorch/common_utils/metric_logger.py +++ b/cv/classification/alexnet/pytorch/common_utils/metric_logger.py @@ -1,6 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from collections import defaultdict import datetime diff --git a/cv/classification/alexnet/pytorch/common_utils/misc.py b/cv/classification/alexnet/pytorch/common_utils/misc.py index c9b501cf8..8c5e49bcd 100644 --- a/cv/classification/alexnet/pytorch/common_utils/misc.py +++ b/cv/classification/alexnet/pytorch/common_utils/misc.py @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import os import sys import errno @@ -8,4 +23,4 @@ def mkdir(path): os.makedirs(path) except OSError as e: if e.errno != errno.EEXIST: - raise \ No newline at end of file + raise diff --git a/cv/classification/alexnet/pytorch/common_utils/smooth_value.py b/cv/classification/alexnet/pytorch/common_utils/smooth_value.py index 30cb89d60..8c1fadae2 100644 --- a/cv/classification/alexnet/pytorch/common_utils/smooth_value.py +++ b/cv/classification/alexnet/pytorch/common_utils/smooth_value.py @@ -1,5 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from collections import defaultdict, deque @@ -72,4 +85,4 @@ class SmoothedValue(object): avg=self.avg, global_avg=self.global_avg, max=self.max, - value=self.value) \ No newline at end of file + value=self.value) diff --git a/cv/classification/alexnet/pytorch/dataloader/__init__.py b/cv/classification/alexnet/pytorch/dataloader/__init__.py index e69de29bb..66b217b85 100644 --- a/cv/classification/alexnet/pytorch/dataloader/__init__.py +++ b/cv/classification/alexnet/pytorch/dataloader/__init__.py @@ -0,0 +1,14 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. \ No newline at end of file diff --git a/cv/classification/alexnet/pytorch/dataloader/classification.py b/cv/classification/alexnet/pytorch/dataloader/classification.py index 030af6dee..317a9874e 100644 --- a/cv/classification/alexnet/pytorch/dataloader/classification.py +++ b/cv/classification/alexnet/pytorch/dataloader/classification.py @@ -1,11 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os diff --git a/cv/classification/alexnet/pytorch/dataloader/dali_classification.py b/cv/classification/alexnet/pytorch/dataloader/dali_classification.py index 4c92283b2..2918bef66 100644 --- a/cv/classification/alexnet/pytorch/dataloader/dali_classification.py +++ b/cv/classification/alexnet/pytorch/dataloader/dali_classification.py @@ -1,11 +1,19 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import os @@ -118,4 +126,4 @@ def main(arguments): if __name__ == '__main__': import os, time, sys import argparse - sys.exit(main(sys.argv[1:])) \ No newline at end of file + sys.exit(main(sys.argv[1:])) diff --git a/cv/classification/alexnet/pytorch/dataloader/utils/__init__.py b/cv/classification/alexnet/pytorch/dataloader/utils/__init__.py index e69de29bb..66b217b85 100644 --- a/cv/classification/alexnet/pytorch/dataloader/utils/__init__.py +++ b/cv/classification/alexnet/pytorch/dataloader/utils/__init__.py @@ -0,0 +1,14 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. \ No newline at end of file diff --git a/cv/classification/alexnet/pytorch/dataloader/utils/presets_classification.py b/cv/classification/alexnet/pytorch/dataloader/utils/presets_classification.py index b3f559af4..59688a959 100644 --- a/cv/classification/alexnet/pytorch/dataloader/utils/presets_classification.py +++ b/cv/classification/alexnet/pytorch/dataloader/utils/presets_classification.py @@ -1,5 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from torchvision.transforms import autoaugment, transforms diff --git a/cv/classification/alexnet/pytorch/model/alexnet.py b/cv/classification/alexnet/pytorch/model/alexnet.py index 484f404f5..0be32bb48 100644 --- a/cv/classification/alexnet/pytorch/model/alexnet.py +++ b/cv/classification/alexnet/pytorch/model/alexnet.py @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import torch.nn as nn diff --git a/cv/classification/alexnet/pytorch/start_scripts/get_num_devices.sh b/cv/classification/alexnet/pytorch/start_scripts/get_num_devices.sh index 7c543335e..9e79ba138 100644 --- a/cv/classification/alexnet/pytorch/start_scripts/get_num_devices.sh +++ b/cv/classification/alexnet/pytorch/start_scripts/get_num_devices.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. devices=$CUDA_VISIBLE_DEVICES if [ -n "$devices" ]; then diff --git a/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_amp_torch.sh b/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_amp_torch.sh index 03b837113..0983d89be 100644 --- a/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_amp_torch.sh +++ b/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_amp_torch.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. python3 ../train.py \ --batch-size 256 \ diff --git a/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_dist_amp_torch.sh b/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_dist_amp_torch.sh index c821119ef..998aed7e3 100644 --- a/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_dist_amp_torch.sh +++ b/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_dist_amp_torch.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. source ./get_num_devices.sh python3 -m torch.distributed.launch --nproc_per_node=$IX_NUM_CUDA_VISIBLE_DEVICES --use_env \ diff --git a/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_dist_torch.sh b/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_dist_torch.sh index b0449c3fc..0217d2ad2 100644 --- a/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_dist_torch.sh +++ b/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_dist_torch.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. source ./get_num_devices.sh python3 -m torch.distributed.launch --nproc_per_node=$IX_NUM_CUDA_VISIBLE_DEVICES --use_env \ diff --git a/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_torch.sh b/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_torch.sh index b27885797..43c07a34d 100644 --- a/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_torch.sh +++ b/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_torch.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. python3 ../train.py \ --batch-size 256 \ diff --git a/cv/classification/alexnet/pytorch/train.py b/cv/classification/alexnet/pytorch/train.py index 0295e25e5..ed573a574 100644 --- a/cv/classification/alexnet/pytorch/train.py +++ b/cv/classification/alexnet/pytorch/train.py @@ -1,5 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import datetime import os diff --git a/cv/classification/alexnet/pytorch/train_horovod.py b/cv/classification/alexnet/pytorch/train_horovod.py deleted file mode 100644 index fee424a75..000000000 --- a/cv/classification/alexnet/pytorch/train_horovod.py +++ /dev/null @@ -1,300 +0,0 @@ -import torch -import argparse -import torch.backends.cudnn as cudnn -import torch.multiprocessing as mp -import torch.nn.functional as F -import torch.optim as optim -import torch.utils.data.distributed -from torch.utils.tensorboard import SummaryWriter -from torchvision import datasets, transforms, models -import horovod.torch as hvd -import os -import math -from tqdm import tqdm - -# Training settings -parser = argparse.ArgumentParser(description='PyTorch ImageNet Example', - formatter_class=argparse.ArgumentDefaultsHelpFormatter) -parser.add_argument('--train-dir', default=os.path.expanduser('~/imagenet/train'), - help='path to training data') -parser.add_argument('--val-dir', default=os.path.expanduser('~/imagenet/validation'), - help='path to validation data') -parser.add_argument('--output-dir', default='./work_dirs', - help='tensorboard log directory') -parser.add_argument('--device', default='cuda', help='device') -parser.add_argument('--checkpoint-format', default='checkpoint-{epoch}.pth.tar', - help='checkpoint file format') -parser.add_argument('--fp16-allreduce', action='store_true', default=False, - help='use fp16 compression during allreduce') -parser.add_argument('--batches-per-allreduce', type=int, default=1, - help='number of batches processed locally before ' - 'executing allreduce across workers; it multiplies ' - 'total batch size.') -parser.add_argument('--use-adasum', action='store_true', default=False, - help='use adasum algorithm to do reduction') -parser.add_argument('--gradient-predivide-factor', type=float, default=1.0, - help='apply gradient predivide factor in optimizer (default: 1.0)') -parser.add_argument('--acc-thresh', default=75.0, type=float, - help='accuracy threshold') - -# Default settings from https://arxiv.org/abs/1706.02677. -parser.add_argument('--batch-size', type=int, default=32, - help='input batch size for training') -parser.add_argument('--val-batch-size', type=int, default=32, - help='input batch size for validation') -parser.add_argument('--epochs', type=int, default=90, - help='number of epochs to train') -parser.add_argument('--base-lr', type=float, default=0.0125, - help='learning rate for a single GPU') -parser.add_argument('--warmup-epochs', type=float, default=5, - help='number of warmup epochs') -parser.add_argument('--momentum', type=float, default=0.9, - help='SGD momentum') -parser.add_argument('--wd', type=float, default=0.00005, - help='weight decay') -parser.add_argument('--seed', type=int, default=42, - help='random seed') - - -def train(epoch, device): - model.train() - train_sampler.set_epoch(epoch) - train_loss = Metric('train_loss') - train_accuracy = Metric('train_accuracy') - - with tqdm(total=len(train_loader), - desc='Train Epoch #{}'.format(epoch + 1), - disable=not verbose) as t: - for batch_idx, (data, target) in enumerate(train_loader): - adjust_learning_rate(epoch, batch_idx) - - data, target = data.to(device), target.to(device) - optimizer.zero_grad() - # Split data into sub-batches of size batch_size - for i in range(0, len(data), args.batch_size): - data_batch = data[i:i + args.batch_size] - target_batch = target[i:i + args.batch_size] - output = model(data_batch) - train_accuracy.update(accuracy(output, target_batch)) - loss = F.cross_entropy(output, target_batch) - train_loss.update(loss) - # Average gradients among sub-batches - loss.div_(math.ceil(float(len(data)) / args.batch_size)) - loss.backward() - # Gradient is applied across all ranks - optimizer.step() - t.set_postfix({'loss': train_loss.avg.item(), - 'accuracy': 100. * train_accuracy.avg.item()}) - - t.update(1) - - if log_writer: - log_writer.add_scalar('train/loss', train_loss.avg, epoch) - log_writer.add_scalar('train/accuracy', train_accuracy.avg, epoch) - - -def validate(epoch, device): - model.eval() - val_loss = Metric('val_loss') - val_accuracy = Metric('val_accuracy') - - with tqdm(total=len(val_loader), - desc='Validate Epoch #{}'.format(epoch + 1), - disable=not verbose) as t: - with torch.no_grad(): - for data, target in val_loader: - data, target = data.to(device), target.to(device) - output = model(data) - - val_loss.update(F.cross_entropy(output, target)) - val_accuracy.update(accuracy(output, target)) - t.set_postfix({'loss': val_loss.avg.item(), - 'accuracy': 100. * val_accuracy.avg.item()}) - t.update(1) - - if 100.0*val_accuracy.avg.item() > args.acc_thresh: - print("The accuracy has been exceeded {},and the training is \ - terminated at epoch {}".format(args.acc_thresh, epoch)) - return - - if log_writer: - log_writer.add_scalar('val/loss', val_loss.avg, epoch) - log_writer.add_scalar('val/accuracy', val_accuracy.avg, epoch) - - -# Horovod: using `lr = base_lr * hvd.size()` from the very beginning leads to worse final -# accuracy. Scale the learning rate `lr = base_lr` ---> `lr = base_lr * hvd.size()` during -# the first five epochs. See https://arxiv.org/abs/1706.02677 for details. -# After the warmup reduce learning rate by 10 on the 30th, 60th and 80th epochs. -def adjust_learning_rate(epoch, batch_idx): - if epoch < args.warmup_epochs: - epoch += float(batch_idx + 1) / len(train_loader) - lr_adj = 1. / hvd.size() * (epoch * (hvd.size() - 1) / args.warmup_epochs + 1) - elif epoch < 30: - lr_adj = 1. - elif epoch < 60: - lr_adj = 1e-1 - elif epoch < 80: - lr_adj = 1e-2 - else: - lr_adj = 1e-3 - for param_group in optimizer.param_groups: - param_group['lr'] = args.base_lr * hvd.size() * args.batches_per_allreduce * lr_adj - - -def accuracy(output, target): - # get the index of the max log-probability - pred = output.max(1, keepdim=True)[1] - return pred.eq(target.view_as(pred)).cpu().float().mean() - - -def save_checkpoint(epoch): - if hvd.rank() == 0: - filepath = os.path.join(args.output_dir, args.checkpoint_format.format(epoch=epoch + 1)) - # filepath = args.checkpoint_format.format(epoch=epoch + 1) - state = { - 'model': model.state_dict(), - 'optimizer': optimizer.state_dict(), - } - torch.save(state, filepath) - - -# Horovod: average metrics from distributed training. -class Metric(object): - def __init__(self, name): - self.name = name - self.sum = torch.tensor(0.) - self.n = torch.tensor(0.) - - def update(self, val): - self.sum += hvd.allreduce(val.detach().cpu(), name=self.name) - self.n += 1 - - @property - def avg(self): - return self.sum / self.n - - -if __name__ == '__main__': - args = parser.parse_args() - device = torch.device(args.device) - - allreduce_batch_size = args.batch_size * args.batches_per_allreduce - - hvd.init() - torch.manual_seed(args.seed) - - # if args.cuda: - # Horovod: pin GPU to local rank. - torch.cuda.set_device(hvd.local_rank()) - torch.cuda.manual_seed(args.seed) - - cudnn.benchmark = True - - # If set > 0, will resume training from a given checkpoint. - resume_from_epoch = 0 - for try_epoch in range(args.epochs, 0, -1): - if os.path.exists(args.checkpoint_format.format(epoch=try_epoch)): - resume_from_epoch = try_epoch - break - - # Horovod: broadcast resume_from_epoch from rank 0 (which will have - # checkpoints) to other ranks. - resume_from_epoch = hvd.broadcast(torch.tensor(resume_from_epoch), root_rank=0, - name='resume_from_epoch').item() - - # Horovod: print logs on the first worker. - verbose = 1 if hvd.rank() == 0 else 0 - - # Horovod: write TensorBoard logs on first worker. - log_writer = SummaryWriter(args.output_dir) if hvd.rank() == 0 else None - - # Horovod: limit # of CPU threads to be used per worker. - torch.set_num_threads(2) - - #kwargs = {'num_workers': 4, 'pin_memory': True} if args.cuda else {} - kwargs = {'num_workers': 2, 'pin_memory': True} - - # When supported, use 'forkserver' to spawn dataloader workers instead of 'fork' to prevent - # issues with Infiniband implementations that are not fork-safe - if (kwargs.get('num_workers', 0) > 0 and hasattr(mp, '_supports_context') and - mp._supports_context and 'forkserver' in mp.get_all_start_methods()): - kwargs['multiprocessing_context'] = 'forkserver' - - train_dataset = \ - datasets.ImageFolder(args.train_dir, - transform=transforms.Compose([ - transforms.RandomResizedCrop(224), - transforms.RandomHorizontalFlip(), - transforms.ToTensor(), - transforms.Normalize(mean=[0.485, 0.456, 0.406], - std=[0.229, 0.224, 0.225]) - ])) - - # Horovod: use DistributedSampler to partition data among workers. Manually specify - # `num_replicas=hvd.size()` and `rank=hvd.rank()`. - train_sampler = torch.utils.data.distributed.DistributedSampler( - train_dataset, num_replicas=hvd.size(), rank=hvd.rank()) - train_loader = torch.utils.data.DataLoader( - train_dataset, batch_size=allreduce_batch_size, - sampler=train_sampler, **kwargs) - - val_dataset = \ - datasets.ImageFolder(args.val_dir, - transform=transforms.Compose([ - transforms.Resize(256), - transforms.CenterCrop(224), - transforms.ToTensor(), - transforms.Normalize(mean=[0.485, 0.456, 0.406], - std=[0.229, 0.224, 0.225]) - ])) - val_sampler = torch.utils.data.distributed.DistributedSampler( - val_dataset, num_replicas=hvd.size(), rank=hvd.rank()) - val_loader = torch.utils.data.DataLoader(val_dataset, batch_size=args.val_batch_size, - sampler=val_sampler, **kwargs) - - - # Set up standard ResNet-50 model. - model = models.resnet50().to(device) - - # By default, Adasum doesn't need scaling up learning rate. - # For sum/average with gradient Accumulation: scale learning rate by batches_per_allreduce - lr_scaler = args.batches_per_allreduce * hvd.size() if not args.use_adasum else 1 - - # If using GPU Adasum allreduce, scale learning rate by local_size. - if args.use_adasum and hvd.nccl_built(): - lr_scaler = args.batches_per_allreduce * hvd.local_size() - - # Horovod: scale learning rate by the number of GPUs. - optimizer = optim.SGD(model.parameters(), - lr=(args.base_lr * - lr_scaler), - momentum=args.momentum, weight_decay=args.wd) - - # Horovod: (optional) compression algorithm. - compression = hvd.Compression.fp16 if args.fp16_allreduce else hvd.Compression.none - - # Horovod: wrap optimizer with DistributedOptimizer. - optimizer = hvd.DistributedOptimizer( - optimizer, named_parameters=model.named_parameters(), - compression=compression, - backward_passes_per_step=args.batches_per_allreduce, - op=hvd.Adasum if args.use_adasum else hvd.Average, - gradient_predivide_factor=args.gradient_predivide_factor) - - # Restore from a previous checkpoint, if initial_epoch is specified. - # Horovod: restore on the first worker which will broadcast weights to other workers. - if resume_from_epoch > 0 and hvd.rank() == 0: - filepath = args.checkpoint_format.format(epoch=resume_from_epoch) - checkpoint = torch.load(filepath) - model.load_state_dict(checkpoint['model']) - optimizer.load_state_dict(checkpoint['optimizer']) - - # Horovod: broadcast parameters & optimizer state. - hvd.broadcast_parameters(model.state_dict(), root_rank=0) - hvd.broadcast_optimizer_state(optimizer, root_rank=0) - - for epoch in range(resume_from_epoch, args.epochs): - train(epoch, device) - validate(epoch, device) - save_checkpoint(epoch) diff --git a/cv/classification/alexnet/pytorch/utils_.py b/cv/classification/alexnet/pytorch/utils_.py index 3d34c4df0..2a25edf2a 100644 --- a/cv/classification/alexnet/pytorch/utils_.py +++ b/cv/classification/alexnet/pytorch/utils_.py @@ -1,5 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from collections import defaultdict, deque, OrderedDict diff --git a/cv/classification/squeezenet/pytorch/__init__.py b/cv/classification/squeezenet/pytorch/__init__.py index b3b1e076e..70667c25f 100644 --- a/cv/classification/squeezenet/pytorch/__init__.py +++ b/cv/classification/squeezenet/pytorch/__init__.py @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from .utils import * from .common_utils import * from .data_loader import * diff --git a/cv/classification/squeezenet/pytorch/common_utils/__init__.py b/cv/classification/squeezenet/pytorch/common_utils/__init__.py index 7e6377c90..d77381925 100644 --- a/cv/classification/squeezenet/pytorch/common_utils/__init__.py +++ b/cv/classification/squeezenet/pytorch/common_utils/__init__.py @@ -1,11 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import random import numpy as np diff --git a/cv/classification/squeezenet/pytorch/common_utils/dist.py b/cv/classification/squeezenet/pytorch/common_utils/dist.py index ea56ca267..e412913d3 100644 --- a/cv/classification/squeezenet/pytorch/common_utils/dist.py +++ b/cv/classification/squeezenet/pytorch/common_utils/dist.py @@ -1,5 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from collections import defaultdict, deque diff --git a/cv/classification/squeezenet/pytorch/common_utils/metric_logger.py b/cv/classification/squeezenet/pytorch/common_utils/metric_logger.py index 960641c4d..224fc6eda 100644 --- a/cv/classification/squeezenet/pytorch/common_utils/metric_logger.py +++ b/cv/classification/squeezenet/pytorch/common_utils/metric_logger.py @@ -1,5 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from collections import defaultdict diff --git a/cv/classification/squeezenet/pytorch/common_utils/misc.py b/cv/classification/squeezenet/pytorch/common_utils/misc.py index 3e366eca5..3af2eba70 100644 --- a/cv/classification/squeezenet/pytorch/common_utils/misc.py +++ b/cv/classification/squeezenet/pytorch/common_utils/misc.py @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys import errno diff --git a/cv/classification/squeezenet/pytorch/common_utils/smooth_value.py b/cv/classification/squeezenet/pytorch/common_utils/smooth_value.py index 30cb89d60..4a6bc5e51 100644 --- a/cv/classification/squeezenet/pytorch/common_utils/smooth_value.py +++ b/cv/classification/squeezenet/pytorch/common_utils/smooth_value.py @@ -1,5 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from collections import defaultdict, deque diff --git a/cv/classification/squeezenet/pytorch/dataloader/__init__.py b/cv/classification/squeezenet/pytorch/dataloader/__init__.py index 23eeb3777..66b217b85 100644 --- a/cv/classification/squeezenet/pytorch/dataloader/__init__.py +++ b/cv/classification/squeezenet/pytorch/dataloader/__init__.py @@ -1,8 +1,14 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. \ No newline at end of file diff --git a/cv/classification/squeezenet/pytorch/dataloader/classification.py b/cv/classification/squeezenet/pytorch/dataloader/classification.py index 030af6dee..eb39933fb 100644 --- a/cv/classification/squeezenet/pytorch/dataloader/classification.py +++ b/cv/classification/squeezenet/pytorch/dataloader/classification.py @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os diff --git a/cv/classification/squeezenet/pytorch/dataloader/dali_classification.py b/cv/classification/squeezenet/pytorch/dataloader/dali_classification.py index 4c92283b2..d73bfaf98 100644 --- a/cv/classification/squeezenet/pytorch/dataloader/dali_classification.py +++ b/cv/classification/squeezenet/pytorch/dataloader/dali_classification.py @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os diff --git a/cv/classification/squeezenet/pytorch/dataloader/utils/__init__.py b/cv/classification/squeezenet/pytorch/dataloader/utils/__init__.py index 23eeb3777..66b217b85 100644 --- a/cv/classification/squeezenet/pytorch/dataloader/utils/__init__.py +++ b/cv/classification/squeezenet/pytorch/dataloader/utils/__init__.py @@ -1,8 +1,14 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. \ No newline at end of file diff --git a/cv/classification/squeezenet/pytorch/dataloader/utils/presets_classification.py b/cv/classification/squeezenet/pytorch/dataloader/utils/presets_classification.py index b3f559af4..59688a959 100644 --- a/cv/classification/squeezenet/pytorch/dataloader/utils/presets_classification.py +++ b/cv/classification/squeezenet/pytorch/dataloader/utils/presets_classification.py @@ -1,5 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from torchvision.transforms import autoaugment, transforms diff --git a/cv/classification/squeezenet/pytorch/model/squeezenet.py b/cv/classification/squeezenet/pytorch/model/squeezenet.py index b6f7e8bea..9efe57b6b 100644 --- a/cv/classification/squeezenet/pytorch/model/squeezenet.py +++ b/cv/classification/squeezenet/pytorch/model/squeezenet.py @@ -1,11 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import torch import torch.nn as nn import torch.nn.init as init diff --git a/cv/classification/squeezenet/pytorch/train.py b/cv/classification/squeezenet/pytorch/train.py index 04812a959..afdadaafc 100644 --- a/cv/classification/squeezenet/pytorch/train.py +++ b/cv/classification/squeezenet/pytorch/train.py @@ -1,5 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import datetime import os diff --git a/cv/classification/squeezenet/pytorch/train_horovod.py b/cv/classification/squeezenet/pytorch/train_horovod.py deleted file mode 100644 index 5cf0dded1..000000000 --- a/cv/classification/squeezenet/pytorch/train_horovod.py +++ /dev/null @@ -1,308 +0,0 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. -import torch -import argparse -import torch.backends.cudnn as cudnn -import torch.multiprocessing as mp -import torch.nn.functional as F -import torch.optim as optim -import torch.utils.data.distributed -from torch.utils.tensorboard import SummaryWriter -from torchvision import datasets, transforms, models -import horovod.torch as hvd -import os -import math -from tqdm import tqdm - -# Training settings -parser = argparse.ArgumentParser(description='PyTorch ImageNet Example', - formatter_class=argparse.ArgumentDefaultsHelpFormatter) -parser.add_argument('--train-dir', default=os.path.expanduser('~/imagenet/train'), - help='path to training data') -parser.add_argument('--val-dir', default=os.path.expanduser('~/imagenet/validation'), - help='path to validation data') -parser.add_argument('--output-dir', default='./work_dirs', - help='tensorboard log directory') -parser.add_argument('--device', default='cuda', help='device') -parser.add_argument('--checkpoint-format', default='checkpoint-{epoch}.pth.tar', - help='checkpoint file format') -parser.add_argument('--fp16-allreduce', action='store_true', default=False, - help='use fp16 compression during allreduce') -parser.add_argument('--batches-per-allreduce', type=int, default=1, - help='number of batches processed locally before ' - 'executing allreduce across workers; it multiplies ' - 'total batch size.') -parser.add_argument('--use-adasum', action='store_true', default=False, - help='use adasum algorithm to do reduction') -parser.add_argument('--gradient-predivide-factor', type=float, default=1.0, - help='apply gradient predivide factor in optimizer (default: 1.0)') -parser.add_argument('--acc-thresh', default=75.0, type=float, - help='accuracy threshold') - -# Default settings from https://arxiv.org/abs/1706.02677. -parser.add_argument('--batch-size', type=int, default=32, - help='input batch size for training') -parser.add_argument('--val-batch-size', type=int, default=32, - help='input batch size for validation') -parser.add_argument('--epochs', type=int, default=90, - help='number of epochs to train') -parser.add_argument('--base-lr', type=float, default=0.0125, - help='learning rate for a single GPU') -parser.add_argument('--warmup-epochs', type=float, default=5, - help='number of warmup epochs') -parser.add_argument('--momentum', type=float, default=0.9, - help='SGD momentum') -parser.add_argument('--wd', type=float, default=0.00005, - help='weight decay') -parser.add_argument('--seed', type=int, default=42, - help='random seed') - - -def train(epoch, device): - model.train() - train_sampler.set_epoch(epoch) - train_loss = Metric('train_loss') - train_accuracy = Metric('train_accuracy') - - with tqdm(total=len(train_loader), - desc='Train Epoch #{}'.format(epoch + 1), - disable=not verbose) as t: - for batch_idx, (data, target) in enumerate(train_loader): - adjust_learning_rate(epoch, batch_idx) - - data, target = data.to(device), target.to(device) - optimizer.zero_grad() - # Split data into sub-batches of size batch_size - for i in range(0, len(data), args.batch_size): - data_batch = data[i:i + args.batch_size] - target_batch = target[i:i + args.batch_size] - output = model(data_batch) - train_accuracy.update(accuracy(output, target_batch)) - loss = F.cross_entropy(output, target_batch) - train_loss.update(loss) - # Average gradients among sub-batches - loss.div_(math.ceil(float(len(data)) / args.batch_size)) - loss.backward() - # Gradient is applied across all ranks - optimizer.step() - t.set_postfix({'loss': train_loss.avg.item(), - 'accuracy': 100. * train_accuracy.avg.item()}) - - t.update(1) - - if log_writer: - log_writer.add_scalar('train/loss', train_loss.avg, epoch) - log_writer.add_scalar('train/accuracy', train_accuracy.avg, epoch) - - -def validate(epoch, device): - model.eval() - val_loss = Metric('val_loss') - val_accuracy = Metric('val_accuracy') - - with tqdm(total=len(val_loader), - desc='Validate Epoch #{}'.format(epoch + 1), - disable=not verbose) as t: - with torch.no_grad(): - for data, target in val_loader: - data, target = data.to(device), target.to(device) - output = model(data) - - val_loss.update(F.cross_entropy(output, target)) - val_accuracy.update(accuracy(output, target)) - t.set_postfix({'loss': val_loss.avg.item(), - 'accuracy': 100. * val_accuracy.avg.item()}) - t.update(1) - - if 100.0*val_accuracy.avg.item() > args.acc_thresh: - print("The accuracy has been exceeded {},and the training is \ - terminated at epoch {}".format(args.acc_thresh, epoch)) - return - - if log_writer: - log_writer.add_scalar('val/loss', val_loss.avg, epoch) - log_writer.add_scalar('val/accuracy', val_accuracy.avg, epoch) - - -# Horovod: using `lr = base_lr * hvd.size()` from the very beginning leads to worse final -# accuracy. Scale the learning rate `lr = base_lr` ---> `lr = base_lr * hvd.size()` during -# the first five epochs. See https://arxiv.org/abs/1706.02677 for details. -# After the warmup reduce learning rate by 10 on the 30th, 60th and 80th epochs. -def adjust_learning_rate(epoch, batch_idx): - if epoch < args.warmup_epochs: - epoch += float(batch_idx + 1) / len(train_loader) - lr_adj = 1. / hvd.size() * (epoch * (hvd.size() - 1) / args.warmup_epochs + 1) - elif epoch < 30: - lr_adj = 1. - elif epoch < 60: - lr_adj = 1e-1 - elif epoch < 80: - lr_adj = 1e-2 - else: - lr_adj = 1e-3 - for param_group in optimizer.param_groups: - param_group['lr'] = args.base_lr * hvd.size() * args.batches_per_allreduce * lr_adj - - -def accuracy(output, target): - # get the index of the max log-probability - pred = output.max(1, keepdim=True)[1] - return pred.eq(target.view_as(pred)).cpu().float().mean() - - -def save_checkpoint(epoch): - if hvd.rank() == 0: - filepath = os.path.join(args.output_dir, args.checkpoint_format.format(epoch=epoch + 1)) - # filepath = args.checkpoint_format.format(epoch=epoch + 1) - state = { - 'model': model.state_dict(), - 'optimizer': optimizer.state_dict(), - } - torch.save(state, filepath) - - -# Horovod: average metrics from distributed training. -class Metric(object): - def __init__(self, name): - self.name = name - self.sum = torch.tensor(0.) - self.n = torch.tensor(0.) - - def update(self, val): - self.sum += hvd.allreduce(val.detach().cpu(), name=self.name) - self.n += 1 - - @property - def avg(self): - return self.sum / self.n - - -if __name__ == '__main__': - args = parser.parse_args() - device = torch.device(args.device) - - allreduce_batch_size = args.batch_size * args.batches_per_allreduce - - hvd.init() - torch.manual_seed(args.seed) - - # if args.cuda: - # Horovod: pin GPU to local rank. - torch.cuda.set_device(hvd.local_rank()) - torch.cuda.manual_seed(args.seed) - - cudnn.benchmark = True - - # If set > 0, will resume training from a given checkpoint. - resume_from_epoch = 0 - for try_epoch in range(args.epochs, 0, -1): - if os.path.exists(args.checkpoint_format.format(epoch=try_epoch)): - resume_from_epoch = try_epoch - break - - # Horovod: broadcast resume_from_epoch from rank 0 (which will have - # checkpoints) to other ranks. - resume_from_epoch = hvd.broadcast(torch.tensor(resume_from_epoch), root_rank=0, - name='resume_from_epoch').item() - - # Horovod: print logs on the first worker. - verbose = 1 if hvd.rank() == 0 else 0 - - # Horovod: write TensorBoard logs on first worker. - log_writer = SummaryWriter(args.output_dir) if hvd.rank() == 0 else None - - # Horovod: limit # of CPU threads to be used per worker. - torch.set_num_threads(2) - - #kwargs = {'num_workers': 4, 'pin_memory': True} if args.cuda else {} - kwargs = {'num_workers': 2, 'pin_memory': True} - - # When supported, use 'forkserver' to spawn dataloader workers instead of 'fork' to prevent - # issues with Infiniband implementations that are not fork-safe - if (kwargs.get('num_workers', 0) > 0 and hasattr(mp, '_supports_context') and - mp._supports_context and 'forkserver' in mp.get_all_start_methods()): - kwargs['multiprocessing_context'] = 'forkserver' - - train_dataset = \ - datasets.ImageFolder(args.train_dir, - transform=transforms.Compose([ - transforms.RandomResizedCrop(224), - transforms.RandomHorizontalFlip(), - transforms.ToTensor(), - transforms.Normalize(mean=[0.485, 0.456, 0.406], - std=[0.229, 0.224, 0.225]) - ])) - - # Horovod: use DistributedSampler to partition data among workers. Manually specify - # `num_replicas=hvd.size()` and `rank=hvd.rank()`. - train_sampler = torch.utils.data.distributed.DistributedSampler( - train_dataset, num_replicas=hvd.size(), rank=hvd.rank()) - train_loader = torch.utils.data.DataLoader( - train_dataset, batch_size=allreduce_batch_size, - sampler=train_sampler, **kwargs) - - val_dataset = \ - datasets.ImageFolder(args.val_dir, - transform=transforms.Compose([ - transforms.Resize(256), - transforms.CenterCrop(224), - transforms.ToTensor(), - transforms.Normalize(mean=[0.485, 0.456, 0.406], - std=[0.229, 0.224, 0.225]) - ])) - val_sampler = torch.utils.data.distributed.DistributedSampler( - val_dataset, num_replicas=hvd.size(), rank=hvd.rank()) - val_loader = torch.utils.data.DataLoader(val_dataset, batch_size=args.val_batch_size, - sampler=val_sampler, **kwargs) - - - # Set up standard ResNet-50 model. - model = models.resnet50().to(device) - - # By default, Adasum doesn't need scaling up learning rate. - # For sum/average with gradient Accumulation: scale learning rate by batches_per_allreduce - lr_scaler = args.batches_per_allreduce * hvd.size() if not args.use_adasum else 1 - - # If using GPU Adasum allreduce, scale learning rate by local_size. - if args.use_adasum and hvd.nccl_built(): - lr_scaler = args.batches_per_allreduce * hvd.local_size() - - # Horovod: scale learning rate by the number of GPUs. - optimizer = optim.SGD(model.parameters(), - lr=(args.base_lr * - lr_scaler), - momentum=args.momentum, weight_decay=args.wd) - - # Horovod: (optional) compression algorithm. - compression = hvd.Compression.fp16 if args.fp16_allreduce else hvd.Compression.none - - # Horovod: wrap optimizer with DistributedOptimizer. - optimizer = hvd.DistributedOptimizer( - optimizer, named_parameters=model.named_parameters(), - compression=compression, - backward_passes_per_step=args.batches_per_allreduce, - op=hvd.Adasum if args.use_adasum else hvd.Average, - gradient_predivide_factor=args.gradient_predivide_factor) - - # Restore from a previous checkpoint, if initial_epoch is specified. - # Horovod: restore on the first worker which will broadcast weights to other workers. - if resume_from_epoch > 0 and hvd.rank() == 0: - filepath = args.checkpoint_format.format(epoch=resume_from_epoch) - checkpoint = torch.load(filepath) - model.load_state_dict(checkpoint['model']) - optimizer.load_state_dict(checkpoint['optimizer']) - - # Horovod: broadcast parameters & optimizer state. - hvd.broadcast_parameters(model.state_dict(), root_rank=0) - hvd.broadcast_optimizer_state(optimizer, root_rank=0) - - for epoch in range(resume_from_epoch, args.epochs): - train(epoch, device) - validate(epoch, device) - save_checkpoint(epoch) diff --git a/cv/classification/squeezenet/pytorch/utils_.py b/cv/classification/squeezenet/pytorch/utils_.py index 3d34c4df0..027d6bcee 100644 --- a/cv/classification/squeezenet/pytorch/utils_.py +++ b/cv/classification/squeezenet/pytorch/utils_.py @@ -1,6 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from collections import defaultdict, deque, OrderedDict import copy diff --git a/cv/semantic_segmentation/icnet/pytorch/model/builder.py b/cv/semantic_segmentation/icnet/pytorch/model/builder.py index 40bc82275..bc53306c3 100644 --- a/cv/semantic_segmentation/icnet/pytorch/model/builder.py +++ b/cv/semantic_segmentation/icnet/pytorch/model/builder.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + from .models import * SEGMENTRON_CFG = dict( diff --git a/cv/semantic_segmentation/icnet/pytorch/run_train.py b/cv/semantic_segmentation/icnet/pytorch/run_train.py index a627e2a39..fe971f5b4 100644 --- a/cv/semantic_segmentation/icnet/pytorch/run_train.py +++ b/cv/semantic_segmentation/icnet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/icnet/pytorch/train_icnet_r50_dist.sh b/cv/semantic_segmentation/icnet/pytorch/train_icnet_r50_dist.sh index 85826ea73..c23001ba8 100644 --- a/cv/semantic_segmentation/icnet/pytorch/train_icnet_r50_dist.sh +++ b/cv/semantic_segmentation/icnet/pytorch/train_icnet_r50_dist.sh @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + CURRENT_DIR=$(cd `dirname $0`; pwd) ROOT_DIR=${CURRENT_DIR} diff --git a/cv/semantic_segmentation/lednet/pytorch/model/__init__.py b/cv/semantic_segmentation/lednet/pytorch/model/__init__.py index ebd9f2e52..0f4f51982 100644 --- a/cv/semantic_segmentation/lednet/pytorch/model/__init__.py +++ b/cv/semantic_segmentation/lednet/pytorch/model/__init__.py @@ -1,2 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. __all__ = [k for k in globals().keys() if not k.startswith("_")] diff --git a/cv/semantic_segmentation/lednet/pytorch/model/builder.py b/cv/semantic_segmentation/lednet/pytorch/model/builder.py index 059325b4b..1e3955584 100644 --- a/cv/semantic_segmentation/lednet/pytorch/model/builder.py +++ b/cv/semantic_segmentation/lednet/pytorch/model/builder.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + from .models import * SEGMENTRON_CFG = dict( diff --git a/cv/semantic_segmentation/lednet/pytorch/model/models/__init__.py b/cv/semantic_segmentation/lednet/pytorch/model/models/__init__.py index ed45c37e2..f3d2168a6 100644 --- a/cv/semantic_segmentation/lednet/pytorch/model/models/__init__.py +++ b/cv/semantic_segmentation/lednet/pytorch/model/models/__init__.py @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Model Zoo""" diff --git a/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/build.py b/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/build.py index f7fc98db1..ec1c34cbd 100644 --- a/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/build.py +++ b/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/build.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import os import torch import logging diff --git a/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/eespnet.py b/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/eespnet.py index 8fe17f6f0..603415dfc 100644 --- a/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/eespnet.py +++ b/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/eespnet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import math import sys diff --git a/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/hrnet.py b/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/hrnet.py index 716354c4f..fb6936b9c 100644 --- a/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/hrnet.py +++ b/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/hrnet.py @@ -1,3 +1,20 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + # this code is heavily based on https://github.com/HRNet from __future__ import absolute_import diff --git a/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/mobilenet.py b/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/mobilenet.py index c299c2bc4..3541a4cde 100644 --- a/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/mobilenet.py +++ b/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/mobilenet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """MobileNet and MobileNetV2.""" import torch.nn as nn diff --git a/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/resnet.py b/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/resnet.py index 7df68fb6c..b62d8dfda 100644 --- a/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/resnet.py +++ b/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/resnet.py @@ -1,3 +1,20 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + import torch.nn as nn from .build import BACKBONE_REGISTRY diff --git a/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/xception.py b/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/xception.py index 66b71e296..e9d0da4a2 100644 --- a/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/xception.py +++ b/cv/semantic_segmentation/lednet/pytorch/model/models/backbones/xception.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import torch.nn as nn from ...modules import SeparableConv2d diff --git a/cv/semantic_segmentation/lednet/pytorch/model/models/lednet.py b/cv/semantic_segmentation/lednet/pytorch/model/models/lednet.py index c050ccdc2..acc3e55f7 100644 --- a/cv/semantic_segmentation/lednet/pytorch/model/models/lednet.py +++ b/cv/semantic_segmentation/lednet/pytorch/model/models/lednet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import torch import torch.nn as nn import torch.nn.functional as F diff --git a/cv/semantic_segmentation/lednet/pytorch/model/models/segbase.py b/cv/semantic_segmentation/lednet/pytorch/model/models/segbase.py index 6e71bd6cb..eb1523f0a 100644 --- a/cv/semantic_segmentation/lednet/pytorch/model/models/segbase.py +++ b/cv/semantic_segmentation/lednet/pytorch/model/models/segbase.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Base Model for Semantic Segmentation""" import math import numbers diff --git a/cv/semantic_segmentation/lednet/pytorch/model/modules/module.py b/cv/semantic_segmentation/lednet/pytorch/model/modules/module.py index 851818fbb..2a0cea95b 100644 --- a/cv/semantic_segmentation/lednet/pytorch/model/modules/module.py +++ b/cv/semantic_segmentation/lednet/pytorch/model/modules/module.py @@ -1,3 +1,20 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + """Basic Module for Semantic Segmentation""" import torch import torch.nn as nn diff --git a/cv/semantic_segmentation/lednet/pytorch/model/utils/__init__.py b/cv/semantic_segmentation/lednet/pytorch/model/utils/__init__.py index e69de29bb..2e4bb41ab 100644 --- a/cv/semantic_segmentation/lednet/pytorch/model/utils/__init__.py +++ b/cv/semantic_segmentation/lednet/pytorch/model/utils/__init__.py @@ -0,0 +1,15 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. diff --git a/cv/semantic_segmentation/lednet/pytorch/model/utils/registry.py b/cv/semantic_segmentation/lednet/pytorch/model/utils/registry.py index 8c2c53788..d564bd2cd 100644 --- a/cv/semantic_segmentation/lednet/pytorch/model/utils/registry.py +++ b/cv/semantic_segmentation/lednet/pytorch/model/utils/registry.py @@ -1,3 +1,20 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + # this code heavily based on detectron2 import logging diff --git a/cv/semantic_segmentation/lednet/pytorch/run_train.py b/cv/semantic_segmentation/lednet/pytorch/run_train.py index 26ced23ce..5c098cf5a 100644 --- a/cv/semantic_segmentation/lednet/pytorch/run_train.py +++ b/cv/semantic_segmentation/lednet/pytorch/run_train.py @@ -1,4 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import os import sys diff --git a/cv/semantic_segmentation/lednet/pytorch/train_lednet_dist.sh b/cv/semantic_segmentation/lednet/pytorch/train_lednet_dist.sh index 2f47eca0e..a53971f36 100644 --- a/cv/semantic_segmentation/lednet/pytorch/train_lednet_dist.sh +++ b/cv/semantic_segmentation/lednet/pytorch/train_lednet_dist.sh @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + CURRENT_DIR=$(cd `dirname $0`; pwd) ROOT_DIR=${CURRENT_DIR} diff --git a/cv/semantic_segmentation/ocnet/pytorch/model/__init__.py b/cv/semantic_segmentation/ocnet/pytorch/model/__init__.py index ebd9f2e52..2b7a011a3 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/model/__init__.py +++ b/cv/semantic_segmentation/ocnet/pytorch/model/__init__.py @@ -1,2 +1,16 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. __all__ = [k for k in globals().keys() if not k.startswith("_")] diff --git a/cv/semantic_segmentation/ocnet/pytorch/model/builder.py b/cv/semantic_segmentation/ocnet/pytorch/model/builder.py index e6df7cd49..d93e83c38 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/model/builder.py +++ b/cv/semantic_segmentation/ocnet/pytorch/model/builder.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + from .models import * SEGMENTRON_CFG = dict( diff --git a/cv/semantic_segmentation/ocnet/pytorch/model/models/__init__.py b/cv/semantic_segmentation/ocnet/pytorch/model/models/__init__.py index 366980215..bb49925cd 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/model/models/__init__.py +++ b/cv/semantic_segmentation/ocnet/pytorch/model/models/__init__.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Model Zoo""" diff --git a/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/build.py b/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/build.py index f7fc98db1..ec1c34cbd 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/build.py +++ b/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/build.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import os import torch import logging diff --git a/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/eespnet.py b/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/eespnet.py index 8fe17f6f0..603415dfc 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/eespnet.py +++ b/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/eespnet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import math import sys diff --git a/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/hrnet.py b/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/hrnet.py index 716354c4f..bd8d8b117 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/hrnet.py +++ b/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/hrnet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + # this code is heavily based on https://github.com/HRNet from __future__ import absolute_import diff --git a/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/mobilenet.py b/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/mobilenet.py index c299c2bc4..3541a4cde 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/mobilenet.py +++ b/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/mobilenet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """MobileNet and MobileNetV2.""" import torch.nn as nn diff --git a/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/resnet.py b/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/resnet.py index 7df68fb6c..fa4fcc2b1 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/resnet.py +++ b/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/resnet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import torch.nn as nn from .build import BACKBONE_REGISTRY diff --git a/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/xception.py b/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/xception.py index 66b71e296..e9d0da4a2 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/xception.py +++ b/cv/semantic_segmentation/ocnet/pytorch/model/models/backbones/xception.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import torch.nn as nn from ...modules import SeparableConv2d diff --git a/cv/semantic_segmentation/ocnet/pytorch/model/models/ocnet.py b/cv/semantic_segmentation/ocnet/pytorch/model/models/ocnet.py index 14edc1eca..2b2bf8044 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/model/models/ocnet.py +++ b/cv/semantic_segmentation/ocnet/pytorch/model/models/ocnet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import torch import torch.nn as nn import torch.nn.functional as F diff --git a/cv/semantic_segmentation/ocnet/pytorch/model/models/segbase.py b/cv/semantic_segmentation/ocnet/pytorch/model/models/segbase.py index 6e71bd6cb..eb1523f0a 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/model/models/segbase.py +++ b/cv/semantic_segmentation/ocnet/pytorch/model/models/segbase.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Base Model for Semantic Segmentation""" import math import numbers diff --git a/cv/semantic_segmentation/ocnet/pytorch/model/modules/module.py b/cv/semantic_segmentation/ocnet/pytorch/model/modules/module.py index 851818fbb..e0a3c6616 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/model/modules/module.py +++ b/cv/semantic_segmentation/ocnet/pytorch/model/modules/module.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Basic Module for Semantic Segmentation""" import torch import torch.nn as nn diff --git a/cv/semantic_segmentation/ocnet/pytorch/model/utils/__init__.py b/cv/semantic_segmentation/ocnet/pytorch/model/utils/__init__.py index e69de29bb..4518322a8 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/model/utils/__init__.py +++ b/cv/semantic_segmentation/ocnet/pytorch/model/utils/__init__.py @@ -0,0 +1,14 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. diff --git a/cv/semantic_segmentation/ocnet/pytorch/model/utils/registry.py b/cv/semantic_segmentation/ocnet/pytorch/model/utils/registry.py index 8c2c53788..128b4bc11 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/model/utils/registry.py +++ b/cv/semantic_segmentation/ocnet/pytorch/model/utils/registry.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + # this code heavily based on detectron2 import logging diff --git a/cv/semantic_segmentation/ocnet/pytorch/run_train.py b/cv/semantic_segmentation/ocnet/pytorch/run_train.py index 90418802a..4e082dcea 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/run_train.py +++ b/cv/semantic_segmentation/ocnet/pytorch/run_train.py @@ -1,4 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import os import sys diff --git a/cv/semantic_segmentation/ocnet/pytorch/train_ocnet_r50_dist.sh b/cv/semantic_segmentation/ocnet/pytorch/train_ocnet_r50_dist.sh index af27bda19..235fe16a0 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/train_ocnet_r50_dist.sh +++ b/cv/semantic_segmentation/ocnet/pytorch/train_ocnet_r50_dist.sh @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + CURRENT_DIR=$(cd `dirname $0`; pwd) ROOT_DIR=${CURRENT_DIR} diff --git a/cv/semantic_segmentation/psanet/pytorch/model/__init__.py b/cv/semantic_segmentation/psanet/pytorch/model/__init__.py index ebd9f2e52..2b7a011a3 100644 --- a/cv/semantic_segmentation/psanet/pytorch/model/__init__.py +++ b/cv/semantic_segmentation/psanet/pytorch/model/__init__.py @@ -1,2 +1,16 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. __all__ = [k for k in globals().keys() if not k.startswith("_")] diff --git a/cv/semantic_segmentation/psanet/pytorch/model/base_model/__init__.py b/cv/semantic_segmentation/psanet/pytorch/model/base_model/__init__.py index 6f6c7487a..23e35de9c 100644 --- a/cv/semantic_segmentation/psanet/pytorch/model/base_model/__init__.py +++ b/cv/semantic_segmentation/psanet/pytorch/model/base_model/__init__.py @@ -1,2 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from .resnet import ResNet, resnet18, resnet34, resnet50, resnet101, resnet152 from .xception import Xception, xception39 diff --git a/cv/semantic_segmentation/psanet/pytorch/model/base_model/resnet.py b/cv/semantic_segmentation/psanet/pytorch/model/base_model/resnet.py index feb9ca322..421bf556d 100644 --- a/cv/semantic_segmentation/psanet/pytorch/model/base_model/resnet.py +++ b/cv/semantic_segmentation/psanet/pytorch/model/base_model/resnet.py @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import functools import torch.nn as nn diff --git a/cv/semantic_segmentation/psanet/pytorch/model/base_model/xception.py b/cv/semantic_segmentation/psanet/pytorch/model/base_model/xception.py index 7d71ee01d..719cf38c0 100644 --- a/cv/semantic_segmentation/psanet/pytorch/model/base_model/xception.py +++ b/cv/semantic_segmentation/psanet/pytorch/model/base_model/xception.py @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from __future__ import print_function, division, absolute_import import torch.nn as nn diff --git a/cv/semantic_segmentation/psanet/pytorch/model/psanet/__init__.py b/cv/semantic_segmentation/psanet/pytorch/model/psanet/__init__.py index 459390e88..9e0eb36b6 100644 --- a/cv/semantic_segmentation/psanet/pytorch/model/psanet/__init__.py +++ b/cv/semantic_segmentation/psanet/pytorch/model/psanet/__init__.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from .psanet_r50_v1c import psanet_resnet50v1c from .psanet_r101_v1c import psanet_resnet101v1c diff --git a/cv/semantic_segmentation/psanet/pytorch/model/psanet/psanet_r101_v1c.py b/cv/semantic_segmentation/psanet/pytorch/model/psanet/psanet_r101_v1c.py index 0f38cf82d..6b3b1468a 100644 --- a/cv/semantic_segmentation/psanet/pytorch/model/psanet/psanet_r101_v1c.py +++ b/cv/semantic_segmentation/psanet/pytorch/model/psanet/psanet_r101_v1c.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) TorchSeg. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + # encoding: utf-8 from functools import partial from collections import OrderedDict diff --git a/cv/semantic_segmentation/psanet/pytorch/model/psanet/psanet_r50_v1c.py b/cv/semantic_segmentation/psanet/pytorch/model/psanet/psanet_r50_v1c.py index 6d6a0fec5..4b2a09e49 100644 --- a/cv/semantic_segmentation/psanet/pytorch/model/psanet/psanet_r50_v1c.py +++ b/cv/semantic_segmentation/psanet/pytorch/model/psanet/psanet_r50_v1c.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) TorchSeg. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + # encoding: utf-8 from functools import partial from collections import OrderedDict diff --git a/cv/semantic_segmentation/psanet/pytorch/run_train.py b/cv/semantic_segmentation/psanet/pytorch/run_train.py index 2bdf58740..d85667a5b 100644 --- a/cv/semantic_segmentation/psanet/pytorch/run_train.py +++ b/cv/semantic_segmentation/psanet/pytorch/run_train.py @@ -1,4 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import os import sys diff --git a/cv/semantic_segmentation/psanet/pytorch/train_psanet_dist.sh b/cv/semantic_segmentation/psanet/pytorch/train_psanet_dist.sh index 059728770..bb64c7773 100644 --- a/cv/semantic_segmentation/psanet/pytorch/train_psanet_dist.sh +++ b/cv/semantic_segmentation/psanet/pytorch/train_psanet_dist.sh @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + CURRENT_DIR=$(cd `dirname $0`; pwd) ROOT_DIR=${CURRENT_DIR} diff --git a/cv/semantic_segmentation/refinenet/pytorch/model/__init__.py b/cv/semantic_segmentation/refinenet/pytorch/model/__init__.py index ebd9f2e52..2b7a011a3 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/model/__init__.py +++ b/cv/semantic_segmentation/refinenet/pytorch/model/__init__.py @@ -1,2 +1,16 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. __all__ = [k for k in globals().keys() if not k.startswith("_")] diff --git a/cv/semantic_segmentation/refinenet/pytorch/model/builder.py b/cv/semantic_segmentation/refinenet/pytorch/model/builder.py index 9892e7ec6..98e2a11db 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/model/builder.py +++ b/cv/semantic_segmentation/refinenet/pytorch/model/builder.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + from .models import * SEGMENTRON_CFG = dict( diff --git a/cv/semantic_segmentation/refinenet/pytorch/model/models/__init__.py b/cv/semantic_segmentation/refinenet/pytorch/model/models/__init__.py index 31fd7a1a0..d41c7dabb 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/model/models/__init__.py +++ b/cv/semantic_segmentation/refinenet/pytorch/model/models/__init__.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Model Zoo""" diff --git a/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/build.py b/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/build.py index f7fc98db1..ec1c34cbd 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/build.py +++ b/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/build.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import os import torch import logging diff --git a/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/eespnet.py b/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/eespnet.py index 8fe17f6f0..603415dfc 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/eespnet.py +++ b/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/eespnet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import math import sys diff --git a/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/hrnet.py b/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/hrnet.py index 716354c4f..bd8d8b117 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/hrnet.py +++ b/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/hrnet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + # this code is heavily based on https://github.com/HRNet from __future__ import absolute_import diff --git a/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/mobilenet.py b/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/mobilenet.py index c299c2bc4..3541a4cde 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/mobilenet.py +++ b/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/mobilenet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """MobileNet and MobileNetV2.""" import torch.nn as nn diff --git a/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/resnet.py b/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/resnet.py index 7df68fb6c..7f664aab3 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/resnet.py +++ b/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/resnet.py @@ -1,3 +1,20 @@ + +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import torch.nn as nn from .build import BACKBONE_REGISTRY diff --git a/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/xception.py b/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/xception.py index 66b71e296..e9d0da4a2 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/xception.py +++ b/cv/semantic_segmentation/refinenet/pytorch/model/models/backbones/xception.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import torch.nn as nn from ...modules import SeparableConv2d diff --git a/cv/semantic_segmentation/refinenet/pytorch/model/models/refinenet.py b/cv/semantic_segmentation/refinenet/pytorch/model/models/refinenet.py index 17473ff7a..1ce19472b 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/model/models/refinenet.py +++ b/cv/semantic_segmentation/refinenet/pytorch/model/models/refinenet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import torch import torch.nn as nn import torch.nn.functional as F diff --git a/cv/semantic_segmentation/refinenet/pytorch/model/models/segbase.py b/cv/semantic_segmentation/refinenet/pytorch/model/models/segbase.py index 6e71bd6cb..eb1523f0a 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/model/models/segbase.py +++ b/cv/semantic_segmentation/refinenet/pytorch/model/models/segbase.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Base Model for Semantic Segmentation""" import math import numbers diff --git a/cv/semantic_segmentation/refinenet/pytorch/model/modules/module.py b/cv/semantic_segmentation/refinenet/pytorch/model/modules/module.py index 851818fbb..e0a3c6616 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/model/modules/module.py +++ b/cv/semantic_segmentation/refinenet/pytorch/model/modules/module.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Basic Module for Semantic Segmentation""" import torch import torch.nn as nn diff --git a/cv/semantic_segmentation/refinenet/pytorch/model/utils/__init__.py b/cv/semantic_segmentation/refinenet/pytorch/model/utils/__init__.py index e69de29bb..4518322a8 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/model/utils/__init__.py +++ b/cv/semantic_segmentation/refinenet/pytorch/model/utils/__init__.py @@ -0,0 +1,14 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. diff --git a/cv/semantic_segmentation/refinenet/pytorch/model/utils/registry.py b/cv/semantic_segmentation/refinenet/pytorch/model/utils/registry.py index 8c2c53788..128b4bc11 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/model/utils/registry.py +++ b/cv/semantic_segmentation/refinenet/pytorch/model/utils/registry.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + # this code heavily based on detectron2 import logging diff --git a/cv/semantic_segmentation/refinenet/pytorch/run_train.py b/cv/semantic_segmentation/refinenet/pytorch/run_train.py index 90418802a..3dc45b2be 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/run_train.py +++ b/cv/semantic_segmentation/refinenet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/refinenet/pytorch/train_refinenet_dist.sh b/cv/semantic_segmentation/refinenet/pytorch/train_refinenet_dist.sh index 2e413f874..8bafdc8c8 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/train_refinenet_dist.sh +++ b/cv/semantic_segmentation/refinenet/pytorch/train_refinenet_dist.sh @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + CURRENT_DIR=$(cd `dirname $0`; pwd) ROOT_DIR=${CURRENT_DIR} diff --git a/cv/semantic_segmentation/unet/pytorch/model/__init__.py b/cv/semantic_segmentation/unet/pytorch/model/__init__.py index ebd9f2e52..2b7a011a3 100644 --- a/cv/semantic_segmentation/unet/pytorch/model/__init__.py +++ b/cv/semantic_segmentation/unet/pytorch/model/__init__.py @@ -1,2 +1,16 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. __all__ = [k for k in globals().keys() if not k.startswith("_")] diff --git a/cv/semantic_segmentation/unet/pytorch/model/builder.py b/cv/semantic_segmentation/unet/pytorch/model/builder.py index cfae3cbe4..42ce76ad9 100644 --- a/cv/semantic_segmentation/unet/pytorch/model/builder.py +++ b/cv/semantic_segmentation/unet/pytorch/model/builder.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + from .models import * SEGMENTRON_CFG = dict( diff --git a/cv/semantic_segmentation/unet/pytorch/model/models/__init__.py b/cv/semantic_segmentation/unet/pytorch/model/models/__init__.py index debf16720..114b89d6b 100644 --- a/cv/semantic_segmentation/unet/pytorch/model/models/__init__.py +++ b/cv/semantic_segmentation/unet/pytorch/model/models/__init__.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Model Zoo""" diff --git a/cv/semantic_segmentation/unet/pytorch/model/models/backbones/build.py b/cv/semantic_segmentation/unet/pytorch/model/models/backbones/build.py index f7fc98db1..ec1c34cbd 100644 --- a/cv/semantic_segmentation/unet/pytorch/model/models/backbones/build.py +++ b/cv/semantic_segmentation/unet/pytorch/model/models/backbones/build.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import os import torch import logging diff --git a/cv/semantic_segmentation/unet/pytorch/model/models/backbones/eespnet.py b/cv/semantic_segmentation/unet/pytorch/model/models/backbones/eespnet.py index 8fe17f6f0..603415dfc 100644 --- a/cv/semantic_segmentation/unet/pytorch/model/models/backbones/eespnet.py +++ b/cv/semantic_segmentation/unet/pytorch/model/models/backbones/eespnet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import math import sys diff --git a/cv/semantic_segmentation/unet/pytorch/model/models/backbones/hrnet.py b/cv/semantic_segmentation/unet/pytorch/model/models/backbones/hrnet.py index 716354c4f..bd8d8b117 100644 --- a/cv/semantic_segmentation/unet/pytorch/model/models/backbones/hrnet.py +++ b/cv/semantic_segmentation/unet/pytorch/model/models/backbones/hrnet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + # this code is heavily based on https://github.com/HRNet from __future__ import absolute_import diff --git a/cv/semantic_segmentation/unet/pytorch/model/models/backbones/mobilenet.py b/cv/semantic_segmentation/unet/pytorch/model/models/backbones/mobilenet.py index c299c2bc4..3541a4cde 100644 --- a/cv/semantic_segmentation/unet/pytorch/model/models/backbones/mobilenet.py +++ b/cv/semantic_segmentation/unet/pytorch/model/models/backbones/mobilenet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """MobileNet and MobileNetV2.""" import torch.nn as nn diff --git a/cv/semantic_segmentation/unet/pytorch/model/models/backbones/resnet.py b/cv/semantic_segmentation/unet/pytorch/model/models/backbones/resnet.py index 7df68fb6c..fa4fcc2b1 100644 --- a/cv/semantic_segmentation/unet/pytorch/model/models/backbones/resnet.py +++ b/cv/semantic_segmentation/unet/pytorch/model/models/backbones/resnet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import torch.nn as nn from .build import BACKBONE_REGISTRY diff --git a/cv/semantic_segmentation/unet/pytorch/model/models/backbones/xception.py b/cv/semantic_segmentation/unet/pytorch/model/models/backbones/xception.py index 66b71e296..e9d0da4a2 100644 --- a/cv/semantic_segmentation/unet/pytorch/model/models/backbones/xception.py +++ b/cv/semantic_segmentation/unet/pytorch/model/models/backbones/xception.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import torch.nn as nn from ...modules import SeparableConv2d diff --git a/cv/semantic_segmentation/unet/pytorch/model/models/segbase.py b/cv/semantic_segmentation/unet/pytorch/model/models/segbase.py index 6e71bd6cb..eb1523f0a 100644 --- a/cv/semantic_segmentation/unet/pytorch/model/models/segbase.py +++ b/cv/semantic_segmentation/unet/pytorch/model/models/segbase.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Base Model for Semantic Segmentation""" import math import numbers diff --git a/cv/semantic_segmentation/unet/pytorch/model/models/unet.py b/cv/semantic_segmentation/unet/pytorch/model/models/unet.py index 808249182..c65815e8a 100644 --- a/cv/semantic_segmentation/unet/pytorch/model/models/unet.py +++ b/cv/semantic_segmentation/unet/pytorch/model/models/unet.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import torch import torch.nn as nn import torch.nn.functional as F diff --git a/cv/semantic_segmentation/unet/pytorch/model/modules/module.py b/cv/semantic_segmentation/unet/pytorch/model/modules/module.py index 851818fbb..e0a3c6616 100644 --- a/cv/semantic_segmentation/unet/pytorch/model/modules/module.py +++ b/cv/semantic_segmentation/unet/pytorch/model/modules/module.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Basic Module for Semantic Segmentation""" import torch import torch.nn as nn diff --git a/cv/semantic_segmentation/unet/pytorch/model/utils/__init__.py b/cv/semantic_segmentation/unet/pytorch/model/utils/__init__.py index e69de29bb..4518322a8 100644 --- a/cv/semantic_segmentation/unet/pytorch/model/utils/__init__.py +++ b/cv/semantic_segmentation/unet/pytorch/model/utils/__init__.py @@ -0,0 +1,14 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. diff --git a/cv/semantic_segmentation/unet/pytorch/model/utils/registry.py b/cv/semantic_segmentation/unet/pytorch/model/utils/registry.py index 8c2c53788..128b4bc11 100644 --- a/cv/semantic_segmentation/unet/pytorch/model/utils/registry.py +++ b/cv/semantic_segmentation/unet/pytorch/model/utils/registry.py @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) SegmenTron. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + # this code heavily based on detectron2 import logging diff --git a/cv/semantic_segmentation/unet/pytorch/run_train.py b/cv/semantic_segmentation/unet/pytorch/run_train.py index 967a515d5..219b75c5d 100644 --- a/cv/semantic_segmentation/unet/pytorch/run_train.py +++ b/cv/semantic_segmentation/unet/pytorch/run_train.py @@ -1,4 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import os import sys diff --git a/cv/semantic_segmentation/unet/pytorch/train_unet_dist.sh b/cv/semantic_segmentation/unet/pytorch/train_unet_dist.sh index 87f4df507..c928b50b7 100644 --- a/cv/semantic_segmentation/unet/pytorch/train_unet_dist.sh +++ b/cv/semantic_segmentation/unet/pytorch/train_unet_dist.sh @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + CURRENT_DIR=$(cd `dirname $0`; pwd) ROOT_DIR=${CURRENT_DIR} -- Gitee From c9e331dabafee995753670f679d802b859bf7334 Mon Sep 17 00:00:00 2001 From: "wenfeng.zhang" Date: Thu, 24 Nov 2022 13:49:05 +0800 Subject: [PATCH 04/10] add license --- .../densenet/pytorch/__init__.py | 22 ++++++++++++------- .../densenet/pytorch/common_utils/__init__.py | 22 ++++++++++++------- .../densenet/pytorch/dataloader/__init__.py | 22 ++++++++++++------- .../pytorch/dataloader/utils/__init__.py | 22 ++++++++++++------- cv/classification/densenet/pytorch/train.py | 15 ++++++++++++- .../googlenet/pytorch/__init__.py | 22 ++++++++++++------- cv/classification/googlenet/pytorch/train.py | 15 ++++++++++++- cv/classification/googlenet/pytorch/utils_.py | 15 ++++++++++++- cv/classification/lenet/pytorch/__init__.py | 22 ++++++++++++------- .../lenet/pytorch/dataloader/__init__.py | 22 ++++++++++++------- .../pytorch/dataloader/utils/__init__.py | 22 ++++++++++++------- cv/classification/lenet/pytorch/train.py | 15 ++++++++++++- cv/classification/lenet/pytorch/utils_.py | 15 ++++++++++++- .../xception/pytorch/__init__.py | 14 ++++++++++++ .../xception/pytorch/dataloader/__init__.py | 14 ++++++++++++ .../pytorch/dataloader/utils/__init__.py | 14 ++++++++++++ cv/classification/xception/pytorch/train.py | 15 ++++++++++++- cv/classification/xception/pytorch/utils_.py | 15 ++++++++++++- cv/ocr/satrn/pytorch/base/apis/__init__.py | 2 ++ cv/ocr/satrn/pytorch/base/csrc/build.sh | 14 ++++++++++++ cv/ocr/satrn/pytorch/base/csrc/clean.sh | 14 ++++++++++++ cv/ocr/satrn/pytorch/base/csrc/install.sh | 14 ++++++++++++ .../satrn/pytorch/base/csrc/satrn/__init__.py | 14 ++++++++++++ cv/ocr/satrn/pytorch/base/dist_train.sh | 14 ++++++++++++ cv/ocr/satrn/pytorch/base/ocrcv/__init__.py | 2 ++ 25 files changed, 326 insertions(+), 71 deletions(-) diff --git a/cv/classification/densenet/pytorch/__init__.py b/cv/classification/densenet/pytorch/__init__.py index b3b1e076e..70667c25f 100755 --- a/cv/classification/densenet/pytorch/__init__.py +++ b/cv/classification/densenet/pytorch/__init__.py @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from .utils import * from .common_utils import * from .data_loader import * diff --git a/cv/classification/densenet/pytorch/common_utils/__init__.py b/cv/classification/densenet/pytorch/common_utils/__init__.py index 7e6377c90..1b7d34120 100755 --- a/cv/classification/densenet/pytorch/common_utils/__init__.py +++ b/cv/classification/densenet/pytorch/common_utils/__init__.py @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import random import numpy as np diff --git a/cv/classification/densenet/pytorch/dataloader/__init__.py b/cv/classification/densenet/pytorch/dataloader/__init__.py index 23eeb3777..66b217b85 100755 --- a/cv/classification/densenet/pytorch/dataloader/__init__.py +++ b/cv/classification/densenet/pytorch/dataloader/__init__.py @@ -1,8 +1,14 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. \ No newline at end of file diff --git a/cv/classification/densenet/pytorch/dataloader/utils/__init__.py b/cv/classification/densenet/pytorch/dataloader/utils/__init__.py index 23eeb3777..66b217b85 100755 --- a/cv/classification/densenet/pytorch/dataloader/utils/__init__.py +++ b/cv/classification/densenet/pytorch/dataloader/utils/__init__.py @@ -1,8 +1,14 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. \ No newline at end of file diff --git a/cv/classification/densenet/pytorch/train.py b/cv/classification/densenet/pytorch/train.py index 59abfe190..0eed17975 100755 --- a/cv/classification/densenet/pytorch/train.py +++ b/cv/classification/densenet/pytorch/train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import datetime diff --git a/cv/classification/googlenet/pytorch/__init__.py b/cv/classification/googlenet/pytorch/__init__.py index b3b1e076e..70667c25f 100755 --- a/cv/classification/googlenet/pytorch/__init__.py +++ b/cv/classification/googlenet/pytorch/__init__.py @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from .utils import * from .common_utils import * from .data_loader import * diff --git a/cv/classification/googlenet/pytorch/train.py b/cv/classification/googlenet/pytorch/train.py index dcdcbc05a..d52564e38 100755 --- a/cv/classification/googlenet/pytorch/train.py +++ b/cv/classification/googlenet/pytorch/train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import datetime diff --git a/cv/classification/googlenet/pytorch/utils_.py b/cv/classification/googlenet/pytorch/utils_.py index 3d34c4df0..f5eb8708d 100755 --- a/cv/classification/googlenet/pytorch/utils_.py +++ b/cv/classification/googlenet/pytorch/utils_.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/classification/lenet/pytorch/__init__.py b/cv/classification/lenet/pytorch/__init__.py index b3b1e076e..70667c25f 100755 --- a/cv/classification/lenet/pytorch/__init__.py +++ b/cv/classification/lenet/pytorch/__init__.py @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from .utils import * from .common_utils import * from .data_loader import * diff --git a/cv/classification/lenet/pytorch/dataloader/__init__.py b/cv/classification/lenet/pytorch/dataloader/__init__.py index 23eeb3777..66b217b85 100755 --- a/cv/classification/lenet/pytorch/dataloader/__init__.py +++ b/cv/classification/lenet/pytorch/dataloader/__init__.py @@ -1,8 +1,14 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. \ No newline at end of file diff --git a/cv/classification/lenet/pytorch/dataloader/utils/__init__.py b/cv/classification/lenet/pytorch/dataloader/utils/__init__.py index 23eeb3777..66b217b85 100755 --- a/cv/classification/lenet/pytorch/dataloader/utils/__init__.py +++ b/cv/classification/lenet/pytorch/dataloader/utils/__init__.py @@ -1,8 +1,14 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. \ No newline at end of file diff --git a/cv/classification/lenet/pytorch/train.py b/cv/classification/lenet/pytorch/train.py index e20c03230..9547ae777 100755 --- a/cv/classification/lenet/pytorch/train.py +++ b/cv/classification/lenet/pytorch/train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import datetime diff --git a/cv/classification/lenet/pytorch/utils_.py b/cv/classification/lenet/pytorch/utils_.py index 3d34c4df0..f5eb8708d 100755 --- a/cv/classification/lenet/pytorch/utils_.py +++ b/cv/classification/lenet/pytorch/utils_.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/classification/xception/pytorch/__init__.py b/cv/classification/xception/pytorch/__init__.py index 6faec1658..70667c25f 100755 --- a/cv/classification/xception/pytorch/__init__.py +++ b/cv/classification/xception/pytorch/__init__.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from .utils import * from .common_utils import * from .data_loader import * diff --git a/cv/classification/xception/pytorch/dataloader/__init__.py b/cv/classification/xception/pytorch/dataloader/__init__.py index e69de29bb..66b217b85 100755 --- a/cv/classification/xception/pytorch/dataloader/__init__.py +++ b/cv/classification/xception/pytorch/dataloader/__init__.py @@ -0,0 +1,14 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. \ No newline at end of file diff --git a/cv/classification/xception/pytorch/dataloader/utils/__init__.py b/cv/classification/xception/pytorch/dataloader/utils/__init__.py index e69de29bb..66b217b85 100755 --- a/cv/classification/xception/pytorch/dataloader/utils/__init__.py +++ b/cv/classification/xception/pytorch/dataloader/utils/__init__.py @@ -0,0 +1,14 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. \ No newline at end of file diff --git a/cv/classification/xception/pytorch/train.py b/cv/classification/xception/pytorch/train.py index 28f444984..3e4f823ba 100755 --- a/cv/classification/xception/pytorch/train.py +++ b/cv/classification/xception/pytorch/train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import datetime diff --git a/cv/classification/xception/pytorch/utils_.py b/cv/classification/xception/pytorch/utils_.py index 3d34c4df0..f5eb8708d 100755 --- a/cv/classification/xception/pytorch/utils_.py +++ b/cv/classification/xception/pytorch/utils_.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/ocr/satrn/pytorch/base/apis/__init__.py b/cv/ocr/satrn/pytorch/base/apis/__init__.py index 776a08dd8..1084de43f 100755 --- a/cv/ocr/satrn/pytorch/base/apis/__init__.py +++ b/cv/ocr/satrn/pytorch/base/apis/__init__.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. from .train import init_random_seed, train_detector from .utils import (disable_text_recog_aug_test, replace_image_to_tensor, diff --git a/cv/ocr/satrn/pytorch/base/csrc/build.sh b/cv/ocr/satrn/pytorch/base/csrc/build.sh index f891e76cb..b3d046727 100755 --- a/cv/ocr/satrn/pytorch/base/csrc/build.sh +++ b/cv/ocr/satrn/pytorch/base/csrc/build.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash MAX_JOBS=${MAX_JOBS:-$(nproc --all)} diff --git a/cv/ocr/satrn/pytorch/base/csrc/clean.sh b/cv/ocr/satrn/pytorch/base/csrc/clean.sh index 2b2cd07bb..5d2ddf3e6 100755 --- a/cv/ocr/satrn/pytorch/base/csrc/clean.sh +++ b/cv/ocr/satrn/pytorch/base/csrc/clean.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash PYTHON_PATH=$(which pip3) diff --git a/cv/ocr/satrn/pytorch/base/csrc/install.sh b/cv/ocr/satrn/pytorch/base/csrc/install.sh index 017388ad9..c0ddeb3f0 100755 --- a/cv/ocr/satrn/pytorch/base/csrc/install.sh +++ b/cv/ocr/satrn/pytorch/base/csrc/install.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash TARGET_DIR=${TARGET_DIR:-} diff --git a/cv/ocr/satrn/pytorch/base/csrc/satrn/__init__.py b/cv/ocr/satrn/pytorch/base/csrc/satrn/__init__.py index 16281fe0b..dbce4e59b 100755 --- a/cv/ocr/satrn/pytorch/base/csrc/satrn/__init__.py +++ b/cv/ocr/satrn/pytorch/base/csrc/satrn/__init__.py @@ -1 +1,15 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from .utils import * diff --git a/cv/ocr/satrn/pytorch/base/dist_train.sh b/cv/ocr/satrn/pytorch/base/dist_train.sh index 4ef0ea669..3309af93f 100755 --- a/cv/ocr/satrn/pytorch/base/dist_train.sh +++ b/cv/ocr/satrn/pytorch/base/dist_train.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/usr/bin/env bash CONFIG=$1 diff --git a/cv/ocr/satrn/pytorch/base/ocrcv/__init__.py b/cv/ocr/satrn/pytorch/base/ocrcv/__init__.py index 461b113b0..11f0f23a0 100755 --- a/cv/ocr/satrn/pytorch/base/ocrcv/__init__.py +++ b/cv/ocr/satrn/pytorch/base/ocrcv/__init__.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) Open-MMLab. All rights reserved. from .fileio import * from .image import * -- Gitee From 914c514fcff757b472509442bec9a8877b212231 Mon Sep 17 00:00:00 2001 From: "jianyong.jiang" Date: Fri, 25 Nov 2022 11:03:10 +0800 Subject: [PATCH 05/10] Update license in bert, retinanet, segmentation. --- .../retinanet/pytorch/common_utils/dist.py | 2 +- .../pytorch/common_utils/metric_logger.py | 2 +- .../pytorch/common_utils/smooth_value.py | 2 +- .../retinanet/pytorch/dataloader/detection.py | 2 +- .../pytorch/dataloader/utils/coco_utils.py | 2 +- .../pytorch/dataloader/utils/pascal_voc.py | 2 +- .../dataloader/utils/presets_detection.py | 2 +- .../dataloader/utils/presets_segmentation.py | 2 +- .../dataloader/utils/transforms_det.py | 2 +- cv/detection/retinanet/pytorch/engine.py | 2 +- cv/detection/retinanet/pytorch/train.py | 2 +- .../pytorch/mmcv/runner/hooks/iter_timer.py | 2 +- .../apcnet/pytorch/mmseg/apis/train.py | 2 +- .../bisenet/pytorch/run_train.py | 15 +++++++++++- .../cgnet/pytorch/run_train.py | 15 +++++++++++- .../contextnet/pytorch/run_train.py | 15 +++++++++++- .../dabnet/pytorch/run_train.py | 15 +++++++++++- .../danet/pytorch/run_train.py | 15 +++++++++++- .../denseaspp/pytorch/run_train.py | 15 +++++++++++- .../dfanet/pytorch/run_train.py | 15 +++++++++++- .../dunet/pytorch/run_train.py | 15 +++++++++++- .../encnet/pytorch/run_train.py | 15 +++++++++++- .../enet/pytorch/run_train.py | 15 +++++++++++- .../erfnet/pytorch/run_train.py | 15 +++++++++++- .../espnet/pytorch/run_train.py | 15 +++++++++++- .../fastscnn/pytorch/run_train.py | 15 +++++++++++- .../fpenet/pytorch/run_train.py | 15 +++++++++++- .../pytorch/mmcv/runner/hooks/iter_timer.py | 2 +- .../hardnet/pytorch/run_train.py | 15 +++++++++++- .../icnet/pytorch/run_train.py | 15 +++++++++++- .../lednet/pytorch/run_train.py | 15 +++++++++++- .../linknet/pytorch/run_train.py | 15 +++++++++++- .../ocnet/pytorch/run_train.py | 15 +++++++++++- .../ocrnet/pytorch/init.sh | 2 +- .../ocrnet/pytorch/lib/core/function.py | 2 +- .../ocrnet/pytorch/tools/train.py | 2 +- .../ocrnet/pytorch/train.sh | 2 +- .../ocrnet/pytorch/train_distx2.sh | 2 +- .../ocrnet/pytorch/train_distx4.sh | 2 +- .../ocrnet/pytorch/train_distx8.sh | 2 +- .../psanet/pytorch/run_train.py | 15 +++++++++++- .../pytorch/mmcv/runner/hooks/iter_timer.py | 2 +- .../pspnet/pytorch/mmseg/apis/train.py | 2 +- .../refinenet/pytorch/run_train.py | 15 +++++++++++- .../segnet/pytorch/run_train.py | 15 +++++++++++- .../torchvision/pytorch/common_utils/dist.py | 2 +- .../pytorch/common_utils/metric_logger.py | 2 +- .../pytorch/common_utils/smooth_value.py | 2 +- .../pytorch/dataloader/segmentation.py | 23 ++++++++++++------- .../pytorch/dataloader/utils/camvid.py | 2 +- .../dataloader/utils/coco_seg_utils.py | 2 +- .../pytorch/dataloader/utils/coco_utils.py | 2 +- .../pytorch/dataloader/utils/pascal_voc.py | 2 +- .../dataloader/utils/presets_segmentation.py | 2 +- .../dataloader/utils/transforms_seg.py | 2 +- .../torchvision/pytorch/train.py | 2 +- .../unet/pytorch/run_train.py | 15 +++++++++++- .../unet3d/pytorch/common_utils/dist.py | 2 +- .../pytorch/common_utils/metric_logger.py | 2 +- .../pytorch/common_utils/smooth_value.py | 2 +- .../bert/pytorch/fwd_loss_bwd_trainer.py | 2 +- .../bert/pytorch/run_pretraining.py | 2 +- .../train_bert_pretraining_amp_dist.sh | 15 ++++++++++++ 63 files changed, 390 insertions(+), 69 deletions(-) diff --git a/cv/detection/retinanet/pytorch/common_utils/dist.py b/cv/detection/retinanet/pytorch/common_utils/dist.py index ea56ca267..78e5010ec 100644 --- a/cv/detection/retinanet/pytorch/common_utils/dist.py +++ b/cv/detection/retinanet/pytorch/common_utils/dist.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/detection/retinanet/pytorch/common_utils/metric_logger.py b/cv/detection/retinanet/pytorch/common_utils/metric_logger.py index 960641c4d..7d4c963ad 100644 --- a/cv/detection/retinanet/pytorch/common_utils/metric_logger.py +++ b/cv/detection/retinanet/pytorch/common_utils/metric_logger.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/detection/retinanet/pytorch/common_utils/smooth_value.py b/cv/detection/retinanet/pytorch/common_utils/smooth_value.py index 30cb89d60..e83996ca2 100644 --- a/cv/detection/retinanet/pytorch/common_utils/smooth_value.py +++ b/cv/detection/retinanet/pytorch/common_utils/smooth_value.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/detection/retinanet/pytorch/dataloader/detection.py b/cv/detection/retinanet/pytorch/dataloader/detection.py index ecd66e196..7558f5da4 100644 --- a/cv/detection/retinanet/pytorch/dataloader/detection.py +++ b/cv/detection/retinanet/pytorch/dataloader/detection.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright Declaration: This software, including all of its code and documentation, # except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX # Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright diff --git a/cv/detection/retinanet/pytorch/dataloader/utils/coco_utils.py b/cv/detection/retinanet/pytorch/dataloader/utils/coco_utils.py index cef31f4a8..b0e696473 100644 --- a/cv/detection/retinanet/pytorch/dataloader/utils/coco_utils.py +++ b/cv/detection/retinanet/pytorch/dataloader/utils/coco_utils.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/detection/retinanet/pytorch/dataloader/utils/pascal_voc.py b/cv/detection/retinanet/pytorch/dataloader/utils/pascal_voc.py index d60942541..b05b60668 100644 --- a/cv/detection/retinanet/pytorch/dataloader/utils/pascal_voc.py +++ b/cv/detection/retinanet/pytorch/dataloader/utils/pascal_voc.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/detection/retinanet/pytorch/dataloader/utils/presets_detection.py b/cv/detection/retinanet/pytorch/dataloader/utils/presets_detection.py index 75946f078..9c50debfa 100644 --- a/cv/detection/retinanet/pytorch/dataloader/utils/presets_detection.py +++ b/cv/detection/retinanet/pytorch/dataloader/utils/presets_detection.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/detection/retinanet/pytorch/dataloader/utils/presets_segmentation.py b/cv/detection/retinanet/pytorch/dataloader/utils/presets_segmentation.py index 45e0d029b..6c23e2b32 100644 --- a/cv/detection/retinanet/pytorch/dataloader/utils/presets_segmentation.py +++ b/cv/detection/retinanet/pytorch/dataloader/utils/presets_segmentation.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/detection/retinanet/pytorch/dataloader/utils/transforms_det.py b/cv/detection/retinanet/pytorch/dataloader/utils/transforms_det.py index 227d41874..14f573c89 100644 --- a/cv/detection/retinanet/pytorch/dataloader/utils/transforms_det.py +++ b/cv/detection/retinanet/pytorch/dataloader/utils/transforms_det.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import sys from typing import List, Tuple, Dict, Optional diff --git a/cv/detection/retinanet/pytorch/engine.py b/cv/detection/retinanet/pytorch/engine.py index 9afb3bdad..7f21fe49e 100644 --- a/cv/detection/retinanet/pytorch/engine.py +++ b/cv/detection/retinanet/pytorch/engine.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import math diff --git a/cv/detection/retinanet/pytorch/train.py b/cv/detection/retinanet/pytorch/train.py index a373a4c20..b88dfb7d2 100644 --- a/cv/detection/retinanet/pytorch/train.py +++ b/cv/detection/retinanet/pytorch/train.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. r"""PyTorch Detection Training. diff --git a/cv/semantic_segmentation/apcnet/pytorch/mmcv/runner/hooks/iter_timer.py b/cv/semantic_segmentation/apcnet/pytorch/mmcv/runner/hooks/iter_timer.py index 5fe0d4401..6bde4d52c 100644 --- a/cv/semantic_segmentation/apcnet/pytorch/mmcv/runner/hooks/iter_timer.py +++ b/cv/semantic_segmentation/apcnet/pytorch/mmcv/runner/hooks/iter_timer.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import time diff --git a/cv/semantic_segmentation/apcnet/pytorch/mmseg/apis/train.py b/cv/semantic_segmentation/apcnet/pytorch/mmseg/apis/train.py index 4191ce736..473adef28 100644 --- a/cv/semantic_segmentation/apcnet/pytorch/mmseg/apis/train.py +++ b/cv/semantic_segmentation/apcnet/pytorch/mmseg/apis/train.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import random diff --git a/cv/semantic_segmentation/bisenet/pytorch/run_train.py b/cv/semantic_segmentation/bisenet/pytorch/run_train.py index 969df2de0..d54fc8430 100644 --- a/cv/semantic_segmentation/bisenet/pytorch/run_train.py +++ b/cv/semantic_segmentation/bisenet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/cgnet/pytorch/run_train.py b/cv/semantic_segmentation/cgnet/pytorch/run_train.py index e1d3973d4..d6193403c 100644 --- a/cv/semantic_segmentation/cgnet/pytorch/run_train.py +++ b/cv/semantic_segmentation/cgnet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/contextnet/pytorch/run_train.py b/cv/semantic_segmentation/contextnet/pytorch/run_train.py index e0cfeadeb..df7591edf 100644 --- a/cv/semantic_segmentation/contextnet/pytorch/run_train.py +++ b/cv/semantic_segmentation/contextnet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/dabnet/pytorch/run_train.py b/cv/semantic_segmentation/dabnet/pytorch/run_train.py index 59eacc013..7d240a735 100644 --- a/cv/semantic_segmentation/dabnet/pytorch/run_train.py +++ b/cv/semantic_segmentation/dabnet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/danet/pytorch/run_train.py b/cv/semantic_segmentation/danet/pytorch/run_train.py index 90418802a..3dc45b2be 100644 --- a/cv/semantic_segmentation/danet/pytorch/run_train.py +++ b/cv/semantic_segmentation/danet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/denseaspp/pytorch/run_train.py b/cv/semantic_segmentation/denseaspp/pytorch/run_train.py index 90418802a..3dc45b2be 100644 --- a/cv/semantic_segmentation/denseaspp/pytorch/run_train.py +++ b/cv/semantic_segmentation/denseaspp/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/dfanet/pytorch/run_train.py b/cv/semantic_segmentation/dfanet/pytorch/run_train.py index d91e7d250..1aea187a0 100644 --- a/cv/semantic_segmentation/dfanet/pytorch/run_train.py +++ b/cv/semantic_segmentation/dfanet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/dunet/pytorch/run_train.py b/cv/semantic_segmentation/dunet/pytorch/run_train.py index 90418802a..3dc45b2be 100644 --- a/cv/semantic_segmentation/dunet/pytorch/run_train.py +++ b/cv/semantic_segmentation/dunet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/encnet/pytorch/run_train.py b/cv/semantic_segmentation/encnet/pytorch/run_train.py index 90418802a..3dc45b2be 100644 --- a/cv/semantic_segmentation/encnet/pytorch/run_train.py +++ b/cv/semantic_segmentation/encnet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/enet/pytorch/run_train.py b/cv/semantic_segmentation/enet/pytorch/run_train.py index 1b34f8f7b..6bcf67db5 100644 --- a/cv/semantic_segmentation/enet/pytorch/run_train.py +++ b/cv/semantic_segmentation/enet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/erfnet/pytorch/run_train.py b/cv/semantic_segmentation/erfnet/pytorch/run_train.py index 8a5922ef9..a8109a856 100644 --- a/cv/semantic_segmentation/erfnet/pytorch/run_train.py +++ b/cv/semantic_segmentation/erfnet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/espnet/pytorch/run_train.py b/cv/semantic_segmentation/espnet/pytorch/run_train.py index 13682bab3..9c5cbf6ff 100644 --- a/cv/semantic_segmentation/espnet/pytorch/run_train.py +++ b/cv/semantic_segmentation/espnet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/fastscnn/pytorch/run_train.py b/cv/semantic_segmentation/fastscnn/pytorch/run_train.py index 43bdac278..c8b952f0e 100644 --- a/cv/semantic_segmentation/fastscnn/pytorch/run_train.py +++ b/cv/semantic_segmentation/fastscnn/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/fpenet/pytorch/run_train.py b/cv/semantic_segmentation/fpenet/pytorch/run_train.py index 95cd22be3..86c978f2d 100644 --- a/cv/semantic_segmentation/fpenet/pytorch/run_train.py +++ b/cv/semantic_segmentation/fpenet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/gcnet/pytorch/mmcv/runner/hooks/iter_timer.py b/cv/semantic_segmentation/gcnet/pytorch/mmcv/runner/hooks/iter_timer.py index e067d32d2..38df1a058 100755 --- a/cv/semantic_segmentation/gcnet/pytorch/mmcv/runner/hooks/iter_timer.py +++ b/cv/semantic_segmentation/gcnet/pytorch/mmcv/runner/hooks/iter_timer.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import time diff --git a/cv/semantic_segmentation/hardnet/pytorch/run_train.py b/cv/semantic_segmentation/hardnet/pytorch/run_train.py index ca638df00..0f68e7a7a 100644 --- a/cv/semantic_segmentation/hardnet/pytorch/run_train.py +++ b/cv/semantic_segmentation/hardnet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/icnet/pytorch/run_train.py b/cv/semantic_segmentation/icnet/pytorch/run_train.py index a627e2a39..fe971f5b4 100644 --- a/cv/semantic_segmentation/icnet/pytorch/run_train.py +++ b/cv/semantic_segmentation/icnet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/lednet/pytorch/run_train.py b/cv/semantic_segmentation/lednet/pytorch/run_train.py index 26ced23ce..ae4c59c49 100644 --- a/cv/semantic_segmentation/lednet/pytorch/run_train.py +++ b/cv/semantic_segmentation/lednet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/linknet/pytorch/run_train.py b/cv/semantic_segmentation/linknet/pytorch/run_train.py index 0dd691b97..1e41bdfbc 100644 --- a/cv/semantic_segmentation/linknet/pytorch/run_train.py +++ b/cv/semantic_segmentation/linknet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/ocnet/pytorch/run_train.py b/cv/semantic_segmentation/ocnet/pytorch/run_train.py index 90418802a..3dc45b2be 100644 --- a/cv/semantic_segmentation/ocnet/pytorch/run_train.py +++ b/cv/semantic_segmentation/ocnet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/ocrnet/pytorch/init.sh b/cv/semantic_segmentation/ocrnet/pytorch/init.sh index d8f9faa7d..7abdc43ef 100644 --- a/cv/semantic_segmentation/ocrnet/pytorch/init.sh +++ b/cv/semantic_segmentation/ocrnet/pytorch/init.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. rm -rf log/ rm -rf output/ pip3 install -r requirements.txt diff --git a/cv/semantic_segmentation/ocrnet/pytorch/lib/core/function.py b/cv/semantic_segmentation/ocrnet/pytorch/lib/core/function.py index fc49145d8..603d736e9 100644 --- a/cv/semantic_segmentation/ocrnet/pytorch/lib/core/function.py +++ b/cv/semantic_segmentation/ocrnet/pytorch/lib/core/function.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. diff --git a/cv/semantic_segmentation/ocrnet/pytorch/tools/train.py b/cv/semantic_segmentation/ocrnet/pytorch/tools/train.py index 72bff2582..44d270bc1 100644 --- a/cv/semantic_segmentation/ocrnet/pytorch/tools/train.py +++ b/cv/semantic_segmentation/ocrnet/pytorch/tools/train.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. diff --git a/cv/semantic_segmentation/ocrnet/pytorch/train.sh b/cv/semantic_segmentation/ocrnet/pytorch/train.sh index 35efbac9f..9554de162 100644 --- a/cv/semantic_segmentation/ocrnet/pytorch/train.sh +++ b/cv/semantic_segmentation/ocrnet/pytorch/train.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. python3 tools/train.py --cfg experiments/cityscapes/seg_hrnet_w48_train_512x1024_sgd_lr1e-2_wd5e-4_bs_12_epoch484x1.yaml diff --git a/cv/semantic_segmentation/ocrnet/pytorch/train_distx2.sh b/cv/semantic_segmentation/ocrnet/pytorch/train_distx2.sh index e2aec53bb..b64cff397 100644 --- a/cv/semantic_segmentation/ocrnet/pytorch/train_distx2.sh +++ b/cv/semantic_segmentation/ocrnet/pytorch/train_distx2.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. GPU_NUMS=2 python3 -m torch.distributed.launch --nproc_per_node=$GPU_NUMS tools/train.py --cfg experiments/cityscapes/seg_hrnet_w48_train_512x1024_sgd_lr1e-2_wd5e-4_bs_12_epoch484x2.yaml diff --git a/cv/semantic_segmentation/ocrnet/pytorch/train_distx4.sh b/cv/semantic_segmentation/ocrnet/pytorch/train_distx4.sh index fe34291d1..fbf6e4e5a 100644 --- a/cv/semantic_segmentation/ocrnet/pytorch/train_distx4.sh +++ b/cv/semantic_segmentation/ocrnet/pytorch/train_distx4.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. GPU_NUMS=4 python3 -m torch.distributed.launch --nproc_per_node=$GPU_NUMS tools/train.py --cfg experiments/cityscapes/seg_hrnet_w48_train_512x1024_sgd_lr1e-2_wd5e-4_bs_12_epoch484.yaml diff --git a/cv/semantic_segmentation/ocrnet/pytorch/train_distx8.sh b/cv/semantic_segmentation/ocrnet/pytorch/train_distx8.sh index cd8269c5d..70089fa55 100644 --- a/cv/semantic_segmentation/ocrnet/pytorch/train_distx8.sh +++ b/cv/semantic_segmentation/ocrnet/pytorch/train_distx8.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. GPU_NUMS=8 python3 -m torch.distributed.launch --nproc_per_node=$GPU_NUMS tools/train.py --cfg experiments/cityscapes/seg_hrnet_w48_train_512x1024_sgd_lr1e-2_wd5e-4_bs_12_epoch484x8.yaml diff --git a/cv/semantic_segmentation/psanet/pytorch/run_train.py b/cv/semantic_segmentation/psanet/pytorch/run_train.py index 2bdf58740..e735211ef 100644 --- a/cv/semantic_segmentation/psanet/pytorch/run_train.py +++ b/cv/semantic_segmentation/psanet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/pspnet/pytorch/mmcv/runner/hooks/iter_timer.py b/cv/semantic_segmentation/pspnet/pytorch/mmcv/runner/hooks/iter_timer.py index 5fe0d4401..6bde4d52c 100644 --- a/cv/semantic_segmentation/pspnet/pytorch/mmcv/runner/hooks/iter_timer.py +++ b/cv/semantic_segmentation/pspnet/pytorch/mmcv/runner/hooks/iter_timer.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import time diff --git a/cv/semantic_segmentation/pspnet/pytorch/mmseg/apis/train.py b/cv/semantic_segmentation/pspnet/pytorch/mmseg/apis/train.py index 4191ce736..473adef28 100644 --- a/cv/semantic_segmentation/pspnet/pytorch/mmseg/apis/train.py +++ b/cv/semantic_segmentation/pspnet/pytorch/mmseg/apis/train.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) OpenMMLab. All rights reserved. import random diff --git a/cv/semantic_segmentation/refinenet/pytorch/run_train.py b/cv/semantic_segmentation/refinenet/pytorch/run_train.py index 90418802a..3dc45b2be 100644 --- a/cv/semantic_segmentation/refinenet/pytorch/run_train.py +++ b/cv/semantic_segmentation/refinenet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/segnet/pytorch/run_train.py b/cv/semantic_segmentation/segnet/pytorch/run_train.py index ae7926cbd..92da68d24 100644 --- a/cv/semantic_segmentation/segnet/pytorch/run_train.py +++ b/cv/semantic_segmentation/segnet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/torchvision/pytorch/common_utils/dist.py b/cv/semantic_segmentation/torchvision/pytorch/common_utils/dist.py index ea56ca267..78e5010ec 100644 --- a/cv/semantic_segmentation/torchvision/pytorch/common_utils/dist.py +++ b/cv/semantic_segmentation/torchvision/pytorch/common_utils/dist.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/semantic_segmentation/torchvision/pytorch/common_utils/metric_logger.py b/cv/semantic_segmentation/torchvision/pytorch/common_utils/metric_logger.py index 960641c4d..7d4c963ad 100644 --- a/cv/semantic_segmentation/torchvision/pytorch/common_utils/metric_logger.py +++ b/cv/semantic_segmentation/torchvision/pytorch/common_utils/metric_logger.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/semantic_segmentation/torchvision/pytorch/common_utils/smooth_value.py b/cv/semantic_segmentation/torchvision/pytorch/common_utils/smooth_value.py index 30cb89d60..e83996ca2 100644 --- a/cv/semantic_segmentation/torchvision/pytorch/common_utils/smooth_value.py +++ b/cv/semantic_segmentation/torchvision/pytorch/common_utils/smooth_value.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/semantic_segmentation/torchvision/pytorch/dataloader/segmentation.py b/cv/semantic_segmentation/torchvision/pytorch/dataloader/segmentation.py index 8bf4bc7e7..3791b8b63 100644 --- a/cv/semantic_segmentation/torchvision/pytorch/dataloader/segmentation.py +++ b/cv/semantic_segmentation/torchvision/pytorch/dataloader/segmentation.py @@ -1,11 +1,18 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import torchvision diff --git a/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/camvid.py b/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/camvid.py index 0f5487480..d68c73fc8 100644 --- a/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/camvid.py +++ b/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/camvid.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright Declaration: This software, including all of its code and documentation, # except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX # Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright diff --git a/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/coco_seg_utils.py b/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/coco_seg_utils.py index bab58447b..1a0409d0e 100644 --- a/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/coco_seg_utils.py +++ b/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/coco_seg_utils.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/coco_utils.py b/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/coco_utils.py index cef31f4a8..b0e696473 100644 --- a/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/coco_utils.py +++ b/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/coco_utils.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/pascal_voc.py b/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/pascal_voc.py index d60942541..b05b60668 100644 --- a/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/pascal_voc.py +++ b/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/pascal_voc.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/presets_segmentation.py b/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/presets_segmentation.py index 45e0d029b..6c23e2b32 100644 --- a/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/presets_segmentation.py +++ b/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/presets_segmentation.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/transforms_seg.py b/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/transforms_seg.py index c091e7b60..9f408dc12 100644 --- a/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/transforms_seg.py +++ b/cv/semantic_segmentation/torchvision/pytorch/dataloader/utils/transforms_seg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/semantic_segmentation/torchvision/pytorch/train.py b/cv/semantic_segmentation/torchvision/pytorch/train.py index 1e229058f..3ef737308 100644 --- a/cv/semantic_segmentation/torchvision/pytorch/train.py +++ b/cv/semantic_segmentation/torchvision/pytorch/train.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import datetime diff --git a/cv/semantic_segmentation/unet/pytorch/run_train.py b/cv/semantic_segmentation/unet/pytorch/run_train.py index 967a515d5..6dc38484e 100644 --- a/cv/semantic_segmentation/unet/pytorch/run_train.py +++ b/cv/semantic_segmentation/unet/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/semantic_segmentation/unet3d/pytorch/common_utils/dist.py b/cv/semantic_segmentation/unet3d/pytorch/common_utils/dist.py index 1d5cb4b16..35b927d7c 100644 --- a/cv/semantic_segmentation/unet3d/pytorch/common_utils/dist.py +++ b/cv/semantic_segmentation/unet3d/pytorch/common_utils/dist.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/semantic_segmentation/unet3d/pytorch/common_utils/metric_logger.py b/cv/semantic_segmentation/unet3d/pytorch/common_utils/metric_logger.py index 960641c4d..7d4c963ad 100644 --- a/cv/semantic_segmentation/unet3d/pytorch/common_utils/metric_logger.py +++ b/cv/semantic_segmentation/unet3d/pytorch/common_utils/metric_logger.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/semantic_segmentation/unet3d/pytorch/common_utils/smooth_value.py b/cv/semantic_segmentation/unet3d/pytorch/common_utils/smooth_value.py index 30cb89d60..e83996ca2 100644 --- a/cv/semantic_segmentation/unet3d/pytorch/common_utils/smooth_value.py +++ b/cv/semantic_segmentation/unet3d/pytorch/common_utils/smooth_value.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/nlp/language_model/bert/pytorch/fwd_loss_bwd_trainer.py b/nlp/language_model/bert/pytorch/fwd_loss_bwd_trainer.py index eb20925d0..2732d6477 100644 --- a/nlp/language_model/bert/pytorch/fwd_loss_bwd_trainer.py +++ b/nlp/language_model/bert/pytorch/fwd_loss_bwd_trainer.py @@ -1,5 +1,5 @@ # coding=utf-8 -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # Copyright (c) 2019-2021 NVIDIA CORPORATION. All rights reserved. # Copyright 2020 MLBenchmark Group. All rights reserved. diff --git a/nlp/language_model/bert/pytorch/run_pretraining.py b/nlp/language_model/bert/pytorch/run_pretraining.py index bcb01e477..6336fdc77 100644 --- a/nlp/language_model/bert/pytorch/run_pretraining.py +++ b/nlp/language_model/bert/pytorch/run_pretraining.py @@ -1,5 +1,5 @@ # coding=utf-8 -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd # Copyright (c) 2019-2021 NVIDIA CORPORATION. All rights reserved. # Copyright 2020 MLBenchmark Group. All rights reserved. diff --git a/nlp/language_model/bert/pytorch/train_bert_pretraining_amp_dist.sh b/nlp/language_model/bert/pytorch/train_bert_pretraining_amp_dist.sh index 0a77c569e..398f6d147 100644 --- a/nlp/language_model/bert/pytorch/train_bert_pretraining_amp_dist.sh +++ b/nlp/language_model/bert/pytorch/train_bert_pretraining_amp_dist.sh @@ -1,3 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + : ${DATA:="/home/datasets/nlp/bert"} -- Gitee From d4c272611a1a01d5ba968424d99666d072556bea Mon Sep 17 00:00:00 2001 From: root Date: Fri, 25 Nov 2022 03:07:31 +0000 Subject: [PATCH 06/10] add license and fix small bug --- .../conformer/pytorch/wenet/bin/recognize.py | 4 +++- .../conformer/pytorch/wenet/transformer/convolution.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) mode change 100644 => 100755 speech/speech_recognition/conformer/pytorch/wenet/transformer/convolution.py diff --git a/speech/speech_recognition/conformer/pytorch/wenet/bin/recognize.py b/speech/speech_recognition/conformer/pytorch/wenet/bin/recognize.py index a15e88ddd..86acc4503 100755 --- a/speech/speech_recognition/conformer/pytorch/wenet/bin/recognize.py +++ b/speech/speech_recognition/conformer/pytorch/wenet/bin/recognize.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) 2020 Mobvoi Inc. (authors: Binbin Zhang, Xiaoyu Chen, Di Wu) # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -173,7 +175,7 @@ def main(): model = model.to(device) model.eval() - with torch.no_grad(), open(args.result_file, 'w') as fout: + with torch.no_grad(), open(args.result_file, 'w', encoding="utf-8") as fout: for batch_idx, batch in enumerate(test_data_loader): keys, feats, target, feats_lengths, target_lengths = batch feats = feats.to(device) diff --git a/speech/speech_recognition/conformer/pytorch/wenet/transformer/convolution.py b/speech/speech_recognition/conformer/pytorch/wenet/transformer/convolution.py old mode 100644 new mode 100755 index 67edb01e3..d25b2d36f --- a/speech/speech_recognition/conformer/pytorch/wenet/transformer/convolution.py +++ b/speech/speech_recognition/conformer/pytorch/wenet/transformer/convolution.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright 2021 Mobvoi Inc. All Rights Reserved. # Author: di.wu@mobvoi.com (DI WU) """ConvolutionModule definition.""" @@ -136,7 +138,7 @@ class ConvolutionModule(nn.Module): return x.transpose(1, 2), new_cache -def glu_torch_imply(inputs,dim=-1): +def glu_torch_imply(inputs,dim:int=-1): x,y = torch.chunk(inputs, 2, dim=dim) outputs = x * torch.nn.functional.sigmoid(y) return outputs \ No newline at end of file -- Gitee From de4123ff871df3e0409f7a5b7298918da747a1ab Mon Sep 17 00:00:00 2001 From: "shengquan.nian" Date: Fri, 25 Nov 2022 04:04:47 +0000 Subject: [PATCH 07/10] add license --- .../ncf/pytorch/download_dataset.sh | 14 ++++++++++++++ .../ncf/pytorch/ncf_16.py | 3 ++- .../ncf/pytorch/ncf_32.py | 2 ++ .../ncf/pytorch/run_train_fp16.sh | 16 ++++++++++++++++ .../ncf/pytorch/run_train_fp32.sh | 16 ++++++++++++++++ 5 files changed, 50 insertions(+), 1 deletion(-) mode change 100644 => 100755 recommendation/collaborative_filtering/ncf/pytorch/download_dataset.sh mode change 100644 => 100755 recommendation/collaborative_filtering/ncf/pytorch/ncf_16.py mode change 100644 => 100755 recommendation/collaborative_filtering/ncf/pytorch/ncf_32.py mode change 100644 => 100755 recommendation/collaborative_filtering/ncf/pytorch/run_train_fp16.sh mode change 100644 => 100755 recommendation/collaborative_filtering/ncf/pytorch/run_train_fp32.sh diff --git a/recommendation/collaborative_filtering/ncf/pytorch/download_dataset.sh b/recommendation/collaborative_filtering/ncf/pytorch/download_dataset.sh old mode 100644 new mode 100755 index 581204825..00dc4ddb3 --- a/recommendation/collaborative_filtering/ncf/pytorch/download_dataset.sh +++ b/recommendation/collaborative_filtering/ncf/pytorch/download_dataset.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License # 新建目录 data mkdir data diff --git a/recommendation/collaborative_filtering/ncf/pytorch/ncf_16.py b/recommendation/collaborative_filtering/ncf/pytorch/ncf_16.py old mode 100644 new mode 100755 index ebd6adf49..deaa81277 --- a/recommendation/collaborative_filtering/ncf/pytorch/ncf_16.py +++ b/recommendation/collaborative_filtering/ncf/pytorch/ncf_16.py @@ -1,4 +1,5 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright Declaration: This software, including all of its code and documentation, # except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX # Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright diff --git a/recommendation/collaborative_filtering/ncf/pytorch/ncf_32.py b/recommendation/collaborative_filtering/ncf/pytorch/ncf_32.py old mode 100644 new mode 100755 index 9e3d06874..9164347b0 --- a/recommendation/collaborative_filtering/ncf/pytorch/ncf_32.py +++ b/recommendation/collaborative_filtering/ncf/pytorch/ncf_32.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) 2018, deepakn94, codyaustun, robieta. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/recommendation/collaborative_filtering/ncf/pytorch/run_train_fp16.sh b/recommendation/collaborative_filtering/ncf/pytorch/run_train_fp16.sh old mode 100644 new mode 100755 index c524d6504..eba3ea497 --- a/recommendation/collaborative_filtering/ncf/pytorch/run_train_fp16.sh +++ b/recommendation/collaborative_filtering/ncf/pytorch/run_train_fp16.sh @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) OpenMMLab. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + #!/bin/bash python3 -m torch.distributed.launch --nproc_per_node=8 \ diff --git a/recommendation/collaborative_filtering/ncf/pytorch/run_train_fp32.sh b/recommendation/collaborative_filtering/ncf/pytorch/run_train_fp32.sh old mode 100644 new mode 100755 index 00c3f3e51..a6610782b --- a/recommendation/collaborative_filtering/ncf/pytorch/run_train_fp32.sh +++ b/recommendation/collaborative_filtering/ncf/pytorch/run_train_fp32.sh @@ -1,3 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) OpenMMLab. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + #!/bin/bash python3 -m torch.distributed.launch --nproc_per_node=8 \ -- Gitee From b3a60bac7947d2a9f26981e54f33a574dca0bfc3 Mon Sep 17 00:00:00 2001 From: Qiang Zhang Date: Fri, 25 Nov 2022 14:44:58 +0800 Subject: [PATCH 08/10] Add copyright for cv/classification models --- cv/classification/dpn107/pytorch/run_train.py | 15 ++++++++++++- .../dpn107/pytorch/train_dpn107_amp_dist.sh | 22 ++++++++++++------- cv/classification/dpn92/pytorch/run_train.py | 15 ++++++++++++- .../dpn92/pytorch/train_dpn92_amp_dist.sh | 22 ++++++++++++------- .../eca_mobilenet_v2/pytorch/run_train.py | 15 ++++++++++++- .../train_eca_mobilenet_v2_amp_dist.sh | 22 ++++++++++++------- .../eca_resnet152/pytorch/run_train.py | 15 ++++++++++++- .../pytorch/train_eca_resnet152_amp_dist.sh | 22 ++++++++++++------- .../inceptionv3/pytorch/run_train.py | 15 ++++++++++++- .../pytorch/train_inception_v3_amp_dist.sh | 22 ++++++++++++------- .../inceptionv4/pytorch/run_train.py | 15 ++++++++++++- .../pytorch/train_inceptionv4_amp_dist.sh | 22 ++++++++++++------- .../mobilenetv2/pytorch/run_train.py | 15 ++++++++++++- .../pytorch/train_mobilenet_v2_amp_dist.sh | 22 ++++++++++++------- .../mobilenetv3/pytorch/run_train.py | 15 ++++++++++++- .../train_mobilenet_v3_large_amp_dist.sh | 22 ++++++++++++------- .../resnest14/pytorch/run_train.py | 15 ++++++++++++- .../pytorch/train_resnest14_amp_dist.sh | 22 ++++++++++++------- .../resnest269/pytorch/run_train.py | 15 ++++++++++++- .../pytorch/train_resnest269_amp_dist.sh | 22 ++++++++++++------- .../resnet101/pytorch/run_train.py | 15 ++++++++++++- .../pytorch/train_resnet101_amp_dist.sh | 22 ++++++++++++------- .../resnet152/pytorch/run_train.py | 15 ++++++++++++- .../pytorch/train_resnet152_amp_dist.sh | 22 ++++++++++++------- .../resnet18/pytorch/run_train.py | 15 ++++++++++++- .../pytorch/train_resnet18_amp_dist.sh | 22 ++++++++++++------- .../resnext101_32x8d/pytorch/run_train.py | 15 ++++++++++++- .../train_resnext101_32x8d_amp_dist.sh | 22 ++++++++++++------- .../resnext50_32x4d/pytorch/run_train.py | 15 ++++++++++++- .../pytorch/train_resnext50_32x4d_amp_dist.sh | 22 ++++++++++++------- .../seresnext/pytorch/run_train.py | 15 ++++++++++++- .../train_seresnext101_32x4d_amp_dist.sh | 22 ++++++++++++------- .../shufflenetv2/pytorch/run_train.py | 15 ++++++++++++- .../train_shufflenet_v2_x2_0_amp_dist.sh | 22 ++++++++++++------- cv/classification/vgg/pytorch/run_train.py | 15 ++++++++++++- .../vgg/pytorch/train_vgg16_amp_dist.sh | 22 ++++++++++++------- .../wide_resnet101_2/pytorch/run_train.py | 15 ++++++++++++- .../train_wide_resnet101_2_amp_dist.sh | 22 ++++++++++++------- 38 files changed, 532 insertions(+), 171 deletions(-) diff --git a/cv/classification/dpn107/pytorch/run_train.py b/cv/classification/dpn107/pytorch/run_train.py index 231ef0dbb..272b2d2c6 100644 --- a/cv/classification/dpn107/pytorch/run_train.py +++ b/cv/classification/dpn107/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/dpn107/pytorch/train_dpn107_amp_dist.sh b/cv/classification/dpn107/pytorch/train_dpn107_amp_dist.sh index 51c77464c..cac9f971b 100755 --- a/cv/classification/dpn107/pytorch/train_dpn107_amp_dist.sh +++ b/cv/classification/dpn107/pytorch/train_dpn107_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/dpn92/pytorch/run_train.py b/cv/classification/dpn92/pytorch/run_train.py index 231ef0dbb..272b2d2c6 100644 --- a/cv/classification/dpn92/pytorch/run_train.py +++ b/cv/classification/dpn92/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/dpn92/pytorch/train_dpn92_amp_dist.sh b/cv/classification/dpn92/pytorch/train_dpn92_amp_dist.sh index 365a0ec4e..3788955d2 100755 --- a/cv/classification/dpn92/pytorch/train_dpn92_amp_dist.sh +++ b/cv/classification/dpn92/pytorch/train_dpn92_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/eca_mobilenet_v2/pytorch/run_train.py b/cv/classification/eca_mobilenet_v2/pytorch/run_train.py index 141d33cd3..fd7aaa835 100644 --- a/cv/classification/eca_mobilenet_v2/pytorch/run_train.py +++ b/cv/classification/eca_mobilenet_v2/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/eca_mobilenet_v2/pytorch/train_eca_mobilenet_v2_amp_dist.sh b/cv/classification/eca_mobilenet_v2/pytorch/train_eca_mobilenet_v2_amp_dist.sh index be29cf700..d2bbc5ab8 100755 --- a/cv/classification/eca_mobilenet_v2/pytorch/train_eca_mobilenet_v2_amp_dist.sh +++ b/cv/classification/eca_mobilenet_v2/pytorch/train_eca_mobilenet_v2_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/eca_resnet152/pytorch/run_train.py b/cv/classification/eca_resnet152/pytorch/run_train.py index 9d81c540c..6e2c72799 100644 --- a/cv/classification/eca_resnet152/pytorch/run_train.py +++ b/cv/classification/eca_resnet152/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/eca_resnet152/pytorch/train_eca_resnet152_amp_dist.sh b/cv/classification/eca_resnet152/pytorch/train_eca_resnet152_amp_dist.sh index 7979250a3..3e4cf7f5e 100755 --- a/cv/classification/eca_resnet152/pytorch/train_eca_resnet152_amp_dist.sh +++ b/cv/classification/eca_resnet152/pytorch/train_eca_resnet152_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/inceptionv3/pytorch/run_train.py b/cv/classification/inceptionv3/pytorch/run_train.py index fa8aa3e7d..93439e78a 100644 --- a/cv/classification/inceptionv3/pytorch/run_train.py +++ b/cv/classification/inceptionv3/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/inceptionv3/pytorch/train_inception_v3_amp_dist.sh b/cv/classification/inceptionv3/pytorch/train_inception_v3_amp_dist.sh index 2e462189a..66385600f 100755 --- a/cv/classification/inceptionv3/pytorch/train_inception_v3_amp_dist.sh +++ b/cv/classification/inceptionv3/pytorch/train_inception_v3_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/inceptionv4/pytorch/run_train.py b/cv/classification/inceptionv4/pytorch/run_train.py index 5071cdd96..d72814a99 100644 --- a/cv/classification/inceptionv4/pytorch/run_train.py +++ b/cv/classification/inceptionv4/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/inceptionv4/pytorch/train_inceptionv4_amp_dist.sh b/cv/classification/inceptionv4/pytorch/train_inceptionv4_amp_dist.sh index 639d08000..0f131ee56 100755 --- a/cv/classification/inceptionv4/pytorch/train_inceptionv4_amp_dist.sh +++ b/cv/classification/inceptionv4/pytorch/train_inceptionv4_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/mobilenetv2/pytorch/run_train.py b/cv/classification/mobilenetv2/pytorch/run_train.py index 1aa016e1a..651a35d54 100644 --- a/cv/classification/mobilenetv2/pytorch/run_train.py +++ b/cv/classification/mobilenetv2/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/mobilenetv2/pytorch/train_mobilenet_v2_amp_dist.sh b/cv/classification/mobilenetv2/pytorch/train_mobilenet_v2_amp_dist.sh index 428e13b8f..f831b0596 100755 --- a/cv/classification/mobilenetv2/pytorch/train_mobilenet_v2_amp_dist.sh +++ b/cv/classification/mobilenetv2/pytorch/train_mobilenet_v2_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/mobilenetv3/pytorch/run_train.py b/cv/classification/mobilenetv3/pytorch/run_train.py index 1aa016e1a..651a35d54 100644 --- a/cv/classification/mobilenetv3/pytorch/run_train.py +++ b/cv/classification/mobilenetv3/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/mobilenetv3/pytorch/train_mobilenet_v3_large_amp_dist.sh b/cv/classification/mobilenetv3/pytorch/train_mobilenet_v3_large_amp_dist.sh index 65a0e7267..de9df76c0 100755 --- a/cv/classification/mobilenetv3/pytorch/train_mobilenet_v3_large_amp_dist.sh +++ b/cv/classification/mobilenetv3/pytorch/train_mobilenet_v3_large_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/resnest14/pytorch/run_train.py b/cv/classification/resnest14/pytorch/run_train.py index dfde2cdd7..26b53292b 100644 --- a/cv/classification/resnest14/pytorch/run_train.py +++ b/cv/classification/resnest14/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/resnest14/pytorch/train_resnest14_amp_dist.sh b/cv/classification/resnest14/pytorch/train_resnest14_amp_dist.sh index 345f648cf..982032a12 100755 --- a/cv/classification/resnest14/pytorch/train_resnest14_amp_dist.sh +++ b/cv/classification/resnest14/pytorch/train_resnest14_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/resnest269/pytorch/run_train.py b/cv/classification/resnest269/pytorch/run_train.py index cc230e0c3..b2248a261 100644 --- a/cv/classification/resnest269/pytorch/run_train.py +++ b/cv/classification/resnest269/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/resnest269/pytorch/train_resnest269_amp_dist.sh b/cv/classification/resnest269/pytorch/train_resnest269_amp_dist.sh index 32f2cca39..c3d54bd5c 100755 --- a/cv/classification/resnest269/pytorch/train_resnest269_amp_dist.sh +++ b/cv/classification/resnest269/pytorch/train_resnest269_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/resnet101/pytorch/run_train.py b/cv/classification/resnet101/pytorch/run_train.py index f3547a995..6478ad205 100644 --- a/cv/classification/resnet101/pytorch/run_train.py +++ b/cv/classification/resnet101/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/resnet101/pytorch/train_resnet101_amp_dist.sh b/cv/classification/resnet101/pytorch/train_resnet101_amp_dist.sh index fbf798358..660339e46 100755 --- a/cv/classification/resnet101/pytorch/train_resnet101_amp_dist.sh +++ b/cv/classification/resnet101/pytorch/train_resnet101_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/resnet152/pytorch/run_train.py b/cv/classification/resnet152/pytorch/run_train.py index 591680f0f..7fde4058f 100644 --- a/cv/classification/resnet152/pytorch/run_train.py +++ b/cv/classification/resnet152/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/resnet152/pytorch/train_resnet152_amp_dist.sh b/cv/classification/resnet152/pytorch/train_resnet152_amp_dist.sh index b38fd6832..cf49b3aec 100755 --- a/cv/classification/resnet152/pytorch/train_resnet152_amp_dist.sh +++ b/cv/classification/resnet152/pytorch/train_resnet152_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/resnet18/pytorch/run_train.py b/cv/classification/resnet18/pytorch/run_train.py index f3547a995..6478ad205 100644 --- a/cv/classification/resnet18/pytorch/run_train.py +++ b/cv/classification/resnet18/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/resnet18/pytorch/train_resnet18_amp_dist.sh b/cv/classification/resnet18/pytorch/train_resnet18_amp_dist.sh index c3f2a9542..67a918085 100755 --- a/cv/classification/resnet18/pytorch/train_resnet18_amp_dist.sh +++ b/cv/classification/resnet18/pytorch/train_resnet18_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/resnext101_32x8d/pytorch/run_train.py b/cv/classification/resnext101_32x8d/pytorch/run_train.py index 591680f0f..7fde4058f 100644 --- a/cv/classification/resnext101_32x8d/pytorch/run_train.py +++ b/cv/classification/resnext101_32x8d/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/resnext101_32x8d/pytorch/train_resnext101_32x8d_amp_dist.sh b/cv/classification/resnext101_32x8d/pytorch/train_resnext101_32x8d_amp_dist.sh index 3e1837e57..e8fddf3bc 100755 --- a/cv/classification/resnext101_32x8d/pytorch/train_resnext101_32x8d_amp_dist.sh +++ b/cv/classification/resnext101_32x8d/pytorch/train_resnext101_32x8d_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/resnext50_32x4d/pytorch/run_train.py b/cv/classification/resnext50_32x4d/pytorch/run_train.py index 6d4bff839..fdadf331a 100644 --- a/cv/classification/resnext50_32x4d/pytorch/run_train.py +++ b/cv/classification/resnext50_32x4d/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/resnext50_32x4d/pytorch/train_resnext50_32x4d_amp_dist.sh b/cv/classification/resnext50_32x4d/pytorch/train_resnext50_32x4d_amp_dist.sh index d9604d00c..e756bae11 100755 --- a/cv/classification/resnext50_32x4d/pytorch/train_resnext50_32x4d_amp_dist.sh +++ b/cv/classification/resnext50_32x4d/pytorch/train_resnext50_32x4d_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/seresnext/pytorch/run_train.py b/cv/classification/seresnext/pytorch/run_train.py index 171d5fea5..35729dda9 100644 --- a/cv/classification/seresnext/pytorch/run_train.py +++ b/cv/classification/seresnext/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/seresnext/pytorch/train_seresnext101_32x4d_amp_dist.sh b/cv/classification/seresnext/pytorch/train_seresnext101_32x4d_amp_dist.sh index 7311b6d23..4331899a4 100755 --- a/cv/classification/seresnext/pytorch/train_seresnext101_32x4d_amp_dist.sh +++ b/cv/classification/seresnext/pytorch/train_seresnext101_32x4d_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/shufflenetv2/pytorch/run_train.py b/cv/classification/shufflenetv2/pytorch/run_train.py index 1aa016e1a..651a35d54 100644 --- a/cv/classification/shufflenetv2/pytorch/run_train.py +++ b/cv/classification/shufflenetv2/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/shufflenetv2/pytorch/train_shufflenet_v2_x2_0_amp_dist.sh b/cv/classification/shufflenetv2/pytorch/train_shufflenet_v2_x2_0_amp_dist.sh index 55a70ac25..0f14673ba 100755 --- a/cv/classification/shufflenetv2/pytorch/train_shufflenet_v2_x2_0_amp_dist.sh +++ b/cv/classification/shufflenetv2/pytorch/train_shufflenet_v2_x2_0_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/vgg/pytorch/run_train.py b/cv/classification/vgg/pytorch/run_train.py index 1aa016e1a..651a35d54 100644 --- a/cv/classification/vgg/pytorch/run_train.py +++ b/cv/classification/vgg/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/vgg/pytorch/train_vgg16_amp_dist.sh b/cv/classification/vgg/pytorch/train_vgg16_amp_dist.sh index 4fa6953da..3a2cc5ec3 100755 --- a/cv/classification/vgg/pytorch/train_vgg16_amp_dist.sh +++ b/cv/classification/vgg/pytorch/train_vgg16_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then diff --git a/cv/classification/wide_resnet101_2/pytorch/run_train.py b/cv/classification/wide_resnet101_2/pytorch/run_train.py index 1aa016e1a..651a35d54 100644 --- a/cv/classification/wide_resnet101_2/pytorch/run_train.py +++ b/cv/classification/wide_resnet101_2/pytorch/run_train.py @@ -1,4 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import sys diff --git a/cv/classification/wide_resnet101_2/pytorch/train_wide_resnet101_2_amp_dist.sh b/cv/classification/wide_resnet101_2/pytorch/train_wide_resnet101_2_amp_dist.sh index b7eefdb17..c6d5265ce 100755 --- a/cv/classification/wide_resnet101_2/pytorch/train_wide_resnet101_2_amp_dist.sh +++ b/cv/classification/wide_resnet101_2/pytorch/train_wide_resnet101_2_amp_dist.sh @@ -1,11 +1,17 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. -# Copyright Declaration: This software, including all of its code and documentation, -# except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX -# Semiconductor Co., Ltd. and its affiliates ("Iluvatar CoreX") in accordance with the PRC Copyright -# Law and relevant international treaties, and all rights contained therein are enjoyed by Iluvatar -# CoreX. No user of this software shall have any right, ownership or interest in this software and -# any use of this software shall be in compliance with the terms and conditions of the End User -# License Agreement. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then -- Gitee From d817186a0ef7904f3d0c6c44a5adb4bb75ebe910 Mon Sep 17 00:00:00 2001 From: "wenfeng.zhang" Date: Fri, 2 Dec 2022 16:09:16 +0800 Subject: [PATCH 09/10] add license for remain model --- cv/classification/acmix/pytorch/run.sh | 14 ++++++++++++++ cv/classification/wavemlp/pytorch/run.sh | 14 ++++++++++++++ cv/detection/centernet/pytorch/src/run.sh | 14 ++++++++++++++ .../pytorch/start_scripts/get_num_devices.sh | 15 ++++++++++++++- .../pytorch/start_scripts/init_torch.sh | 15 ++++++++++++++- .../train_fasterrcnn_resnet50_amp_dist_torch.sh | 14 ++++++++++++++ .../train_fasterrcnn_resnet50_amp_torch.sh | 14 ++++++++++++++ .../train_fasterrcnn_resnet50_dist_torch.sh | 14 ++++++++++++++ .../train_fasterrcnn_resnet50_torch.sh | 15 ++++++++++++++- .../maskrcnn/pytorch/download_dataset.sh | 15 ++++++++++++++- cv/detection/maskrcnn/pytorch/run_4cards.sh | 14 ++++++++++++++ cv/detection/maskrcnn/pytorch/run_8cards.sh | 14 ++++++++++++++ cv/detection/maskrcnn/pytorch/run_and_time.sh | 15 ++++++++++++++- cv/detection/maskrcnn/pytorch/run_single.sh | 14 ++++++++++++++ cv/detection/pvanet/pytorch/model/pvanet.py | 14 ++++++++++++++ cv/detection/pvanet/pytorch/train.py | 16 +++++++++++++++- .../pvanet/pytorch/train_pvanet_dist.sh | 14 ++++++++++++++ cv/detection/ssd/pytorch/base/run_training.sh | 15 ++++++++++++++- .../ssd/pytorch/base/run_with_docker.sh | 14 ++++++++++++++ cv/detection/ssd/pytorch/iluvatar/reset.sh | 15 ++++++++++++++- cv/detection/yolov5/pytorch/get_num_devices.sh | 15 ++++++++++++++- .../yolov5/pytorch/run_dist_training.sh | 15 ++++++++++++++- cv/detection/yolov5/pytorch/run_inference.sh | 15 ++++++++++++++- cv/detection/yolov5/pytorch/run_training.sh | 15 ++++++++++++++- cv/point_cloud/Point-BERT/pytorch/prepare.sh | 14 ++++++++++++++ .../fcn/pytorch/train_fcn_r50_dist.sh | 14 ++++++++++++++ .../gcnet/pytorch/mmcv/cnn/__init__.py | 14 ++++++++++++++ .../gcnet/pytorch/mmcv/cnn/bricks/__init__.py | 14 ++++++++++++++ .../gcnet/pytorch/mmcv/ops/__init__.py | 14 ++++++++++++++ .../gcnet/pytorch/mmseg/apis/__init__.py | 14 ++++++++++++++ .../gcnet/pytorch/mmseg/datasets/__init__.py | 14 ++++++++++++++ .../pytorch/mmseg/models/backbones/__init__.py | 14 ++++++++++++++ .../mmseg/models/decode_heads/__init__.py | 17 ++++++++++++++++- .../pytorch/mmseg/models/losses/__init__.py | 15 +++++++++++++++ .../pytorch/mmseg/models/segmentors/__init__.py | 15 +++++++++++++++ .../gcnet/pytorch/run_train.sh | 14 ++++++++++++++ .../ocrnet/pytorch/train.sh | 13 +++++++++++++ .../ocrnet/pytorch/train_distx2.sh | 13 +++++++++++++ .../ocrnet/pytorch/train_distx4.sh | 13 +++++++++++++ .../ocrnet/pytorch/train_distx8.sh | 13 +++++++++++++ .../pspnet/pytorch/train.sh | 14 ++++++++++++++ .../pspnet/pytorch/train_dist.sh | 14 ++++++++++++++ .../unet3d/pytorch/prepare.sh | 15 ++++++++++++++- .../unet3d/pytorch/train.sh | 14 ++++++++++++++ .../unet3d/pytorch/train_dist.sh | 14 ++++++++++++++ cv/tracking/fairmot/pytorch/src/lib/logger.py | 14 ++++++++++++++ cv/tracking/fairmot/pytorch/src/lib/opts.py | 16 +++++++++++++++- .../pytorch/src/lib/trains/base_trainer.py | 14 ++++++++++++++ cv/tracking/fairmot/pytorch/src/train.py | 16 +++++++++++++++- .../fairmot/pytorch/train_dla34_mot17.sh | 15 ++++++++++++++- .../fairmot/pytorch/train_hrnet18_mot17.sh | 15 ++++++++++++++- .../fairmot/pytorch/train_hrnet32_mot17.sh | 14 ++++++++++++++ .../pytorch/clip/Linear_probe_evaluation.py | 14 ++++++++++++++ .../clip/pytorch/clip/test.py | 14 ++++++++++++++ .../pytorch/clip/zero_shot_prediction_top1.py | 14 ++++++++++++++ .../pytorch/clip/zero_shot_prediction_top5.py | 14 ++++++++++++++ .../GLMForMultiTokenCloze/base/bind_pyt.py | 2 ++ .../base/build_container.sh | 14 ++++++++++++++ .../GLMForMultiTokenCloze/base/prepare.py | 14 ++++++++++++++ .../base/prepare_environment.sh | 14 ++++++++++++++ .../GLMForMultiTokenCloze/base/preparedata.sh | 14 ++++++++++++++ .../pytorch/GLMForMultiTokenCloze/base/run.sh | 14 ++++++++++++++ .../base/run_pretraining.py | 14 ++++++++++++++ .../GLMForMultiTokenCloze/base/run_training.sh | 15 ++++++++++++++- .../base/run_with_docker.sh | 14 ++++++++++++++ .../pytorch/GLMForMultiTokenCloze/base/setup.py | 14 ++++++++++++++ .../nvidia/config/config_V100sx1x1.py | 14 ++++++++++++++ .../nvidia/config/config_V100sx1x8.py | 14 ++++++++++++++ .../nvidia/config/config_V100sx2x8.py | 14 ++++++++++++++ .../nvidia/config/converter.py | 14 ++++++++++++++ .../nvidia/config/create_optimizer.py | 14 ++++++++++++++ .../nvidia/config/environment_variables.sh | 14 ++++++++++++++ .../nvidia/config/nvidia_layers/layernorm.py | 14 ++++++++++++++ .../nvidia/config/nvidia_layers/transformer.py | 14 ++++++++++++++ .../config/nvidia_layers/transformer_block.py | 14 ++++++++++++++ .../nvidia/config/training_event.py | 14 ++++++++++++++ .../nvidia/config/unit_test/layer_norm/test.py | 14 ++++++++++++++ .../config/unit_test/layer_norm/test_fp16.py | 14 ++++++++++++++ .../cpm/pytorch/base/bind_pyt.py | 2 ++ .../cpm/pytorch/base/cleanup_image_container.sh | 15 ++++++++++++++- .../cpm/pytorch/base/config/__init__.py | 14 ++++++++++++++ .../cpm/pytorch/base/config/_base.py | 14 ++++++++++++++ .../cpm/pytorch/base/config/config_manager.py | 14 ++++++++++++++ .../cpm/pytorch/base/config/mutable_params.py | 14 ++++++++++++++ .../convert_to_medium_from_large.py | 14 ++++++++++++++ .../pytorch/base/model/models/gpt2_modeling.py | 2 ++ .../cpm/pytorch/base/optimizers/__init__.py | 14 ++++++++++++++ .../cpm/pytorch/base/optimizers/factory.py | 14 ++++++++++++++ .../cpm/pytorch/base/prepare.py | 14 ++++++++++++++ .../cpm/pytorch/base/run_training.sh | 15 ++++++++++++++- .../cpm/pytorch/base/run_with_docker.sh | 15 ++++++++++++++- .../cpm/pytorch/base/schedulers/__init__.py | 14 ++++++++++++++ .../cpm/pytorch/base/schedulers/factory.py | 14 ++++++++++++++ .../pytorch/base/schedulers/learning_rates.py | 2 ++ .../cpm/pytorch/base/train/evaluator.py | 14 ++++++++++++++ .../cpm/pytorch/base/train/event/__init__.py | 14 ++++++++++++++ .../cpm/pytorch/base/train/event/base.py | 14 ++++++++++++++ .../pytorch/base/train/event/base_adapter.py | 14 ++++++++++++++ .../cpm/pytorch/base/train/event/compose.py | 14 ++++++++++++++ .../cpm/pytorch/base/train/event/log.py | 14 ++++++++++++++ .../cpm/pytorch/base/train/metrics.py | 14 ++++++++++++++ .../cpm/pytorch/base/train/training_state.py | 14 ++++++++++++++ .../t5/pytorch/examples_ix/init_torch.sh | 14 ++++++++++++++ .../train_t5_small_amp_dist_torch.sh | 14 ++++++++++++++ .../examples_ix/train_t5_small_amp_torch.sh | 14 ++++++++++++++ .../examples_ix/train_t5_small_dist_torch.sh | 14 ++++++++++++++ .../pytorch/examples_ix/train_t5_small_torch.sh | 14 ++++++++++++++ .../ctr/dlrm/pytorch/scripts/dist_train.py | 14 ++++++++++++++ 108 files changed, 1467 insertions(+), 22 deletions(-) diff --git a/cv/classification/acmix/pytorch/run.sh b/cv/classification/acmix/pytorch/run.sh index 8041c1e23..71a65f586 100644 --- a/cv/classification/acmix/pytorch/run.sh +++ b/cv/classification/acmix/pytorch/run.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. NGPU=$1 CONFIG=$2 DATA_PATH=$3 diff --git a/cv/classification/wavemlp/pytorch/run.sh b/cv/classification/wavemlp/pytorch/run.sh index b47bf6f59..6120235e3 100644 --- a/cv/classification/wavemlp/pytorch/run.sh +++ b/cv/classification/wavemlp/pytorch/run.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. DATA_PATH=$1 python3 -m torch.distributed.launch --nproc_per_node 8 --nnodes=1 --node_rank=0 train.py \ diff --git a/cv/detection/centernet/pytorch/src/run.sh b/cv/detection/centernet/pytorch/src/run.sh index 04e307371..2159de0c5 100644 --- a/cv/detection/centernet/pytorch/src/run.sh +++ b/cv/detection/centernet/pytorch/src/run.sh @@ -1 +1,15 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. python3 main.py ctdet --batch_size 128 --master_batch 60 --lr 1.25e-4 --gpus 0,1,2,3,4,5,6,7 diff --git a/cv/detection/fasterrcnn/pytorch/start_scripts/get_num_devices.sh b/cv/detection/fasterrcnn/pytorch/start_scripts/get_num_devices.sh index f0701ce8d..5fac573bb 100644 --- a/cv/detection/fasterrcnn/pytorch/start_scripts/get_num_devices.sh +++ b/cv/detection/fasterrcnn/pytorch/start_scripts/get_num_devices.sh @@ -1,5 +1,18 @@ #!/bin/bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. devices=$CUDA_VISIBLE_DEVICES if [ -n "$devices" ]; then _devices=(${devices//,/ }) diff --git a/cv/detection/fasterrcnn/pytorch/start_scripts/init_torch.sh b/cv/detection/fasterrcnn/pytorch/start_scripts/init_torch.sh index 1c2d7f9ec..686347477 100644 --- a/cv/detection/fasterrcnn/pytorch/start_scripts/init_torch.sh +++ b/cv/detection/fasterrcnn/pytorch/start_scripts/init_torch.sh @@ -1,3 +1,16 @@ #!/bin/bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. pip3 install pycocotools \ No newline at end of file diff --git a/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_amp_dist_torch.sh b/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_amp_dist_torch.sh index 219de7faf..15ce8d393 100644 --- a/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_amp_dist_torch.sh +++ b/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_amp_dist_torch.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. source get_num_devices.sh export DRT_MEMCPYUSEKERNEL=20000000000 diff --git a/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_amp_torch.sh b/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_amp_torch.sh index 391e59ff1..8adb38e19 100644 --- a/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_amp_torch.sh +++ b/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_amp_torch.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. export PYTORCH_DISABLE_VEC_KERNEL=1 export PT_USE_CUDNN_BATCHNORM_SPATIAL_PERSISTENT=1 CUDA_VISIBLE_DEVICES=0 python3 ../train.py \ diff --git a/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_dist_torch.sh b/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_dist_torch.sh index 09da5f900..57131a89f 100644 --- a/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_dist_torch.sh +++ b/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_dist_torch.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. source get_num_devices.sh export DRT_MEMCPYUSEKERNEL=20000000000 diff --git a/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_torch.sh b/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_torch.sh index af41ff45b..3d30264f3 100644 --- a/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_torch.sh +++ b/cv/detection/fasterrcnn/pytorch/start_scripts/train_fasterrcnn_resnet50_torch.sh @@ -1,4 +1,17 @@ - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. CUDA_VISIBLE_DEVICES=0 python3 ../train.py \ --data-path /home/datasets/cv/coco \ --dataset coco \ diff --git a/cv/detection/maskrcnn/pytorch/download_dataset.sh b/cv/detection/maskrcnn/pytorch/download_dataset.sh index f16972b15..e7b62a3df 100644 --- a/cv/detection/maskrcnn/pytorch/download_dataset.sh +++ b/cv/detection/maskrcnn/pytorch/download_dataset.sh @@ -1,5 +1,18 @@ #!/bin/bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # Get COCO 2017 data sets mkdir -p datasets/coco pushd datasets/coco diff --git a/cv/detection/maskrcnn/pytorch/run_4cards.sh b/cv/detection/maskrcnn/pytorch/run_4cards.sh index 6ab74c4d9..365389a6e 100644 --- a/cv/detection/maskrcnn/pytorch/run_4cards.sh +++ b/cv/detection/maskrcnn/pytorch/run_4cards.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. export NGPUS=4 export CUDA_VISIBLE_DEVICES=4,5,6,7 python3 -m torch.distributed.launch --nproc_per_node=$NGPUS tools/train_mlperf.py --config-file "configs/e2e_mask_rcnn_R_50_FPN_1x.yaml" SOLVER.IMS_PER_BATCH 8 TEST.IMS_PER_BATCH 4 SOLVER.MAX_ITER 180000 SOLVER.STEPS "(120000, 160000)" SOLVER.BASE_LR 0.01 diff --git a/cv/detection/maskrcnn/pytorch/run_8cards.sh b/cv/detection/maskrcnn/pytorch/run_8cards.sh index cf8e43fe6..581d0c803 100644 --- a/cv/detection/maskrcnn/pytorch/run_8cards.sh +++ b/cv/detection/maskrcnn/pytorch/run_8cards.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. export NGPUS=8 export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 -m torch.distributed.launch --nproc_per_node=$NGPUS tools/train_mlperf.py --config-file "configs/e2e_mask_rcnn_R_50_FPN_1x.yaml" diff --git a/cv/detection/maskrcnn/pytorch/run_and_time.sh b/cv/detection/maskrcnn/pytorch/run_and_time.sh index f8526534b..8e28849e7 100644 --- a/cv/detection/maskrcnn/pytorch/run_and_time.sh +++ b/cv/detection/maskrcnn/pytorch/run_and_time.sh @@ -1,5 +1,18 @@ #!/bin/bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # Runs benchmark and reports time to convergence pushd pytorch diff --git a/cv/detection/maskrcnn/pytorch/run_single.sh b/cv/detection/maskrcnn/pytorch/run_single.sh index 7de8b53e3..afb1bb004 100644 --- a/cv/detection/maskrcnn/pytorch/run_single.sh +++ b/cv/detection/maskrcnn/pytorch/run_single.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. CUDA_VISIBLE_DEVICES=7 python3 tools/train_mlperf.py --config-file "configs/e2e_mask_rcnn_R_50_FPN_1x.yaml" \ SOLVER.IMS_PER_BATCH 2 TEST.IMS_PER_BATCH 1 SOLVER.MAX_ITER 720000 \ SOLVER.STEPS "(480000, 640000)" SOLVER.BASE_LR 0.0025 diff --git a/cv/detection/pvanet/pytorch/model/pvanet.py b/cv/detection/pvanet/pytorch/model/pvanet.py index c1ebeb5b4..912d25cfc 100755 --- a/cv/detection/pvanet/pytorch/model/pvanet.py +++ b/cv/detection/pvanet/pytorch/model/pvanet.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. #!/usr/bin/env python # coding=utf-8 diff --git a/cv/detection/pvanet/pytorch/train.py b/cv/detection/pvanet/pytorch/train.py index 6da8bf9d4..33c30ee9b 100755 --- a/cv/detection/pvanet/pytorch/train.py +++ b/cv/detection/pvanet/pytorch/train.py @@ -1,5 +1,19 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + r"""PyTorch Detection Training. diff --git a/cv/detection/pvanet/pytorch/train_pvanet_dist.sh b/cv/detection/pvanet/pytorch/train_pvanet_dist.sh index 3cbef8816..0daaeb4b7 100755 --- a/cv/detection/pvanet/pytorch/train_pvanet_dist.sh +++ b/cv/detection/pvanet/pytorch/train_pvanet_dist.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. CURRENT_DIR=$(cd `dirname $0`; pwd) ROOT_DIR=${CURRENT_DIR} diff --git a/cv/detection/ssd/pytorch/base/run_training.sh b/cv/detection/ssd/pytorch/base/run_training.sh index f68cd9047..94ab4b9c4 100644 --- a/cv/detection/ssd/pytorch/base/run_training.sh +++ b/cv/detection/ssd/pytorch/base/run_training.sh @@ -1,5 +1,18 @@ #!/bin/bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. get_lscpu_value() { awk -F: "(\$1 == \"${1}\"){gsub(/ /, \"\", \$2); print \$2; found=1} END{exit found!=1}" } diff --git a/cv/detection/ssd/pytorch/base/run_with_docker.sh b/cv/detection/ssd/pytorch/base/run_with_docker.sh index a461673f1..5ac6404b7 100644 --- a/cv/detection/ssd/pytorch/base/run_with_docker.sh +++ b/cv/detection/ssd/pytorch/base/run_with_docker.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # ================================================= # Constants # ================================================= diff --git a/cv/detection/ssd/pytorch/iluvatar/reset.sh b/cv/detection/ssd/pytorch/iluvatar/reset.sh index 73bf0ac8e..0380b4762 100644 --- a/cv/detection/ssd/pytorch/iluvatar/reset.sh +++ b/cv/detection/ssd/pytorch/iluvatar/reset.sh @@ -1,5 +1,18 @@ #!/bin/bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # clean cache for host memory echo 3 > /proc/sys/vm/drop_caches diff --git a/cv/detection/yolov5/pytorch/get_num_devices.sh b/cv/detection/yolov5/pytorch/get_num_devices.sh index e28edae74..9c37beae6 100644 --- a/cv/detection/yolov5/pytorch/get_num_devices.sh +++ b/cv/detection/yolov5/pytorch/get_num_devices.sh @@ -1,5 +1,18 @@ #!/bin/bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. devices=$CUDA_VISIBLE_DEVICES if [ -n "$devices" ]; then _devices=(${devices//,/ }) diff --git a/cv/detection/yolov5/pytorch/run_dist_training.sh b/cv/detection/yolov5/pytorch/run_dist_training.sh index 888dc8a2a..bb7766a2d 100644 --- a/cv/detection/yolov5/pytorch/run_dist_training.sh +++ b/cv/detection/yolov5/pytorch/run_dist_training.sh @@ -1,3 +1,16 @@ #!/bin/bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. python3 -m torch.distributed.launch --nproc_per_node 8 train.py --data ./data/coco.yaml --batch-size 128 --cfg ./models/yolov5s.yaml --device 0,1,2,3,4,5,6,7 diff --git a/cv/detection/yolov5/pytorch/run_inference.sh b/cv/detection/yolov5/pytorch/run_inference.sh index 7ead2f84a..23a092df8 100644 --- a/cv/detection/yolov5/pytorch/run_inference.sh +++ b/cv/detection/yolov5/pytorch/run_inference.sh @@ -1,3 +1,16 @@ #!/bin/bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. python3 test.py --task val --data data/coco.yaml --weights weights/yolov5s.pt 2>&1 | tee inferencelog.log; diff --git a/cv/detection/yolov5/pytorch/run_training.sh b/cv/detection/yolov5/pytorch/run_training.sh index 9003f464c..8b92c09c9 100644 --- a/cv/detection/yolov5/pytorch/run_training.sh +++ b/cv/detection/yolov5/pytorch/run_training.sh @@ -1,3 +1,16 @@ #!/bin/bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. python3 train.py --data ./data/coco.yaml --batch-size 32 --cfg ./models/yolov5s.yaml diff --git a/cv/point_cloud/Point-BERT/pytorch/prepare.sh b/cv/point_cloud/Point-BERT/pytorch/prepare.sh index f6d3cafdf..ed751a09e 100644 --- a/cv/point_cloud/Point-BERT/pytorch/prepare.sh +++ b/cv/point_cloud/Point-BERT/pytorch/prepare.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. set -euox pipefail diff --git a/cv/semantic_segmentation/fcn/pytorch/train_fcn_r50_dist.sh b/cv/semantic_segmentation/fcn/pytorch/train_fcn_r50_dist.sh index 015b08728..8c7871c8a 100644 --- a/cv/semantic_segmentation/fcn/pytorch/train_fcn_r50_dist.sh +++ b/cv/semantic_segmentation/fcn/pytorch/train_fcn_r50_dist.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. CURRENT_DIR=$(cd `dirname $0`; pwd) ROOT_DIR=${CURRENT_DIR}/../../torchvision/pytorch diff --git a/cv/semantic_segmentation/gcnet/pytorch/mmcv/cnn/__init__.py b/cv/semantic_segmentation/gcnet/pytorch/mmcv/cnn/__init__.py index 5d912b0ae..285e49012 100755 --- a/cv/semantic_segmentation/gcnet/pytorch/mmcv/cnn/__init__.py +++ b/cv/semantic_segmentation/gcnet/pytorch/mmcv/cnn/__init__.py @@ -1,4 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # from .alexnet import AlexNet # yapf: disable from .bricks import (ACTIVATION_LAYERS, CONV_LAYERS, NORM_LAYERS, diff --git a/cv/semantic_segmentation/gcnet/pytorch/mmcv/cnn/bricks/__init__.py b/cv/semantic_segmentation/gcnet/pytorch/mmcv/cnn/bricks/__init__.py index 010192090..6e416f88c 100755 --- a/cv/semantic_segmentation/gcnet/pytorch/mmcv/cnn/bricks/__init__.py +++ b/cv/semantic_segmentation/gcnet/pytorch/mmcv/cnn/bricks/__init__.py @@ -1,4 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from .activation import build_activation_layer from .context_block import ContextBlock from .conv import build_conv_layer diff --git a/cv/semantic_segmentation/gcnet/pytorch/mmcv/ops/__init__.py b/cv/semantic_segmentation/gcnet/pytorch/mmcv/ops/__init__.py index 7fb3cec0b..91c9e4ee3 100755 --- a/cv/semantic_segmentation/gcnet/pytorch/mmcv/ops/__init__.py +++ b/cv/semantic_segmentation/gcnet/pytorch/mmcv/ops/__init__.py @@ -1,4 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # from .assign_score_withk import assign_score_withk # from .ball_query import ball_query # from .bbox import bbox_overlaps diff --git a/cv/semantic_segmentation/gcnet/pytorch/mmseg/apis/__init__.py b/cv/semantic_segmentation/gcnet/pytorch/mmseg/apis/__init__.py index 2283f2807..955aba666 100755 --- a/cv/semantic_segmentation/gcnet/pytorch/mmseg/apis/__init__.py +++ b/cv/semantic_segmentation/gcnet/pytorch/mmseg/apis/__init__.py @@ -1,4 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # from .inference import inference_segmentor, init_segmentor, show_result_pyplot from .test import multi_gpu_test, single_gpu_test from .train import (get_root_logger, init_random_seed, set_random_seed, diff --git a/cv/semantic_segmentation/gcnet/pytorch/mmseg/datasets/__init__.py b/cv/semantic_segmentation/gcnet/pytorch/mmseg/datasets/__init__.py index 00f9996ec..a61d7c98f 100755 --- a/cv/semantic_segmentation/gcnet/pytorch/mmseg/datasets/__init__.py +++ b/cv/semantic_segmentation/gcnet/pytorch/mmseg/datasets/__init__.py @@ -1,4 +1,18 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # from .ade import ADE20KDataset from .builder import DATASETS, PIPELINES, build_dataloader, build_dataset #from .chase_db1 import ChaseDB1Dataset diff --git a/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/backbones/__init__.py b/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/backbones/__init__.py index fbe3f688f..0b0fc9109 100755 --- a/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/backbones/__init__.py +++ b/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/backbones/__init__.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # from .resnest import ResNeSt from .resnet import ResNet, ResNetV1c, ResNetV1d # from .resnext import ResNeXt diff --git a/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/decode_heads/__init__.py b/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/decode_heads/__init__.py index a4febc4e7..1b4fb2c03 100755 --- a/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/decode_heads/__init__.py +++ b/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/decode_heads/__init__.py @@ -1,4 +1,19 @@ -# # Copyright (c) OpenMMLab. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# Copyright (c) OpenMMLab. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + # from .ann_head import ANNHead # from .apc_head import APCHead # from .aspp_head import ASPPHead diff --git a/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/losses/__init__.py b/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/losses/__init__.py index 50994f5fa..c01bb549f 100755 --- a/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/losses/__init__.py +++ b/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/losses/__init__.py @@ -1,4 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + from .accuracy import Accuracy, accuracy from .cross_entropy_loss import (CrossEntropyLoss, binary_cross_entropy, cross_entropy, mask_cross_entropy) diff --git a/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/segmentors/__init__.py b/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/segmentors/__init__.py index 607685bae..f58df7590 100755 --- a/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/segmentors/__init__.py +++ b/cv/semantic_segmentation/gcnet/pytorch/mmseg/models/segmentors/__init__.py @@ -1,4 +1,19 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + from .base import BaseSegmentor # from .cascade_encoder_decoder import CascadeEncoderDecoder from .encoder_decoder import EncoderDecoder diff --git a/cv/semantic_segmentation/gcnet/pytorch/run_train.sh b/cv/semantic_segmentation/gcnet/pytorch/run_train.sh index 6462040c9..d24e020e1 100755 --- a/cv/semantic_segmentation/gcnet/pytorch/run_train.sh +++ b/cv/semantic_segmentation/gcnet/pytorch/run_train.sh @@ -1 +1,15 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. python3 train.py configs/gcnet/gcnet_r50-d8_769x769_40k_cityscapes.py diff --git a/cv/semantic_segmentation/ocrnet/pytorch/train.sh b/cv/semantic_segmentation/ocrnet/pytorch/train.sh index 9554de162..2cc6f260b 100644 --- a/cv/semantic_segmentation/ocrnet/pytorch/train.sh +++ b/cv/semantic_segmentation/ocrnet/pytorch/train.sh @@ -1,4 +1,17 @@ # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. python3 tools/train.py --cfg experiments/cityscapes/seg_hrnet_w48_train_512x1024_sgd_lr1e-2_wd5e-4_bs_12_epoch484x1.yaml diff --git a/cv/semantic_segmentation/ocrnet/pytorch/train_distx2.sh b/cv/semantic_segmentation/ocrnet/pytorch/train_distx2.sh index b64cff397..0cf881606 100644 --- a/cv/semantic_segmentation/ocrnet/pytorch/train_distx2.sh +++ b/cv/semantic_segmentation/ocrnet/pytorch/train_distx2.sh @@ -1,4 +1,17 @@ # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. GPU_NUMS=2 python3 -m torch.distributed.launch --nproc_per_node=$GPU_NUMS tools/train.py --cfg experiments/cityscapes/seg_hrnet_w48_train_512x1024_sgd_lr1e-2_wd5e-4_bs_12_epoch484x2.yaml diff --git a/cv/semantic_segmentation/ocrnet/pytorch/train_distx4.sh b/cv/semantic_segmentation/ocrnet/pytorch/train_distx4.sh index fbf6e4e5a..81aed3532 100644 --- a/cv/semantic_segmentation/ocrnet/pytorch/train_distx4.sh +++ b/cv/semantic_segmentation/ocrnet/pytorch/train_distx4.sh @@ -1,4 +1,17 @@ # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. GPU_NUMS=4 python3 -m torch.distributed.launch --nproc_per_node=$GPU_NUMS tools/train.py --cfg experiments/cityscapes/seg_hrnet_w48_train_512x1024_sgd_lr1e-2_wd5e-4_bs_12_epoch484.yaml diff --git a/cv/semantic_segmentation/ocrnet/pytorch/train_distx8.sh b/cv/semantic_segmentation/ocrnet/pytorch/train_distx8.sh index 70089fa55..ae06f0ced 100644 --- a/cv/semantic_segmentation/ocrnet/pytorch/train_distx8.sh +++ b/cv/semantic_segmentation/ocrnet/pytorch/train_distx8.sh @@ -1,4 +1,17 @@ # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. GPU_NUMS=8 python3 -m torch.distributed.launch --nproc_per_node=$GPU_NUMS tools/train.py --cfg experiments/cityscapes/seg_hrnet_w48_train_512x1024_sgd_lr1e-2_wd5e-4_bs_12_epoch484x8.yaml diff --git a/cv/semantic_segmentation/pspnet/pytorch/train.sh b/cv/semantic_segmentation/pspnet/pytorch/train.sh index 88edd482c..82c28c20a 100644 --- a/cv/semantic_segmentation/pspnet/pytorch/train.sh +++ b/cv/semantic_segmentation/pspnet/pytorch/train.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. CONFIG=$1 PYTHONPATH="$(dirname $0)/..":$PYTHONPATH \ diff --git a/cv/semantic_segmentation/pspnet/pytorch/train_dist.sh b/cv/semantic_segmentation/pspnet/pytorch/train_dist.sh index b2b398a23..6c02b3a31 100644 --- a/cv/semantic_segmentation/pspnet/pytorch/train_dist.sh +++ b/cv/semantic_segmentation/pspnet/pytorch/train_dist.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. CONFIG=$1 GPUS=$2 NNODES=${NNODES:-1} diff --git a/cv/semantic_segmentation/unet3d/pytorch/prepare.sh b/cv/semantic_segmentation/unet3d/pytorch/prepare.sh index 70c820796..a38a531d4 100644 --- a/cv/semantic_segmentation/unet3d/pytorch/prepare.sh +++ b/cv/semantic_segmentation/unet3d/pytorch/prepare.sh @@ -1,5 +1,18 @@ #!/bin/bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. echo "prepare data..." git clone https://github.com/neheller/kits19 diff --git a/cv/semantic_segmentation/unet3d/pytorch/train.sh b/cv/semantic_segmentation/unet3d/pytorch/train.sh index c1a39324b..d501bf009 100644 --- a/cv/semantic_segmentation/unet3d/pytorch/train.sh +++ b/cv/semantic_segmentation/unet3d/pytorch/train.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. SEED=1234 MAX_EPOCHS=5000 QUALITY_THRESHOLD="0.908" diff --git a/cv/semantic_segmentation/unet3d/pytorch/train_dist.sh b/cv/semantic_segmentation/unet3d/pytorch/train_dist.sh index e622fbae4..554685f72 100644 --- a/cv/semantic_segmentation/unet3d/pytorch/train_dist.sh +++ b/cv/semantic_segmentation/unet3d/pytorch/train_dist.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. NUM_GPUS=$1 SEED=1234 diff --git a/cv/tracking/fairmot/pytorch/src/lib/logger.py b/cv/tracking/fairmot/pytorch/src/lib/logger.py index ab3aab366..b31e05cea 100644 --- a/cv/tracking/fairmot/pytorch/src/lib/logger.py +++ b/cv/tracking/fairmot/pytorch/src/lib/logger.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/cv/tracking/fairmot/pytorch/src/lib/opts.py b/cv/tracking/fairmot/pytorch/src/lib/opts.py index ba844f099..e6fe43c8d 100644 --- a/cv/tracking/fairmot/pytorch/src/lib/opts.py +++ b/cv/tracking/fairmot/pytorch/src/lib/opts.py @@ -1,5 +1,19 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) ifzhang. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + from __future__ import absolute_import from __future__ import division diff --git a/cv/tracking/fairmot/pytorch/src/lib/trains/base_trainer.py b/cv/tracking/fairmot/pytorch/src/lib/trains/base_trainer.py index b8d44e52e..374f5ccc2 100644 --- a/cv/tracking/fairmot/pytorch/src/lib/trains/base_trainer.py +++ b/cv/tracking/fairmot/pytorch/src/lib/trains/base_trainer.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/cv/tracking/fairmot/pytorch/src/train.py b/cv/tracking/fairmot/pytorch/src/train.py index 18a981d80..0832047ce 100644 --- a/cv/tracking/fairmot/pytorch/src/train.py +++ b/cv/tracking/fairmot/pytorch/src/train.py @@ -1,5 +1,19 @@ -# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) ifzhang. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + from __future__ import absolute_import from __future__ import division diff --git a/cv/tracking/fairmot/pytorch/train_dla34_mot17.sh b/cv/tracking/fairmot/pytorch/train_dla34_mot17.sh index 472d96aed..4645ac99a 100644 --- a/cv/tracking/fairmot/pytorch/train_dla34_mot17.sh +++ b/cv/tracking/fairmot/pytorch/train_dla34_mot17.sh @@ -1,5 +1,18 @@ #!/usr/bin/env bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. python3 -m torch.distributed.launch --nproc_per_node ${GPU_NUMS}\ src/train.py mot --exp_id mot17_dla34\ --data_cfg './src/lib/cfg/mot17.json' "$@" diff --git a/cv/tracking/fairmot/pytorch/train_hrnet18_mot17.sh b/cv/tracking/fairmot/pytorch/train_hrnet18_mot17.sh index 869473033..a78f48b41 100644 --- a/cv/tracking/fairmot/pytorch/train_hrnet18_mot17.sh +++ b/cv/tracking/fairmot/pytorch/train_hrnet18_mot17.sh @@ -1,5 +1,18 @@ #!/usr/bin/env bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. python3 -m torch.distributed.launch --nproc_per_node ${GPU_NUMS}\ ./src/train.py mot --exp_id mot17_hrnet18 --arch 'hrnet_18' \ --data_cfg './src/lib/cfg/mot17.json' \ diff --git a/cv/tracking/fairmot/pytorch/train_hrnet32_mot17.sh b/cv/tracking/fairmot/pytorch/train_hrnet32_mot17.sh index 3185931a5..297f26c87 100644 --- a/cv/tracking/fairmot/pytorch/train_hrnet32_mot17.sh +++ b/cv/tracking/fairmot/pytorch/train_hrnet32_mot17.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. python3 -m torch.distributed.launch --nproc_per_node ${GPU_NUMS}\ ./src/train.py mot --exp_id mot17_hrnet32 --arch 'hrnet_32' \ --data_cfg './src/lib/cfg/mot17.json' \ diff --git a/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/Linear_probe_evaluation.py b/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/Linear_probe_evaluation.py index 83a1068f3..1f87bd415 100644 --- a/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/Linear_probe_evaluation.py +++ b/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/Linear_probe_evaluation.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import clip import torch diff --git a/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/test.py b/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/test.py index 2d9a43674..a46306367 100644 --- a/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/test.py +++ b/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/test.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import torch import clip from PIL import Image diff --git a/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/zero_shot_prediction_top1.py b/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/zero_shot_prediction_top1.py index be6f915d2..97bfaf730 100644 --- a/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/zero_shot_prediction_top1.py +++ b/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/zero_shot_prediction_top1.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import clip import torch diff --git a/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/zero_shot_prediction_top5.py b/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/zero_shot_prediction_top5.py index d6ddadba5..7e5dc2ad4 100644 --- a/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/zero_shot_prediction_top5.py +++ b/multimodal/Language-Image_Pre-Training/clip/pytorch/clip/zero_shot_prediction_top5.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import clip import torch diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/bind_pyt.py b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/bind_pyt.py index 9264232f6..667cd83a6 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/bind_pyt.py +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/bind_pyt.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) 2019-2021 NVIDIA CORPORATION. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/build_container.sh b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/build_container.sh index f269ef63a..d549b1bf9 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/build_container.sh +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/build_container.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # ================================================= # Constants # ================================================= diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/prepare.py b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/prepare.py index f21d9415c..627044e46 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/prepare.py +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/prepare.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import shutil import subprocess diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/prepare_environment.sh b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/prepare_environment.sh index 1dcd85ab3..ecdc5c1ea 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/prepare_environment.sh +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/prepare_environment.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. set -euox pipefail ID=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"') diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/preparedata.sh b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/preparedata.sh index 5193cb0ca..1044c742c 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/preparedata.sh +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/preparedata.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. set -euox pipefail GLM_DATA_DIR=$1 diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run.sh b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run.sh index 77c96bec8..1fb59432c 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run.sh +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. set -euox pipefail current_path=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run_pretraining.py b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run_pretraining.py index f050f7399..9aa1fca5a 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run_pretraining.py +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run_pretraining.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import time import argparse import os diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run_training.sh b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run_training.sh index e300abc89..6a1e1a0a1 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run_training.sh +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run_training.sh @@ -1,5 +1,18 @@ #!/bin/bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. get_lscpu_value() { awk -F: "(\$1 == \"${1}\"){gsub(/ /, \"\", \$2); print \$2; found=1} END{exit found!=1}" } diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run_with_docker.sh b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run_with_docker.sh index e380854dd..b83622b8d 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run_with_docker.sh +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/run_with_docker.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # ================================================= # Constants # ================================================= diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/setup.py b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/setup.py index 7d40f3b61..9c963d169 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/setup.py +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/base/setup.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import glob import os import os.path as ospath diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/config_V100sx1x1.py b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/config_V100sx1x1.py index 31bc1df3f..b8a3736cf 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/config_V100sx1x1.py +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/config_V100sx1x1.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from training_event import DefaultTrainingEvent train_batch_size = 4 diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/config_V100sx1x8.py b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/config_V100sx1x8.py index 31bc1df3f..b8a3736cf 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/config_V100sx1x8.py +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/config_V100sx1x8.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from training_event import DefaultTrainingEvent train_batch_size = 4 diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/config_V100sx2x8.py b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/config_V100sx2x8.py index c94a8b881..d2a4e94d2 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/config_V100sx2x8.py +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/config_V100sx2x8.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from training_event import DefaultTrainingEvent train_batch_size = 4 diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/converter.py b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/converter.py index 80679a90c..733fb86a5 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/converter.py +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/converter.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import utils from nvidia_layers.transformer import GPT2Transformer diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/create_optimizer.py b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/create_optimizer.py index 7bcc99d3f..2ea20dfc6 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/create_optimizer.py +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/create_optimizer.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from optimizers import FP16_Optimizer,get_optimizer_param_groups from apex.optimizers import FusedAdam as Adam from utils import main_proc_print diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/environment_variables.sh b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/environment_variables.sh index e28aba1a3..2aee5e1f4 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/environment_variables.sh +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/environment_variables.sh @@ -1,6 +1,20 @@ # ================================================= # Export variables # ================================================= +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. export CONTAINER_MOUNTS="--gpus all" NVCC_ARGUMENTS="-U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_CONVERSIONS__ --expt-relaxed-constexpr -ftemplate-depth=1024 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_80,code=sm_80 -gencode=arch=compute_80,code=compute_80" diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/nvidia_layers/layernorm.py b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/nvidia_layers/layernorm.py index d748abfd0..9708be884 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/nvidia_layers/layernorm.py +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/nvidia_layers/layernorm.py @@ -1 +1,15 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from apex.normalization import FusedLayerNorm as LayerNorm \ No newline at end of file diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/nvidia_layers/transformer.py b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/nvidia_layers/transformer.py index 284f2aedd..9a43eb39b 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/nvidia_layers/transformer.py +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/nvidia_layers/transformer.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import torch import math diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/nvidia_layers/transformer_block.py b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/nvidia_layers/transformer_block.py index b91b123d8..bfdff5552 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/nvidia_layers/transformer_block.py +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/nvidia_layers/transformer_block.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import torch from model.layers.attention import SelfAttention diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/training_event.py b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/training_event.py index a3dccbadb..724bf5b8e 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/training_event.py +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/training_event.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import torch from train.event.base import BaseTrainingEventInterface diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/unit_test/layer_norm/test.py b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/unit_test/layer_norm/test.py index 3c3d21f26..21bdf3f3e 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/unit_test/layer_norm/test.py +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/unit_test/layer_norm/test.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from torch.nn import LayerNorm from apex.normalization import FusedLayerNorm import numpy as np diff --git a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/unit_test/layer_norm/test_fp16.py b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/unit_test/layer_norm/test_fp16.py index 4abd8f567..71e097a66 100644 --- a/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/unit_test/layer_norm/test_fp16.py +++ b/nlp/cloze_test/glm/pytorch/GLMForMultiTokenCloze/nvidia/config/unit_test/layer_norm/test_fp16.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from torch.nn import LayerNorm from apex.normalization import FusedLayerNorm import numpy as np diff --git a/nlp/dialogue_generation/cpm/pytorch/base/bind_pyt.py b/nlp/dialogue_generation/cpm/pytorch/base/bind_pyt.py index 5493d79be..3e799c850 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/bind_pyt.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/bind_pyt.py @@ -1,3 +1,5 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) 2019-2021 NVIDIA CORPORATION. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/nlp/dialogue_generation/cpm/pytorch/base/cleanup_image_container.sh b/nlp/dialogue_generation/cpm/pytorch/base/cleanup_image_container.sh index 29c22ddb4..e5d8a4fd0 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/cleanup_image_container.sh +++ b/nlp/dialogue_generation/cpm/pytorch/base/cleanup_image_container.sh @@ -1,5 +1,18 @@ #!/bin/bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # ================================================= # Constants # ================================================= diff --git a/nlp/dialogue_generation/cpm/pytorch/base/config/__init__.py b/nlp/dialogue_generation/cpm/pytorch/base/config/__init__.py index 258fb17d7..097d85a13 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/config/__init__.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/config/__init__.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from ._base import * from .config_manager import activate_config_env diff --git a/nlp/dialogue_generation/cpm/pytorch/base/config/_base.py b/nlp/dialogue_generation/cpm/pytorch/base/config/_base.py index 147d9ea8f..88ad09fd4 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/config/_base.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/config/_base.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from typing import ClassVar from train.event.base import BaseTrainingEventInterface diff --git a/nlp/dialogue_generation/cpm/pytorch/base/config/config_manager.py b/nlp/dialogue_generation/cpm/pytorch/base/config/config_manager.py index c30dfa3b7..3b69129d1 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/config/config_manager.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/config/config_manager.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import copy import importlib import inspect diff --git a/nlp/dialogue_generation/cpm/pytorch/base/config/mutable_params.py b/nlp/dialogue_generation/cpm/pytorch/base/config/mutable_params.py index 3e12a9e2f..36d0f7276 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/config/mutable_params.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/config/mutable_params.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. mutable_params = [ "fp16", "dist_backend", "gradient_accumulation_steps", "train_batch_size", "eval_batch_size", "max_steps", "max_samples_termination", "warmup", "warmup_steps", "lr_decay_iters", "learning_rate", "weight_decay_rate", "beta_1", "beta_2", diff --git a/nlp/dialogue_generation/cpm/pytorch/base/data_preprocessing/convert_to_medium_from_large.py b/nlp/dialogue_generation/cpm/pytorch/base/data_preprocessing/convert_to_medium_from_large.py index e0673f4ae..fb7d430a9 100644 --- a/nlp/dialogue_generation/cpm/pytorch/base/data_preprocessing/convert_to_medium_from_large.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/data_preprocessing/convert_to_medium_from_large.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import torch import argparse import collections diff --git a/nlp/dialogue_generation/cpm/pytorch/base/model/models/gpt2_modeling.py b/nlp/dialogue_generation/cpm/pytorch/base/model/models/gpt2_modeling.py index 3af7b365e..d107d8f6f 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/model/models/gpt2_modeling.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/model/models/gpt2_modeling.py @@ -1,4 +1,6 @@ # coding=utf-8 +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/nlp/dialogue_generation/cpm/pytorch/base/optimizers/__init__.py b/nlp/dialogue_generation/cpm/pytorch/base/optimizers/__init__.py index 8ff379afc..684e8217a 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/optimizers/__init__.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/optimizers/__init__.py @@ -1 +1,15 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from .factory import create_optimizer \ No newline at end of file diff --git a/nlp/dialogue_generation/cpm/pytorch/base/optimizers/factory.py b/nlp/dialogue_generation/cpm/pytorch/base/optimizers/factory.py index de3b2fa09..72ff73f23 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/optimizers/factory.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/optimizers/factory.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from torch.optim import AdamW diff --git a/nlp/dialogue_generation/cpm/pytorch/base/prepare.py b/nlp/dialogue_generation/cpm/pytorch/base/prepare.py index a07cd961e..97bd7ae10 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/prepare.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/prepare.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import shutil import subprocess diff --git a/nlp/dialogue_generation/cpm/pytorch/base/run_training.sh b/nlp/dialogue_generation/cpm/pytorch/base/run_training.sh index f7b575040..d7f2cf69a 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/run_training.sh +++ b/nlp/dialogue_generation/cpm/pytorch/base/run_training.sh @@ -1,5 +1,18 @@ #!/bin/bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. get_lscpu_value() { awk -F: "(\$1 == \"${1}\"){gsub(/ /, \"\", \$2); print \$2; found=1} END{exit found!=1}" } diff --git a/nlp/dialogue_generation/cpm/pytorch/base/run_with_docker.sh b/nlp/dialogue_generation/cpm/pytorch/base/run_with_docker.sh index b49d38379..ed186f9fb 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/run_with_docker.sh +++ b/nlp/dialogue_generation/cpm/pytorch/base/run_with_docker.sh @@ -1,5 +1,18 @@ #!/bin/bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # ================================================= # Constants # ================================================= diff --git a/nlp/dialogue_generation/cpm/pytorch/base/schedulers/__init__.py b/nlp/dialogue_generation/cpm/pytorch/base/schedulers/__init__.py index 53a358824..11f052472 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/schedulers/__init__.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/schedulers/__init__.py @@ -1 +1,15 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from .factory import create_scheduler \ No newline at end of file diff --git a/nlp/dialogue_generation/cpm/pytorch/base/schedulers/factory.py b/nlp/dialogue_generation/cpm/pytorch/base/schedulers/factory.py index 9230aea63..f0a3deb8e 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/schedulers/factory.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/schedulers/factory.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from .learning_rates import AnnealingLR def create_scheduler(optimizer, args): diff --git a/nlp/dialogue_generation/cpm/pytorch/base/schedulers/learning_rates.py b/nlp/dialogue_generation/cpm/pytorch/base/schedulers/learning_rates.py index 625057b2b..cfc749016 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/schedulers/learning_rates.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/schedulers/learning_rates.py @@ -1,4 +1,6 @@ # coding=utf-8 +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/nlp/dialogue_generation/cpm/pytorch/base/train/evaluator.py b/nlp/dialogue_generation/cpm/pytorch/base/train/evaluator.py index 3fa1f429e..788d64a05 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/train/evaluator.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/train/evaluator.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import imp import torch diff --git a/nlp/dialogue_generation/cpm/pytorch/base/train/event/__init__.py b/nlp/dialogue_generation/cpm/pytorch/base/train/event/__init__.py index 2cd8c9e60..c14bccdbc 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/train/event/__init__.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/train/event/__init__.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from .base import BaseTrainingEventInterface from .base_adapter import BaseTrainingEventAdapter from .compose import TrainingEventCompose diff --git a/nlp/dialogue_generation/cpm/pytorch/base/train/event/base.py b/nlp/dialogue_generation/cpm/pytorch/base/train/event/base.py index f47fcc394..e2241f14d 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/train/event/base.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/train/event/base.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from typing import Tuple, List import torch.nn diff --git a/nlp/dialogue_generation/cpm/pytorch/base/train/event/base_adapter.py b/nlp/dialogue_generation/cpm/pytorch/base/train/event/base_adapter.py index 5c6b9b1c0..ae3d9c2a5 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/train/event/base_adapter.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/train/event/base_adapter.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from torch.optim import Optimizer from .base import BaseTrainingEventInterface diff --git a/nlp/dialogue_generation/cpm/pytorch/base/train/event/compose.py b/nlp/dialogue_generation/cpm/pytorch/base/train/event/compose.py index faf078008..75ffb2d8a 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/train/event/compose.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/train/event/compose.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from typing import List, Union, Callable, Tuple from torch import Tensor diff --git a/nlp/dialogue_generation/cpm/pytorch/base/train/event/log.py b/nlp/dialogue_generation/cpm/pytorch/base/train/event/log.py index 9096f1ad7..a9dcf7afd 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/train/event/log.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/train/event/log.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import copy import inspect import os diff --git a/nlp/dialogue_generation/cpm/pytorch/base/train/metrics.py b/nlp/dialogue_generation/cpm/pytorch/base/train/metrics.py index d0264efc7..1932d852f 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/train/metrics.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/train/metrics.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from __future__ import division from __future__ import absolute_import from __future__ import unicode_literals diff --git a/nlp/dialogue_generation/cpm/pytorch/base/train/training_state.py b/nlp/dialogue_generation/cpm/pytorch/base/train/training_state.py index 52f4b8898..63a0b9e61 100755 --- a/nlp/dialogue_generation/cpm/pytorch/base/train/training_state.py +++ b/nlp/dialogue_generation/cpm/pytorch/base/train/training_state.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from dataclasses import dataclass import torch diff --git a/nlp/translation/t5/pytorch/examples_ix/init_torch.sh b/nlp/translation/t5/pytorch/examples_ix/init_torch.sh index be46de60b..a90a9e1f8 100644 --- a/nlp/translation/t5/pytorch/examples_ix/init_torch.sh +++ b/nlp/translation/t5/pytorch/examples_ix/init_torch.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # Install packages . install_pip_pkgs.sh diff --git a/nlp/translation/t5/pytorch/examples_ix/train_t5_small_amp_dist_torch.sh b/nlp/translation/t5/pytorch/examples_ix/train_t5_small_amp_dist_torch.sh index 7608e4f15..f526c4ac6 100644 --- a/nlp/translation/t5/pytorch/examples_ix/train_t5_small_amp_dist_torch.sh +++ b/nlp/translation/t5/pytorch/examples_ix/train_t5_small_amp_dist_torch.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. num_devices=`ixsmi --list-gpus | wc -l` export TOKENIZERS_PARALLELISM=true diff --git a/nlp/translation/t5/pytorch/examples_ix/train_t5_small_amp_torch.sh b/nlp/translation/t5/pytorch/examples_ix/train_t5_small_amp_torch.sh index a36b63e03..c5ff12ed0 100644 --- a/nlp/translation/t5/pytorch/examples_ix/train_t5_small_amp_torch.sh +++ b/nlp/translation/t5/pytorch/examples_ix/train_t5_small_amp_torch.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. EXIT_STATUS=0 check_status() { diff --git a/nlp/translation/t5/pytorch/examples_ix/train_t5_small_dist_torch.sh b/nlp/translation/t5/pytorch/examples_ix/train_t5_small_dist_torch.sh index 54557c8ff..88bd31853 100644 --- a/nlp/translation/t5/pytorch/examples_ix/train_t5_small_dist_torch.sh +++ b/nlp/translation/t5/pytorch/examples_ix/train_t5_small_dist_torch.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. num_devices=`ixsmi --list-gpus | wc -l` export TOKENIZERS_PARALLELISM=true diff --git a/nlp/translation/t5/pytorch/examples_ix/train_t5_small_torch.sh b/nlp/translation/t5/pytorch/examples_ix/train_t5_small_torch.sh index 98a901689..9ca2e87d7 100644 --- a/nlp/translation/t5/pytorch/examples_ix/train_t5_small_torch.sh +++ b/nlp/translation/t5/pytorch/examples_ix/train_t5_small_torch.sh @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. EXIT_STATUS=0 check_status() { diff --git a/recommendation/ctr/dlrm/pytorch/scripts/dist_train.py b/recommendation/ctr/dlrm/pytorch/scripts/dist_train.py index fb70658fd..e57ec0f58 100644 --- a/recommendation/ctr/dlrm/pytorch/scripts/dist_train.py +++ b/recommendation/ctr/dlrm/pytorch/scripts/dist_train.py @@ -1,3 +1,17 @@ +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import datetime import json import itertools -- Gitee From 2ad0077b0d13ad2af34bb86e309846a2630cbce5 Mon Sep 17 00:00:00 2001 From: "wenfeng.zhang" Date: Fri, 2 Dec 2022 16:48:37 +0800 Subject: [PATCH 10/10] move license --- .../dpn107/pytorch/train_dpn107_amp_dist.sh | 2 +- .../dpn92/pytorch/train_dpn92_amp_dist.sh | 2 +- .../pytorch/train_eca_mobilenet_v2_amp_dist.sh | 2 +- .../pytorch/train_eca_resnet152_amp_dist.sh | 2 +- .../pytorch/train_inception_v3_amp_dist.sh | 2 +- .../pytorch/train_inceptionv4_amp_dist.sh | 2 +- .../pytorch/train_mobilenet_v2_amp_dist.sh | 2 +- .../pytorch/train_mobilenet_v3_large_amp_dist.sh | 2 +- .../pytorch/train_resnest101_amp_dist.sh | 2 +- .../pytorch/train_resnest14_amp_dist.sh | 2 +- .../pytorch/train_resnest269_amp_dist.sh | 2 +- .../pytorch/train_resnet101_amp_dist.sh | 2 +- .../pytorch/train_resnet152_amp_dist.sh | 2 +- .../resnet18/pytorch/train_resnet18_amp_dist.sh | 2 +- .../pytorch/train_resnext101_32x8d_amp_dist.sh | 2 +- .../pytorch/train_resnext50_32x4d_amp_dist.sh | 2 +- .../pytorch/train_seresnext101_32x4d_amp_dist.sh | 2 +- .../pytorch/train_shufflenet_v2_x2_0_amp_dist.sh | 2 +- .../vgg/pytorch/train_vgg16_amp_dist.sh | 2 +- .../pytorch/train_wide_resnet101_2_amp_dist.sh | 2 +- cv/detection/autoassign/pytorch/dist_train.sh | 16 ++++++++++++++-- 21 files changed, 34 insertions(+), 22 deletions(-) diff --git a/cv/classification/dpn107/pytorch/train_dpn107_amp_dist.sh b/cv/classification/dpn107/pytorch/train_dpn107_amp_dist.sh index cac9f971b..9a786cf36 100755 --- a/cv/classification/dpn107/pytorch/train_dpn107_amp_dist.sh +++ b/cv/classification/dpn107/pytorch/train_dpn107_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/dpn92/pytorch/train_dpn92_amp_dist.sh b/cv/classification/dpn92/pytorch/train_dpn92_amp_dist.sh index 3788955d2..48dd5ebf1 100755 --- a/cv/classification/dpn92/pytorch/train_dpn92_amp_dist.sh +++ b/cv/classification/dpn92/pytorch/train_dpn92_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/eca_mobilenet_v2/pytorch/train_eca_mobilenet_v2_amp_dist.sh b/cv/classification/eca_mobilenet_v2/pytorch/train_eca_mobilenet_v2_amp_dist.sh index d2bbc5ab8..20a4208b8 100755 --- a/cv/classification/eca_mobilenet_v2/pytorch/train_eca_mobilenet_v2_amp_dist.sh +++ b/cv/classification/eca_mobilenet_v2/pytorch/train_eca_mobilenet_v2_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/eca_resnet152/pytorch/train_eca_resnet152_amp_dist.sh b/cv/classification/eca_resnet152/pytorch/train_eca_resnet152_amp_dist.sh index 3e4cf7f5e..13315029c 100755 --- a/cv/classification/eca_resnet152/pytorch/train_eca_resnet152_amp_dist.sh +++ b/cv/classification/eca_resnet152/pytorch/train_eca_resnet152_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/inceptionv3/pytorch/train_inception_v3_amp_dist.sh b/cv/classification/inceptionv3/pytorch/train_inception_v3_amp_dist.sh index 66385600f..e87a1e714 100755 --- a/cv/classification/inceptionv3/pytorch/train_inception_v3_amp_dist.sh +++ b/cv/classification/inceptionv3/pytorch/train_inception_v3_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/inceptionv4/pytorch/train_inceptionv4_amp_dist.sh b/cv/classification/inceptionv4/pytorch/train_inceptionv4_amp_dist.sh index 0f131ee56..b50e649e2 100755 --- a/cv/classification/inceptionv4/pytorch/train_inceptionv4_amp_dist.sh +++ b/cv/classification/inceptionv4/pytorch/train_inceptionv4_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/mobilenetv2/pytorch/train_mobilenet_v2_amp_dist.sh b/cv/classification/mobilenetv2/pytorch/train_mobilenet_v2_amp_dist.sh index f831b0596..427f992a3 100755 --- a/cv/classification/mobilenetv2/pytorch/train_mobilenet_v2_amp_dist.sh +++ b/cv/classification/mobilenetv2/pytorch/train_mobilenet_v2_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/mobilenetv3/pytorch/train_mobilenet_v3_large_amp_dist.sh b/cv/classification/mobilenetv3/pytorch/train_mobilenet_v3_large_amp_dist.sh index de9df76c0..6530f9f6d 100755 --- a/cv/classification/mobilenetv3/pytorch/train_mobilenet_v3_large_amp_dist.sh +++ b/cv/classification/mobilenetv3/pytorch/train_mobilenet_v3_large_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/resnest101/pytorch/train_resnest101_amp_dist.sh b/cv/classification/resnest101/pytorch/train_resnest101_amp_dist.sh index e95a17232..11afa2266 100755 --- a/cv/classification/resnest101/pytorch/train_resnest101_amp_dist.sh +++ b/cv/classification/resnest101/pytorch/train_resnest101_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022 Iluvatar CoreX. All rights reserved. # Copyright Declaration: This software, including all of its code and documentation, # except for the third-party software it contains, is a copyrighted work of Shanghai Iluvatar CoreX @@ -6,7 +7,6 @@ # CoreX. No user of this software shall have any right, ownership or interest in this software and # any use of this software shall be in compliance with the terms and conditions of the End User # License Agreement. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/resnest14/pytorch/train_resnest14_amp_dist.sh b/cv/classification/resnest14/pytorch/train_resnest14_amp_dist.sh index 982032a12..53bc12d72 100755 --- a/cv/classification/resnest14/pytorch/train_resnest14_amp_dist.sh +++ b/cv/classification/resnest14/pytorch/train_resnest14_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/resnest269/pytorch/train_resnest269_amp_dist.sh b/cv/classification/resnest269/pytorch/train_resnest269_amp_dist.sh index c3d54bd5c..3bcbe820d 100755 --- a/cv/classification/resnest269/pytorch/train_resnest269_amp_dist.sh +++ b/cv/classification/resnest269/pytorch/train_resnest269_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/resnet101/pytorch/train_resnet101_amp_dist.sh b/cv/classification/resnet101/pytorch/train_resnet101_amp_dist.sh index 660339e46..29f2233fc 100755 --- a/cv/classification/resnet101/pytorch/train_resnet101_amp_dist.sh +++ b/cv/classification/resnet101/pytorch/train_resnet101_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/resnet152/pytorch/train_resnet152_amp_dist.sh b/cv/classification/resnet152/pytorch/train_resnet152_amp_dist.sh index cf49b3aec..a20c892bf 100755 --- a/cv/classification/resnet152/pytorch/train_resnet152_amp_dist.sh +++ b/cv/classification/resnet152/pytorch/train_resnet152_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/resnet18/pytorch/train_resnet18_amp_dist.sh b/cv/classification/resnet18/pytorch/train_resnet18_amp_dist.sh index 67a918085..021eab0ed 100755 --- a/cv/classification/resnet18/pytorch/train_resnet18_amp_dist.sh +++ b/cv/classification/resnet18/pytorch/train_resnet18_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/resnext101_32x8d/pytorch/train_resnext101_32x8d_amp_dist.sh b/cv/classification/resnext101_32x8d/pytorch/train_resnext101_32x8d_amp_dist.sh index e8fddf3bc..3238f5bc7 100755 --- a/cv/classification/resnext101_32x8d/pytorch/train_resnext101_32x8d_amp_dist.sh +++ b/cv/classification/resnext101_32x8d/pytorch/train_resnext101_32x8d_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/resnext50_32x4d/pytorch/train_resnext50_32x4d_amp_dist.sh b/cv/classification/resnext50_32x4d/pytorch/train_resnext50_32x4d_amp_dist.sh index e756bae11..4fa71c745 100755 --- a/cv/classification/resnext50_32x4d/pytorch/train_resnext50_32x4d_amp_dist.sh +++ b/cv/classification/resnext50_32x4d/pytorch/train_resnext50_32x4d_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/seresnext/pytorch/train_seresnext101_32x4d_amp_dist.sh b/cv/classification/seresnext/pytorch/train_seresnext101_32x4d_amp_dist.sh index 4331899a4..7d89f81cb 100755 --- a/cv/classification/seresnext/pytorch/train_seresnext101_32x4d_amp_dist.sh +++ b/cv/classification/seresnext/pytorch/train_seresnext101_32x4d_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/shufflenetv2/pytorch/train_shufflenet_v2_x2_0_amp_dist.sh b/cv/classification/shufflenetv2/pytorch/train_shufflenet_v2_x2_0_amp_dist.sh index 0f14673ba..b2a1bbeca 100755 --- a/cv/classification/shufflenetv2/pytorch/train_shufflenet_v2_x2_0_amp_dist.sh +++ b/cv/classification/shufflenetv2/pytorch/train_shufflenet_v2_x2_0_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/vgg/pytorch/train_vgg16_amp_dist.sh b/cv/classification/vgg/pytorch/train_vgg16_amp_dist.sh index 3a2cc5ec3..986907305 100755 --- a/cv/classification/vgg/pytorch/train_vgg16_amp_dist.sh +++ b/cv/classification/vgg/pytorch/train_vgg16_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/wide_resnet101_2/pytorch/train_wide_resnet101_2_amp_dist.sh b/cv/classification/wide_resnet101_2/pytorch/train_wide_resnet101_2_amp_dist.sh index c6d5265ce..0b7d4f2df 100755 --- a/cv/classification/wide_resnet101_2/pytorch/train_wide_resnet101_2_amp_dist.sh +++ b/cv/classification/wide_resnet101_2/pytorch/train_wide_resnet101_2_amp_dist.sh @@ -1,3 +1,4 @@ +#!/bin/bash -ex # Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # @@ -12,7 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -#!/bin/bash -ex # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/detection/autoassign/pytorch/dist_train.sh b/cv/detection/autoassign/pytorch/dist_train.sh index 9c50dce46..2d7dfad14 100755 --- a/cv/detection/autoassign/pytorch/dist_train.sh +++ b/cv/detection/autoassign/pytorch/dist_train.sh @@ -1,6 +1,18 @@ -# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. #!/usr/bin/env bash - +# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. CONFIG=$1 GPUS=$2 NNODES=${NNODES:-1} -- Gitee