diff --git a/cv/classification/acmix/pytorch/run.sh b/cv/classification/acmix/pytorch/run.sh index 8041c1e23296f1f59d94f249c13598707f230967..71a65f5868e61193ca52453df1ed4a433eac94c0 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/alexnet/pytorch/__init__.py b/cv/classification/alexnet/pytorch/__init__.py index 6faec1658ec48ce73b4ab3a65ada4e52b4a403bf..011573976ed1c1e69c9282a42400acc3e68c3586 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 32e8c4f57a6ba20a37bb3cfd1e7a5ed59a61f8d4..7d2e011f7cec1af806b4635fcf65849b55f1111b 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 ea56ca267755706ab1a62e9d5e93c71b6245c639..767b6ce0008b75447ed75016f7e973ab086b992e 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 960641c4da4a8c94aa418c44a22ef5ded8908392..ab9c61b0ba26212fb9404268bfd6f681a35f66c7 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 c9b501cf8f6267488d002f2ae2a526c56ad2c392..8c5e49bcd21622b00e41551257ced4473c97b450 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 30cb89d6001999bcad91ba784cc8f871080a1ff8..8c1fadae25ec148a0af2cc55a544e098d6393247 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..66b217b8507dfb048e3a366fc0fe6374f24eedc4 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 030af6dee3ed4687b0616952fc4cb1c45da6c250..317a9874e0c561de93b0eae48f3e664422447974 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 4c92283b234ceb8d9932eabd1bb1bb01d467fefb..2918bef662408deb14f4ca3b500a64b65bdcc28d 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..66b217b8507dfb048e3a366fc0fe6374f24eedc4 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 b3f559af4457bef4fe537e93ffa776947517735b..59688a9595b8c1d2d8b2a9f23c228da63b047a06 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 484f404f5f797ce7a9afc7d010e4b2cc367b8982..0be32bb486237b3bbd0b310893f408ed019ad282 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 7c543335e94067ed34b8bcf06e4b44333945e5c7..9e79ba13813458d62f7d0d4bf4d2928833f8a287 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 03b8371138f956dc02568bca137dbc4038a41edc..0983d89be50d8d900b1889a1c7171c3828bceda9 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 c821119efb88db7ee21981c362d7f94429e7bb13..998aed7e350ffa13cfc6ff149bbb817970fc997c 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 b0449c3fcb6d900a5a49f07335f3a48970cb2472..0217d2ad24c33da4ee6846fbbb2105170f3e2421 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 b278857973256750416d27802bd0a00eb5936bd2..43c07a34db8d245d1edd11a38f79f71fff5d00e5 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 0295e25e503927f346efb7c6a08bcefc3954dcd9..ed573a574631590e6d338d3e3360c87492e248fb 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 fee424a752fce604aa1a83458af8ad5b2f9c5dcf..0000000000000000000000000000000000000000 --- 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 3d34c4df0e66af0812ee6b9c1176be8a75ecce18..2a25edf2a95b3c59987c640e71e91fd15cbecc89 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/densenet/pytorch/__init__.py b/cv/classification/densenet/pytorch/__init__.py index b3b1e076ede668f63c08408cdf5e570c12ad1bdb..70667c25f65559465d8db10198cede5f0fcddb06 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 7e6377c90fe46f812613da61de8848eb2770c9de..1b7d34120b35e4caf418c626b15565c0fa02fd49 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 23eeb377758ffd0cef6f4b909a2da77ba179c87a..66b217b8507dfb048e3a366fc0fe6374f24eedc4 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 23eeb377758ffd0cef6f4b909a2da77ba179c87a..66b217b8507dfb048e3a366fc0fe6374f24eedc4 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 59abfe190017eb23bc8d67a883523d5dd4c4f023..0eed17975745cbbd78bba4d26722acf96871d5c2 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/dpn107/pytorch/run_train.py b/cv/classification/dpn107/pytorch/run_train.py index 231ef0dbbb6f78c8b7aa57ad53c40dae5fe394b0..272b2d2c6d981029b26a5a5961b32b21d8141062 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 51c77464cd8e95c18fbb7297847713695c40d1ef..9a786cf36631afaa99942793a19fccdec3505f05 100755 --- a/cv/classification/dpn107/pytorch/train_dpn107_amp_dist.sh +++ b/cv/classification/dpn107/pytorch/train_dpn107_amp_dist.sh @@ -1,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/dpn92/pytorch/run_train.py b/cv/classification/dpn92/pytorch/run_train.py index 231ef0dbbb6f78c8b7aa57ad53c40dae5fe394b0..272b2d2c6d981029b26a5a5961b32b21d8141062 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 365a0ec4e8ead4fbb65174462958e7f0d787316f..48dd5ebf1541aa5ed8aad233c5a9fdf977709ebe 100755 --- a/cv/classification/dpn92/pytorch/train_dpn92_amp_dist.sh +++ b/cv/classification/dpn92/pytorch/train_dpn92_amp_dist.sh @@ -1,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/eca_mobilenet_v2/pytorch/run_train.py b/cv/classification/eca_mobilenet_v2/pytorch/run_train.py index 141d33cd388bccf26399f3e81f150c77cf467a74..fd7aaa835d3f22539605836fa5abdd167cbf019b 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 be29cf700e66697cbb4346ac7b21d36f5f869561..20a4208b8e1deeee684621ccad713fcc1a8076fa 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,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/eca_resnet152/pytorch/run_train.py b/cv/classification/eca_resnet152/pytorch/run_train.py index 9d81c540cdfcfe76cad98adf78ba2112fdd1d4f9..6e2c727992259234dd71dfa75c5974f5bcd24ada 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 7979250a33c8fb33205529d5cfe7df704ded7137..13315029c5c2befa66020f1fa9e29a40f6c35664 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,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/googlenet/pytorch/__init__.py b/cv/classification/googlenet/pytorch/__init__.py index b3b1e076ede668f63c08408cdf5e570c12ad1bdb..70667c25f65559465d8db10198cede5f0fcddb06 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 dcdcbc05aaee7e22c6522d77259446483a162d08..d52564e38540c93c98f99c164c1d6ecd900fb0a9 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 3d34c4df0e66af0812ee6b9c1176be8a75ecce18..f5eb8708d1b922be1d989abe1d9524ead3df82bd 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/inceptionv3/pytorch/run_train.py b/cv/classification/inceptionv3/pytorch/run_train.py index fa8aa3e7d7f860f48726cd545cdfd349141f9038..93439e78a57e740ccda344e641766215423e88e9 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 2e462189a5f92f943fdcefa5e8ce0377d78c24dc..e87a1e71407b62a8deb1f26c88fac35ecf88ea7a 100755 --- a/cv/classification/inceptionv3/pytorch/train_inception_v3_amp_dist.sh +++ b/cv/classification/inceptionv3/pytorch/train_inception_v3_amp_dist.sh @@ -1,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/inceptionv4/pytorch/run_train.py b/cv/classification/inceptionv4/pytorch/run_train.py index 5071cdd96c68bd26bdf506d0646f7ca8e432ab88..d72814a9959bb0d74b98d268a2349ecf5e347302 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 639d08000305de73f74206de3ff947404406b9b2..b50e649e2adbaaaa036bd4707695d2f58888ea7f 100755 --- a/cv/classification/inceptionv4/pytorch/train_inceptionv4_amp_dist.sh +++ b/cv/classification/inceptionv4/pytorch/train_inceptionv4_amp_dist.sh @@ -1,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/lenet/pytorch/__init__.py b/cv/classification/lenet/pytorch/__init__.py index b3b1e076ede668f63c08408cdf5e570c12ad1bdb..70667c25f65559465d8db10198cede5f0fcddb06 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 23eeb377758ffd0cef6f4b909a2da77ba179c87a..66b217b8507dfb048e3a366fc0fe6374f24eedc4 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 23eeb377758ffd0cef6f4b909a2da77ba179c87a..66b217b8507dfb048e3a366fc0fe6374f24eedc4 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 e20c0323011ac812d6c5ec0b29d5186d16e83ace..9547ae777add021e1014d83d0b6ff9606a10bdf2 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 3d34c4df0e66af0812ee6b9c1176be8a75ecce18..f5eb8708d1b922be1d989abe1d9524ead3df82bd 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/mobilenetv2/pytorch/run_train.py b/cv/classification/mobilenetv2/pytorch/run_train.py index 1aa016e1ade92101d2ce796a17bfba7026590e0c..651a35d549e1dfabfb38c1c6203e5296fed82520 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 428e13b8f445cdb54d66b47377b237e5eeca1c39..427f992a3f35553dd2f921e607489f09cf1acc8b 100755 --- a/cv/classification/mobilenetv2/pytorch/train_mobilenet_v2_amp_dist.sh +++ b/cv/classification/mobilenetv2/pytorch/train_mobilenet_v2_amp_dist.sh @@ -1,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/mobilenetv3/pytorch/run_train.py b/cv/classification/mobilenetv3/pytorch/run_train.py index 1aa016e1ade92101d2ce796a17bfba7026590e0c..651a35d549e1dfabfb38c1c6203e5296fed82520 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 65a0e726747e9f0e8e7def5fee31d19cf707ae96..6530f9f6d05fe2c9110274b9e06fd78d29e9f207 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,12 +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. #!/bin/bash -ex +# 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. # 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 e95a17232bb8ebae7c85cf68fb01b77a7e6428aa..11afa2266abe26af2e8044c00ed8dc0db4ba0b21 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/run_train.py b/cv/classification/resnest14/pytorch/run_train.py index dfde2cdd761a6e89591ce3689ee8c30a0c46d691..26b53292b0665f0bad57c9c741652f8fabcd1b9b 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 345f648cfdc9365053b42dc0f69004f29194b327..53bc12d7215b2155648d033349aa1171321cd9e4 100755 --- a/cv/classification/resnest14/pytorch/train_resnest14_amp_dist.sh +++ b/cv/classification/resnest14/pytorch/train_resnest14_amp_dist.sh @@ -1,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/resnest269/pytorch/run_train.py b/cv/classification/resnest269/pytorch/run_train.py index cc230e0c30e5463d83e9457caec03b0facfbbf5d..b2248a2614a59659893c6c6b37ee485223168e51 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 32f2cca391a6295bc5c858fd33a1aa605a9de2f0..3bcbe820dbe8f656a204f5d5c425600da8210a7f 100755 --- a/cv/classification/resnest269/pytorch/train_resnest269_amp_dist.sh +++ b/cv/classification/resnest269/pytorch/train_resnest269_amp_dist.sh @@ -1,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/resnet101/pytorch/run_train.py b/cv/classification/resnet101/pytorch/run_train.py index f3547a995e5fd402b8c5d44ef0550ae264d19082..6478ad2059fb0298e224c860490a7fbcee4e5ee4 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 fbf7983587873b2560350ff41fb8956ae1e595ca..29f2233fcc7ae6183411664f50aede838267cd0b 100755 --- a/cv/classification/resnet101/pytorch/train_resnet101_amp_dist.sh +++ b/cv/classification/resnet101/pytorch/train_resnet101_amp_dist.sh @@ -1,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/resnet152/pytorch/run_train.py b/cv/classification/resnet152/pytorch/run_train.py index 591680f0fd96cca440b2f2fb5e9db5c670f3c512..7fde4058fcdd5dc7ea9583b6fd5ccb28a2d44e10 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 b38fd68322782dd7af2e471b0cc0dc6faae67e37..a20c892bf09e763eca2485d17e5ff33d9ecbb1ee 100755 --- a/cv/classification/resnet152/pytorch/train_resnet152_amp_dist.sh +++ b/cv/classification/resnet152/pytorch/train_resnet152_amp_dist.sh @@ -1,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/resnet18/pytorch/run_train.py b/cv/classification/resnet18/pytorch/run_train.py index f3547a995e5fd402b8c5d44ef0550ae264d19082..6478ad2059fb0298e224c860490a7fbcee4e5ee4 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 c3f2a95428fd413e1c5d4c9fc3d08fccd3f2728a..021eab0ed33ecb76bfd652bc1e73451b0eac6a6b 100755 --- a/cv/classification/resnet18/pytorch/train_resnet18_amp_dist.sh +++ b/cv/classification/resnet18/pytorch/train_resnet18_amp_dist.sh @@ -1,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/resnext101_32x8d/pytorch/run_train.py b/cv/classification/resnext101_32x8d/pytorch/run_train.py index 591680f0fd96cca440b2f2fb5e9db5c670f3c512..7fde4058fcdd5dc7ea9583b6fd5ccb28a2d44e10 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 3e1837e575420f98cf2f82017ab09bfd803aa58d..3238f5bc7d03303d8f27a01f0866afb17132a914 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,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/resnext50_32x4d/pytorch/run_train.py b/cv/classification/resnext50_32x4d/pytorch/run_train.py index 6d4bff839d21a4a96236a0fedc4a4faa5dcb60b6..fdadf331ad24b6c3aae14ddd781a7d31578c3c62 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 d9604d00c8e2cc35b49d3ea1052b92e5346e44dc..4fa71c745b5fb2efb79d5715a99f14d97867139c 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,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/seresnext/pytorch/run_train.py b/cv/classification/seresnext/pytorch/run_train.py index 171d5fea5e0b12739559b434dd797c98487b562c..35729dda9534b376f6343ee54a46cd681de4ba1f 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 7311b6d232ab6ceaa10ee84bff2a8436ddf88120..7d89f81cb6b334a57c5fc6494159b0bc9be56c83 100755 --- a/cv/classification/seresnext/pytorch/train_seresnext101_32x4d_amp_dist.sh +++ b/cv/classification/seresnext/pytorch/train_seresnext101_32x4d_amp_dist.sh @@ -1,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/shufflenetv2/pytorch/run_train.py b/cv/classification/shufflenetv2/pytorch/run_train.py index 1aa016e1ade92101d2ce796a17bfba7026590e0c..651a35d549e1dfabfb38c1c6203e5296fed82520 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 55a70ac2524d46e3f5eb53cc06951d594c11f6b3..b2a1bbecab45638590d70c242142f66bab09f69e 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,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/squeezenet/pytorch/__init__.py b/cv/classification/squeezenet/pytorch/__init__.py index b3b1e076ede668f63c08408cdf5e570c12ad1bdb..70667c25f65559465d8db10198cede5f0fcddb06 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 7e6377c90fe46f812613da61de8848eb2770c9de..d773819250d593b3787e9e47d63b67a65198f61e 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 ea56ca267755706ab1a62e9d5e93c71b6245c639..e412913d3549a262b62f98f3c847d84d50b1428b 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 960641c4da4a8c94aa418c44a22ef5ded8908392..224fc6eda8ea14ae9f837ca083a21eab10ea855a 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 3e366eca50effc35fc15114831b34dd6a71a183a..3af2eba709151315c7653ba3f72fcf9e26f55354 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 30cb89d6001999bcad91ba784cc8f871080a1ff8..4a6bc5e518f64bc601c6140d5398790b04aa979a 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 23eeb377758ffd0cef6f4b909a2da77ba179c87a..66b217b8507dfb048e3a366fc0fe6374f24eedc4 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 030af6dee3ed4687b0616952fc4cb1c45da6c250..eb39933fb23dd28a83d3d84eaf0fabde74e7f22f 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 4c92283b234ceb8d9932eabd1bb1bb01d467fefb..d73bfaf980f0a61b8537efeb836bd47758274437 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 23eeb377758ffd0cef6f4b909a2da77ba179c87a..66b217b8507dfb048e3a366fc0fe6374f24eedc4 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 b3f559af4457bef4fe537e93ffa776947517735b..59688a9595b8c1d2d8b2a9f23c228da63b047a06 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 b6f7e8beae10482bce3cfbc43b480bc8af047a57..9efe57b6b66e0486f71659b42ef5e55caae2a8c6 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 04812a959687aff8278b101e143c1c71a1e9caaa..afdadaafcac472596daa19d062551de06edf9aed 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 5cf0dded1361dd9cd98a1510b43e25e92f174838..0000000000000000000000000000000000000000 --- 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 3d34c4df0e66af0812ee6b9c1176be8a75ecce18..027d6bcee4e7783ab199b0df93f55e01e6bfca0f 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/classification/vgg/pytorch/run_train.py b/cv/classification/vgg/pytorch/run_train.py index 1aa016e1ade92101d2ce796a17bfba7026590e0c..651a35d549e1dfabfb38c1c6203e5296fed82520 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 4fa6953dae786cd10ae4ef1594593b04b8f61b49..98690730529189a5febb24c5ddda53a3278460af 100755 --- a/cv/classification/vgg/pytorch/train_vgg16_amp_dist.sh +++ b/cv/classification/vgg/pytorch/train_vgg16_amp_dist.sh @@ -1,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/wavemlp/pytorch/run.sh b/cv/classification/wavemlp/pytorch/run.sh index b47bf6f59231f39a607279d6a2f58f2b2b95042e..6120235e3902bc14805dbb5a6c8911d630010715 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/classification/wide_resnet101_2/pytorch/run_train.py b/cv/classification/wide_resnet101_2/pytorch/run_train.py index 1aa016e1ade92101d2ce796a17bfba7026590e0c..651a35d549e1dfabfb38c1c6203e5296fed82520 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 b7eefdb172140eefee334c58fdaf0adec262b06a..0b7d4f2df9aa3045bdff6683ef37e3dc2379df1f 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,12 +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. #!/bin/bash -ex +# 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. # Modify me if [ -z "$IMAGENETTE" ];then DATA_PATH=${DATA_PATH:-"/home/datasets/cv/imagenet"} diff --git a/cv/classification/xception/pytorch/__init__.py b/cv/classification/xception/pytorch/__init__.py index 6faec1658ec48ce73b4ab3a65ada4e52b4a403bf..70667c25f65559465d8db10198cede5f0fcddb06 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..66b217b8507dfb048e3a366fc0fe6374f24eedc4 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..66b217b8507dfb048e3a366fc0fe6374f24eedc4 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 28f4449846c6a1fd79a3b7338117b4a7cc6a5d18..3e4f823ba6ff66539b8bd9a90a95a94dbe4d19a1 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 3d34c4df0e66af0812ee6b9c1176be8a75ecce18..f5eb8708d1b922be1d989abe1d9524ead3df82bd 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/detection/autoassign/pytorch/dist_train.sh b/cv/detection/autoassign/pytorch/dist_train.sh index 2f0807c47d121051156965f1f1d477bd4136e4bd..2d7dfad145194b34e8a7fdb3339d6a56af054224 100755 --- a/cv/detection/autoassign/pytorch/dist_train.sh +++ b/cv/detection/autoassign/pytorch/dist_train.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. CONFIG=$1 GPUS=$2 NNODES=${NNODES:-1} diff --git a/cv/detection/autoassign/pytorch/mmdet/datasets/__init__.py b/cv/detection/autoassign/pytorch/mmdet/datasets/__init__.py index e1ecd4ae4961e8751a491ffb3296f07858b0bccb..8ac07ae5b6b697afa8b0531f801c093cdbb444ce 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 9ee5191c16b45023d2e01b0d7069aa41f28088fc..0d21d21f6dd3edf133337955cfc849bd50a11c14 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 4c4d970f444f791b7315e4bd07fc4122a61b88a3..7180d08bea3df7baef0347fa1609bf7340204c04 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 c9a4e0f5f0a015d0750900b0fdcaa21726580a0d..06cd1b42f81006f877859b1d25b20e6ac997519d 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 2514fb66d3759c3c2cd3147dc3391248408bdb81..fb8ce183a3ef080be162c43b4765341e0fbee825 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 1312bb4b708bd4fda5933adc1436972e15ba5745..7741cb605b114e5e49901d1fc2514af66a5b990c 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 1a8131554a25498430626a50b28b18dad9ff8db7..e3f6a68a2bfce57795a14cacc5403c362f093230 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 e9ea12f3d47588ad15e99ece23548c8b1036ea45..3cc9f7a46c7f9ed41856b1fdb4d683eebb77890b 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/detection/centernet/pytorch/src/run.sh b/cv/detection/centernet/pytorch/src/run.sh index 04e30737183b4ecd1c390f773e17ebfaaed9aa3a..2159de0c583bde6c3f9fa4b67d5d8c8bf9f96915 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 f0701ce8d17681ecadea8cdd5d61b7da90e02ca2..5fac573bb81dfef560bb70f9e435793f68fe3662 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 1c2d7f9ec04bb3689781beec8907077cb194ee3f..686347477b87db265a9e27dd4c6fbb6c795d2407 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 219de7fafe39072078375e3535ca1a70ca9d1412..15ce8d3934e6770907d65201ea60c25ab966e185 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 391e59ff18a644af71673ab6887b61bef48512bd..8adb38e191470728ee799cf940f1930cd3e95781 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 09da5f900f9abe2b3f834b1db055e25ec82588a4..57131a89face7e402c5c5cee0ba917514522d7fe 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 af41ff45bbe77e7435322a03f5d9e182ee67a40b..3d30264f332dd192eedf5b080a490780078789fc 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 f16972b15827f7f3301cc9294e3d3a4d43f62986..e7b62a3dff27c667592b7407c890c683ef280b95 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 6ab74c4d96b319a89241b05c785168877f5fc0df..365389a6e95d3867d68a32059598fe1d3855873d 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 cf8e43fe66dd3240e482bd5fe1dae18907bb358e..581d0c8035a5d38b814c1f583dac8cf00f3f33a7 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 f8526534b8354494d6df017980e4322195aedc26..8e28849e7ee7084c2257e02535ed33752abfcacf 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 7de8b53e3ffa466db8d034720a076e61d58fd91d..afb1bb004890d283cb992a8d144ae39a4d2ae737 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 c1ebeb5b42bb387bb7e217d3bb5afe05eb0937f2..912d25cfcf39cf184803365801011e4b23ccba76 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 6da8bf9d4e478495564e4c2c5deda16c2259193f..33c30ee9b10c22841c8cfacb9473c2a4ee25d05d 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 3cbef88169117eb853056300ae2fccf5ad44a705..0daaeb4b7b75fd069bb4099bd25bce74d6cc909e 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/retinanet/pytorch/common_utils/dist.py b/cv/detection/retinanet/pytorch/common_utils/dist.py index ea56ca267755706ab1a62e9d5e93c71b6245c639..78e5010ecf0b1d4299e932f4f0976d2541d8f585 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 960641c4da4a8c94aa418c44a22ef5ded8908392..7d4c963ad21b2e1f15935887624feffbc7e5707a 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 30cb89d6001999bcad91ba784cc8f871080a1ff8..e83996ca20291e79e9860eca6108a2f92d4ba287 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 ecd66e196ff4b3b1ac45615c8882192a25c1e050..7558f5da4c8441a7ef34db3a67b804566c3589a1 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 cef31f4a84c98727a0699ac724afd6609b5e2bad..b0e69647370a6b343abdca6a3a3dca37d07d66b8 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 d6094254145ae7f5c7dab80b494f39d71a6de9ed..b05b606683b255003a412b60295c6af27a46f70d 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 75946f0788cd0bbae50761134611cd3a2acf0e12..9c50debfac413264147fa886bb8113a7a3e9fca4 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 45e0d029b5998e27ffae96f60173a59d94cbdc74..6c23e2b32852571d37fcf5f1a33725c3f36b95b5 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 227d41874ad5ff016e65aa17e2492bc589fd14b6..14f573c89ee36dd93db32904c770571578c96ea7 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 9afb3bdad9b698faa67b7aab590651d52a246bed..7f21fe49eb6f4b692441f25950603f20dfd8241d 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 a373a4c20db645bd0bba143b7b018e169d4203a3..b88dfb7d2c6acb1e429e96b8bbd79716d30d6eda 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/detection/ssd/pytorch/base/run_training.sh b/cv/detection/ssd/pytorch/base/run_training.sh index f68cd90477ea786e44f6489439bc0897b6937698..94ab4b9c4b43ef258605fb8e74cf41871f8761fe 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 a461673f1f14b34949011a848a112d8872807402..5ac6404b7260ccc3004515438140c1384bb0f942 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 73bf0ac8e5e7d69a580819e21e6811e6013392f8..0380b476262bc7b6a3ff7c7a5500cbf0cd9720af 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/yolof/pytorch/mmcv/__init__.py b/cv/detection/yolof/pytorch/mmcv/__init__.py index c612f8a3494bd911ec97763839c3c8becb0fd9b7..b41b49aeb671260f8f1cc00ac844e3a1975338d2 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 26b7fb491f72d3fb868540462aecf7361a16d8fa..02ec44932e318025f2abb4561741872ca49ccd2c 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 cdd234917d9e8fa27732895fb7eaf8b9ff2162e6..b2063c0f93d7ec1ede264a7d93176091b417ef44 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 5803dc10df14155a25f4ed8de52374e1537893c1..da215083424d9337e1697f67e75d95d489144722 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 27b00a66145d1ffc988e430dc51e52b32caba3c6..664340f7b5216c757f8d63e1f1f1913e63dbb636 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 a8b9cbd237ee9c741c0325e77f0618b262781e43..1c02fc7399fd9eaf90b09f308011dd8729503812 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 35140877c27073cd1cc64dd13aef17a35f17abcf..4ee8ebadb4e2c7f9f7e759a516c34b2a6dd265eb 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 6852c38fe728bad01e4121f6a0ab9c8073e04a42..7f1c7ace3c7ba618944cbf969929eb8c74bd70fd 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 80009fd7af86f667edd836a9c176caaa8b981299..906fa748cb048bad4fba3766ad7ec131165da726 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 9ebbcc8a7dd2ba0a2b4d2bb89d018371108d2c45..44c98048064c389066e597a6b09226b9e0ce7716 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 diff --git a/cv/detection/yolov5/pytorch/get_num_devices.sh b/cv/detection/yolov5/pytorch/get_num_devices.sh index e28edae741e3014606c4c0eef2b78a22223b2418..9c37beae6243421aed9b13bb2de4c1069dcd1cf7 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 888dc8a2a75be7eafffced4ca311f48bdb0f98d0..bb7766a2dd432c5de95db27696588b5517430767 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 7ead2f84aef978e49bc52b5bf3e5ee7a3adfbb8d..23a092df8f0d2705b8a5eff76d586d683f466463 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 9003f464ccaaa250aeec8648c2ee1e3178f8e735..8b92c09c9267ad4d5eda93deb11055a5c64c6d74 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/ocr/satrn/pytorch/base/apis/__init__.py b/cv/ocr/satrn/pytorch/base/apis/__init__.py index 776a08dd8614c8f94fcf6b891693c9c881d090a9..1084de43fe2d895b40fcced2b4522b165edfb50c 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 f891e76cbb58669d811d074d6830c3b2a442199e..b3d04672769899095df66b277e13d8fadddb3cd7 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 2b2cd07bbf714a1783845d9b27f0e9eec6138676..5d2ddf3e698c425a3d3f8162db824ba8a6979857 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 017388ad9d46c19b67e4e60936f9f8ed42edf0df..c0ddeb3f0ee983bfa4a96cc59dc99c07e80c8177 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 16281fe0b66dbac563229823d656ef173736e306..dbce4e59b7307446cb079512c1169570acf7a4d9 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 4ef0ea66906368c187531fa70960db38342c51de..3309af93f0079fa4dc139a00a29e2d9f3f09f2af 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 461b113b0f23e16cf7d2e1e2de43e9ab7de79c57..11f0f23a077dc9d3536bab8a83d4ad9be2f27bb5 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 * diff --git a/cv/point_cloud/Point-BERT/pytorch/prepare.sh b/cv/point_cloud/Point-BERT/pytorch/prepare.sh index f6d3cafdff5e97ee66665aa92124d254137d660b..ed751a09e7766b4feb21ff8dbd91cec6f4c36b09 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/apcnet/pytorch/mmcv/runner/hooks/iter_timer.py b/cv/semantic_segmentation/apcnet/pytorch/mmcv/runner/hooks/iter_timer.py index 5fe0d44013af93828d3ae56232376b2bb603cd30..6bde4d52c35e0a13dd26a215853e2470072b09bc 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 4191ce73653875b4af23c876b62575bd75473552..473adef285519c1c07e341082b7ccab584929cd4 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 969df2de0d4b21daf14c9188187a999896e3a21a..d54fc843013b3f0f87c8d00c7941b4b3997d519d 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 e1d3973d4a3a2eee5a7abe50cbd8e880856a7b83..d6193403c729869a2b2b4c9487f0283d2e447bed 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 e0cfeadeb885f47507eb04b7df239bc611645ca1..df7591edf1757980a7a512646f05244d74b91b9e 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 59eacc0130034c331dd149b3469f63d0fee6ef96..7d240a735c0885cb5d9b0e5d1b704d92af70d9c4 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 90418802a94eb2865b0c7659576acfb25542c5bc..3dc45b2becb55bcc0b801c460ab1351a88d00d20 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 90418802a94eb2865b0c7659576acfb25542c5bc..3dc45b2becb55bcc0b801c460ab1351a88d00d20 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 d91e7d250891c69fef5a04c3fbb3b747f1bd6d02..1aea187a051cd93d1933edafd8d9d8854f2e19fd 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 90418802a94eb2865b0c7659576acfb25542c5bc..3dc45b2becb55bcc0b801c460ab1351a88d00d20 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 90418802a94eb2865b0c7659576acfb25542c5bc..3dc45b2becb55bcc0b801c460ab1351a88d00d20 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 1b34f8f7bc8bfb3308f68f9ce0ebee7b22425845..6bcf67db56f607cb8fc1855aec596c44e4dab39a 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 8a5922ef91cd5ee01ebf7bcd9ff01e6b2323cf73..a8109a856299e440948850c19356fc302af82e80 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 13682bab34cfcf5f823439f60dffec37ec114638..9c5cbf6fff82aa342d783335856eb73b829f8654 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 43bdac2783efc43278c85ad78721396c157d991d..c8b952f0ec16cc5a8dc9e22a55832b960fcf155f 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/fcn/pytorch/train_fcn_r50_dist.sh b/cv/semantic_segmentation/fcn/pytorch/train_fcn_r50_dist.sh index 015b087288b1b44389a678daf4f00b2207cd4703..8c7871c8a060f2a14b0d7a22de8681e9e47fb384 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/fpenet/pytorch/run_train.py b/cv/semantic_segmentation/fpenet/pytorch/run_train.py index 95cd22be3766a2de983792d482f279177c861eb0..86c978f2d17e773262b277507f6a2b2588c2e0ea 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/cnn/__init__.py b/cv/semantic_segmentation/gcnet/pytorch/mmcv/cnn/__init__.py index 5d912b0ae4dfb7fa61d45c30ea6ab30a6b4f6d9b..285e49012974946ddcd9214f4822c91ab24ccfd7 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 01019209027fd322edf42acfd661304eba7cca8e..6e416f88c4bbea4faa6c8ca38b97a2e9c0a39f82 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 7fb3cec0bb5c23aae83eb6ed3070e3032a1f463e..91c9e4ee39054167602b77c2f9eb9285f3581c49 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/mmcv/runner/hooks/iter_timer.py b/cv/semantic_segmentation/gcnet/pytorch/mmcv/runner/hooks/iter_timer.py index e067d32d2355ae1f0f7ff8d28f3f74258fab82e7..38df1a058e6fbdadab5271edc9b34f09e0478046 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/gcnet/pytorch/mmseg/apis/__init__.py b/cv/semantic_segmentation/gcnet/pytorch/mmseg/apis/__init__.py index 2283f2807f074ad2fedcb9cfea748d6f8c971516..955aba66621957a9d7a558b2298e91431277095d 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 00f9996ec5a13de7d998ff06b0056323c79b8079..a61d7c98f9a94a24a460a9f6db34ea9cf3702cbb 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 fbe3f688f512e8bec95c2769754e0fedc95a2a7d..0b0fc91099bf9b7af4ca09b148be195dda171048 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 a4febc4e73e4f8540b1eac29baf1f59eb9f08522..1b4fb2c03147aee775d9f498e303f84e301f2f09 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 50994f5faddf9d65d9cd9545d45454d11eb96672..c01bb549f6b24ae5c955a224122bf6754480e595 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 607685bae6b48f9068996561896ea7899ce7dcf0..f58df7590950be5c907879733cd7efdf14375710 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 6462040c9712507452e275b50b812a15cd510f2b..d24e020e1839c4e3fc91d0ca0fca3246689a529d 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/hardnet/pytorch/run_train.py b/cv/semantic_segmentation/hardnet/pytorch/run_train.py index ca638df00b88fa20b1e36e3b24a8c0b98e7fce66..0f68e7a7a641eabbae57750bb09fbdd7777025c0 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/model/builder.py b/cv/semantic_segmentation/icnet/pytorch/model/builder.py index 40bc82275565498be1250dadf6b30798f901f6a4..bc53306c39b2d60207f07bbb43dba90a094b6d6b 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 a627e2a39919533adc2df14320774f6e58b67879..fe971f5b4c28dc7781846a3dc0ee71fd481b7aa6 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 85826ea73fb502bfd19e6b75faf4650517f0c072..c23001ba8fbb7f9544541aa5fca7b0a9adef6edf 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 ebd9f2e52c336a6b0829762eb0150bcb0c1c18c0..0f4f51982c3ac6b1ea547959809a48f799c248bf 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 059325b4b2709bb850cc001d89fc464bab6ef6a9..1e3955584afa1e7f4ac2dec7124140b8e0008fee 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 ed45c37e24d1a16e1909a5e92875b7d82e158085..f3d2168a6eba51704e11be68ed0add46f1d3ceb9 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 f7fc98db111460e47f0981c0a3b72e0bdc54a64a..ec1c34cbd0387df61109dd1134b7cb18457360c2 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 8fe17f6f01d09a395cb1a2e689293647ca22e8b7..603415dfc397d80fdcea94e3024cd7500e297e64 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 716354c4fd476c8f414bda248c82c14b983fd20a..fb6936b9ce55251f0f1eda9c0ba1e1a5f879f5cf 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 c299c2bc40cef065d8d9ecec32e9def6ee8efe15..3541a4cde7fb57ca60ba60ef98855962df473c5c 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 7df68fb6c3cc78649295b56dbc238d17b850127d..b62d8dfda9ba7dceaa36f25ffbe24cbbba11b56b 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 66b71e296e82e0331a4c2649c3ac9b3dc01c68c4..e9d0da4a28567f7cd914b37797671c3fb5849cab 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 c050ccdc28e20f51af7dd31e2af2c6242e000390..acc3e55f7fe4f6275ec1ec2e619068fdbddbbbc0 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 6e71bd6cb4d009e3ec9daf661c7aa8e85c6cf397..eb1523f0ae880ce6093a814df505c708db8736b6 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 851818fbb18b4519264d0a453deccfdbfef37f85..2a0cea95b9e445181027423834113634e8d84669 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2e4bb41ab1725c976f9ed6c204ded283107f0799 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 8c2c5378854fa3d47388b36061f9e33f67fce977..d564bd2cd85d3df1cce9af4fdedb436b6d687deb 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 26ced23ce8a8858193bacdb3d1af8674b09f0f5a..ae4c59c49e82613baad3caced478a983030e300d 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/lednet/pytorch/train_lednet_dist.sh b/cv/semantic_segmentation/lednet/pytorch/train_lednet_dist.sh index 2f47eca0e8a273bee77b428b211b44a58911885f..a53971f366835c914ccce25e3354174494bf5e65 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/linknet/pytorch/run_train.py b/cv/semantic_segmentation/linknet/pytorch/run_train.py index 0dd691b9775bc615c1140f288166bc33853f4726..1e41bdfbc29830a915dfc22157efacd842c337c8 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/model/__init__.py b/cv/semantic_segmentation/ocnet/pytorch/model/__init__.py index ebd9f2e52c336a6b0829762eb0150bcb0c1c18c0..2b7a011a3e7122f96aa6cce9bcdc193c41a4d841 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 e6df7cd49c57cec04420eb7bcb274224fdf6273c..d93e83c38c7611f1a600d83b711106e72397415b 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 366980215ee65acea9a1d56ad032c4812023812a..bb49925cd5995c0ff9e385fc28b39c922a8f6846 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 f7fc98db111460e47f0981c0a3b72e0bdc54a64a..ec1c34cbd0387df61109dd1134b7cb18457360c2 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 8fe17f6f01d09a395cb1a2e689293647ca22e8b7..603415dfc397d80fdcea94e3024cd7500e297e64 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 716354c4fd476c8f414bda248c82c14b983fd20a..bd8d8b117eb70ea4d4bf2f1655882f26f1ee5e23 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 c299c2bc40cef065d8d9ecec32e9def6ee8efe15..3541a4cde7fb57ca60ba60ef98855962df473c5c 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 7df68fb6c3cc78649295b56dbc238d17b850127d..fa4fcc2b1b475a2382606f5d77b5a568317efa58 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 66b71e296e82e0331a4c2649c3ac9b3dc01c68c4..e9d0da4a28567f7cd914b37797671c3fb5849cab 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 14edc1eca034a5786575dc62c76b347737f9489b..2b2bf8044f43c73661fb46239321f37a119a6846 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 6e71bd6cb4d009e3ec9daf661c7aa8e85c6cf397..eb1523f0ae880ce6093a814df505c708db8736b6 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 851818fbb18b4519264d0a453deccfdbfef37f85..e0a3c6616b282be6aa3110a62cfb3791dc2901d9 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4518322a81f1e24cc21c9202b3ef6f3a97c7fb94 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 8c2c5378854fa3d47388b36061f9e33f67fce977..128b4bc11573dc6d3fefcfdf81a10361cdab00bb 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 90418802a94eb2865b0c7659576acfb25542c5bc..3dc45b2becb55bcc0b801c460ab1351a88d00d20 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/ocnet/pytorch/train_ocnet_r50_dist.sh b/cv/semantic_segmentation/ocnet/pytorch/train_ocnet_r50_dist.sh index af27bda19fb34e23e5d02ecc7ce82fe314de20b8..235fe16a061892b820cf659bd4b1b8ced37d27fa 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/ocrnet/pytorch/init.sh b/cv/semantic_segmentation/ocrnet/pytorch/init.sh index d8f9faa7d2f72646dacbef30e3c0e948fb09e0cd..7abdc43ef6cbe6dc3c2c2ebeffc265c5e503513a 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 fc49145d883884acfcd42bb91d5f029d3a7bd4d3..603d736e94087828ed0bf45515a1246a2a309d11 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 72bff258204b2179294d68f7163d407bcb3ab1da..44d270bc1098f2526aec8583226c12694d251e1e 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 35efbac9ff5bb10eaccdee3b278f2afef292b24a..2cc6f260b11e9c31bdcf202571331d87937992d6 100644 --- a/cv/semantic_segmentation/ocrnet/pytorch/train.sh +++ b/cv/semantic_segmentation/ocrnet/pytorch/train.sh @@ -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. 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 e2aec53bb392f3c2e6704824b372c5324621e29b..0cf88160626ff30f741b0707e011e8fc9d67eb90 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 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. 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 fe34291d1b5a0dfad109c00a41d917f87de8b38c..81aed3532f3952dad42ef7b4dbcee507e4c583f8 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 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. 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 cd8269c5de1b1d9bfcd69c32726611ac8cc8434a..ae06f0ced7dd2f67faff40c560efc67c64512a49 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 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. 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/model/__init__.py b/cv/semantic_segmentation/psanet/pytorch/model/__init__.py index ebd9f2e52c336a6b0829762eb0150bcb0c1c18c0..2b7a011a3e7122f96aa6cce9bcdc193c41a4d841 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 6f6c7487a3385dfd94d2cbbdf2eb97361159397c..23e35de9c18e1eb97a03bb50bf2f7e058d5cfb53 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 feb9ca3221b585a18e4cb682bab9bd861b90efec..421bf556d29a921b50f4923c19edb81e5c745bb3 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 7d71ee01dfb5a11ff8311dfc9759b7744905ad8f..719cf38c0de6afba8dfc3b70d9605f39b0d17f5c 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 459390e885424d8c25ff8a68d40695d7c52715de..9e0eb36b6d5725863ae2a2081621f90742722cc4 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 0f38cf82da00e8cc44c7bc52f40d7fcaacc371d8..6b3b1468a4e20717af516bbca2181eacbfd0d8dc 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 6d6a0fec5f4ed308c85661d92dc7268719c26a17..4b2a09e498d24661376b12caffd375f75f20708c 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 2bdf58740fdbc54116449a6d0d90289637cc3e41..e735211efb18757dcf8f31a6142f9c1a60c2d221 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/psanet/pytorch/train_psanet_dist.sh b/cv/semantic_segmentation/psanet/pytorch/train_psanet_dist.sh index 059728770bd87ac200e6acfce4f9f74556ab4a8a..bb64c7773cc2d4f342015fc2159eaa64fa8c2211 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/pspnet/pytorch/mmcv/runner/hooks/iter_timer.py b/cv/semantic_segmentation/pspnet/pytorch/mmcv/runner/hooks/iter_timer.py index 5fe0d44013af93828d3ae56232376b2bb603cd30..6bde4d52c35e0a13dd26a215853e2470072b09bc 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 4191ce73653875b4af23c876b62575bd75473552..473adef285519c1c07e341082b7ccab584929cd4 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/pspnet/pytorch/train.sh b/cv/semantic_segmentation/pspnet/pytorch/train.sh index 88edd482c060eba235a318f1ad3f8e367a28dc8c..82c28c20a0593624ba81808bed5ac6985a010d89 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 b2b398a23b0531b3d4282858731d805b91d8d146..6c02b3a31bc64e0254750751c947453943f5e517 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/refinenet/pytorch/model/__init__.py b/cv/semantic_segmentation/refinenet/pytorch/model/__init__.py index ebd9f2e52c336a6b0829762eb0150bcb0c1c18c0..2b7a011a3e7122f96aa6cce9bcdc193c41a4d841 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 9892e7ec6e26f7b567f2c1a6ed8d0925e7eb098d..98e2a11db2e8d79affdf6c3b8205ddf52068021c 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 31fd7a1a0af81ab0fc84fabb2c79643dea25ade7..d41c7dabbb8aeb8be2c594eb58a9878a6e8e3609 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 f7fc98db111460e47f0981c0a3b72e0bdc54a64a..ec1c34cbd0387df61109dd1134b7cb18457360c2 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 8fe17f6f01d09a395cb1a2e689293647ca22e8b7..603415dfc397d80fdcea94e3024cd7500e297e64 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 716354c4fd476c8f414bda248c82c14b983fd20a..bd8d8b117eb70ea4d4bf2f1655882f26f1ee5e23 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 c299c2bc40cef065d8d9ecec32e9def6ee8efe15..3541a4cde7fb57ca60ba60ef98855962df473c5c 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 7df68fb6c3cc78649295b56dbc238d17b850127d..7f664aab3b1abee662fb3f7043c876bd281af7f2 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 66b71e296e82e0331a4c2649c3ac9b3dc01c68c4..e9d0da4a28567f7cd914b37797671c3fb5849cab 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 17473ff7a3a7dfcf87ee01adb7c6d514626f590c..1ce19472beed055f6148e61c1e1e22f7059e6bf0 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 6e71bd6cb4d009e3ec9daf661c7aa8e85c6cf397..eb1523f0ae880ce6093a814df505c708db8736b6 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 851818fbb18b4519264d0a453deccfdbfef37f85..e0a3c6616b282be6aa3110a62cfb3791dc2901d9 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4518322a81f1e24cc21c9202b3ef6f3a97c7fb94 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 8c2c5378854fa3d47388b36061f9e33f67fce977..128b4bc11573dc6d3fefcfdf81a10361cdab00bb 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 90418802a94eb2865b0c7659576acfb25542c5bc..3dc45b2becb55bcc0b801c460ab1351a88d00d20 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 2e413f8748de4306af9a895702725b3dcc762029..8bafdc8c8a50afb16582f3dc72d9e7ce1bfa728a 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/segnet/pytorch/run_train.py b/cv/semantic_segmentation/segnet/pytorch/run_train.py index ae7926cbdd1c1c98684eebb1bf337a4f68e404d4..92da68d24dbcf251fc24bddb67472ae3cea6dad6 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 ea56ca267755706ab1a62e9d5e93c71b6245c639..78e5010ecf0b1d4299e932f4f0976d2541d8f585 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 960641c4da4a8c94aa418c44a22ef5ded8908392..7d4c963ad21b2e1f15935887624feffbc7e5707a 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 30cb89d6001999bcad91ba784cc8f871080a1ff8..e83996ca20291e79e9860eca6108a2f92d4ba287 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 8bf4bc7e76441d54b5f73871acb504c328b2f43a..3791b8b631369a5e3e72de02a4bc49fd9ee1e906 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 0f548748091b44854a977439d3933c0c02dedabd..d68c73fc8309bab45ae00f9f3a74a6467d8b0ab3 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 bab58447b813a5c3f37683da733a317a219b83d0..1a0409d0e28f368a26144f677e5c010f3fa2ff88 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 cef31f4a84c98727a0699ac724afd6609b5e2bad..b0e69647370a6b343abdca6a3a3dca37d07d66b8 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 d6094254145ae7f5c7dab80b494f39d71a6de9ed..b05b606683b255003a412b60295c6af27a46f70d 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 45e0d029b5998e27ffae96f60173a59d94cbdc74..6c23e2b32852571d37fcf5f1a33725c3f36b95b5 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 c091e7b60366cd89008edb67069cf52b56d8ac2b..9f408dc1255c7bf3b6f0e9757cfbbea0307a3cc5 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 1e229058f7c1bd434040eda26011c49544cdbbb0..3ef737308fd8262f8f4c6ebf3ce0e3c1c36665a5 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/model/__init__.py b/cv/semantic_segmentation/unet/pytorch/model/__init__.py index ebd9f2e52c336a6b0829762eb0150bcb0c1c18c0..2b7a011a3e7122f96aa6cce9bcdc193c41a4d841 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 cfae3cbe4722af61a3cf39219b8b14abce1208d0..42ce76ad9cd0ff0e61db04d45588a5536c87de41 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 debf1672088182dd11a2c13129410f27c515e540..114b89d6bcfc53aa5d9ff4bc5bd399a8653a92e3 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 f7fc98db111460e47f0981c0a3b72e0bdc54a64a..ec1c34cbd0387df61109dd1134b7cb18457360c2 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 8fe17f6f01d09a395cb1a2e689293647ca22e8b7..603415dfc397d80fdcea94e3024cd7500e297e64 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 716354c4fd476c8f414bda248c82c14b983fd20a..bd8d8b117eb70ea4d4bf2f1655882f26f1ee5e23 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 c299c2bc40cef065d8d9ecec32e9def6ee8efe15..3541a4cde7fb57ca60ba60ef98855962df473c5c 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 7df68fb6c3cc78649295b56dbc238d17b850127d..fa4fcc2b1b475a2382606f5d77b5a568317efa58 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 66b71e296e82e0331a4c2649c3ac9b3dc01c68c4..e9d0da4a28567f7cd914b37797671c3fb5849cab 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 6e71bd6cb4d009e3ec9daf661c7aa8e85c6cf397..eb1523f0ae880ce6093a814df505c708db8736b6 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 808249182c5a8068328d42a5413915fca453407c..c65815e8a8be7be570e80e61b40c643fbfc6e32c 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 851818fbb18b4519264d0a453deccfdbfef37f85..e0a3c6616b282be6aa3110a62cfb3791dc2901d9 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4518322a81f1e24cc21c9202b3ef6f3a97c7fb94 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 8c2c5378854fa3d47388b36061f9e33f67fce977..128b4bc11573dc6d3fefcfdf81a10361cdab00bb 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 967a515d5c868ca362ac77934144a4b500c2ce7f..6dc38484e4f4637bc474866c403607e3a702c111 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/unet/pytorch/train_unet_dist.sh b/cv/semantic_segmentation/unet/pytorch/train_unet_dist.sh index 87f4df507e9c75fb8e52a256c6d73405d51dcc63..c928b50b7895e0b46ae50e178707a40b8dc7add1 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} diff --git a/cv/semantic_segmentation/unet3d/pytorch/common_utils/dist.py b/cv/semantic_segmentation/unet3d/pytorch/common_utils/dist.py index 1d5cb4b162c8828fcb14285d67af4837b3e7a34a..35b927d7c1a7fb577acce9c33d4f71f12f386418 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 960641c4da4a8c94aa418c44a22ef5ded8908392..7d4c963ad21b2e1f15935887624feffbc7e5707a 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 30cb89d6001999bcad91ba784cc8f871080a1ff8..e83996ca20291e79e9860eca6108a2f92d4ba287 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/cv/semantic_segmentation/unet3d/pytorch/prepare.sh b/cv/semantic_segmentation/unet3d/pytorch/prepare.sh index 70c8207966ead21f6c9587d4993e2a22983772c0..a38a531d40293559019edb5b09975b39d0295cc9 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 c1a39324b063b549b6941eeb1972560067e0e7c9..d501bf00958738f57e9127d21be954b71d81aca3 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 e622fbae46b4db8a9ff806d1d303c5765e348647..554685f722d282c9420857b6c41505c211ba466f 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/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 7906cd81894c594732dce6d73c69309db8507fa1..2db94b9264dd0d81d0887120369c11ef19711e93 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 9ebbcc8a7dd2ba0a2b4d2bb89d018371108d2c45..87c687cd7609551ac11f76ad87f46de8e5c2c3e9 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 ca0e91a25246569bb7de04649ab4f5afe233670c..bf402a5f3e08dab8dcf09b14f08f7c845f5a5a4d 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 4ec6a466886832d38c72da6e3a3574e72d53cec8..506dde9a9e3583fd4823c96d2b80098ef81390ec 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 27b706702cf1ae0aa924f8712e6ef096cb974998..d0703f190ad9c59bb9de2a3774c6db79ae78e270 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 657c81701b7c114af700c4f8cf37094c705b9a94..1f4b4565d032aad116a6057e91b1b72b05cf8234 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 4b12041d65d7f5ec0028c187c5724a765a90f6f6..ddc8511908c4d941993f310330503833d7907443 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 ed09b4e21ca1d74d99c2b60cfa4a6a94bafe99b2..99f89af3ba8fc5b5e3a845f4283c86fa73aad2c6 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 c6c6bf58e62cf315e6451d257996a9f2bd54c4c3..0a9fc9499b6b1464cdee5465ab9f17806f7c8b7b 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 807771ea07bc269354b5a32deffadae6ce496118..ce2c0f37fb5256faefde7b3e65bafcbc488527f5 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 30fab41b3eb8e95f109a201fee2cf29ea69c1d60..9d976a9917d9db6afec909eea1e6a13fc82fd6e0 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 9c791e7f3d481919d335eaff9b9795d1b8ad7658..339ee05c329d64512ab8f1fe1a7d64069b6011df 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 9ea22bb27d14781620dabb14ff343f2dbcb1e036..0583dd0292dc5fd95319600e0bcc7ecad9e77292 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 e9ea12f3d47588ad15e99ece23548c8b1036ea45..3cc9f7a46c7f9ed41856b1fdb4d683eebb77890b 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 3bb7b5d5b6908ad9997f584362d6a25ea92fb912..3da19786e41e5c549bf2bb898e5f719f834864be 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 73eb865ea8f33cc9189751bc2a1498c053989266..770877044d7897428d60d7f9fc769abf4e9d44af 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 47f0ee53a5cf4ee3808ce72426a4223b1117562d..a62d9ab4de2be7d7934ef23ea1325d1ba35d15e0 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 9ebbcc8a7dd2ba0a2b4d2bb89d018371108d2c45..87c687cd7609551ac11f76ad87f46de8e5c2c3e9 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 ca0e91a25246569bb7de04649ab4f5afe233670c..8b1de4112b01fc705ff755a98502589bffffe4d8 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 4ec6a466886832d38c72da6e3a3574e72d53cec8..506dde9a9e3583fd4823c96d2b80098ef81390ec 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 ed09b4e21ca1d74d99c2b60cfa4a6a94bafe99b2..99f89af3ba8fc5b5e3a845f4283c86fa73aad2c6 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 dd929278014b82997736f3388b1938be8db4b3e5..1135342f34974a93a6eb3c6cf0250a8510ce4df6 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 5f2560d0fe255da7fa802342debc9f92f0c1acc1..ae4736fd241f56377a8dc5cd696852332f0669b4 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 9c791e7f3d481919d335eaff9b9795d1b8ad7658..339ee05c329d64512ab8f1fe1a7d64069b6011df 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 c14589be408b77c5c5e4613cdab74f230cf651a6..2493e965a38533a2b388f5729666ed8b3d4f0f19 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 033fc2d216bb3077d2e902f88326427932d6e579..02481cb65bab698559c11f1199417bf47f5e088c 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 e9ea12f3d47588ad15e99ece23548c8b1036ea45..3cc9f7a46c7f9ed41856b1fdb4d683eebb77890b 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 3bb7b5d5b6908ad9997f584362d6a25ea92fb912..3da19786e41e5c549bf2bb898e5f719f834864be 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 bc56b7edcee19bbfaef2998a1a675a4f52dead84..806fb64b4fb0da774d2df31c275341050cb1e54c 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 9ebbcc8a7dd2ba0a2b4d2bb89d018371108d2c45..87c687cd7609551ac11f76ad87f46de8e5c2c3e9 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 feaba4197f18cedc39ddaaccac14915e2d752e40..7c4684644aa176453978a04e833db5c64d071076 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 063304a828134e9d8ae9c55d869a582825726017..4de1c3ca2f77ed1c7683ea2156065e773a1c9ca2 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 8c9f0c70a89e51d3d844c7f3317e222c4a6b9563..3b854fbbad8875682268f27effd46bb518c1e68f 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 bb87d2de1e7a1d6f9abf43b67e3f291cd997674c..6f60e26444ed4adb235c40a5e8b42e986646c342 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 4d68d0ad695cb01354dcbb2d50e45bfcb41e435f..c9e85d4eb5d0269279b995e00fe77ffdc154e9bf 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 15268dc20402a8eef953789cda49d659f8d83945..4351612b94d2063e0cd3ab55d8118bc83914641f 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 349e3f876dfe9c2cb8b1a41b9623b678c7b7e0c0..269a88f5c71d088bbe453bae32c3da27f098dfb0 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 fa38305c73dff8ec86ad281babd94e5fc44f2c9c..b40cb7c29b44e02716e117ccb54dcc2714d84eb2 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 98caae99bfabb33aaef04f537e713fe052e5ef75..a55b2aab2e8d54e02f803b15868a4be85fd948ab 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 974fd0c5632c70c3baaecca311ce8bb7aaba117f..7cc6a41c6e54033487b987992c90109fd15c9600 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 59df219adf8d04960159c72667a718d1a9b3d70f..7f36ed42a80b3b64b4f8c2b9b5c293b5e51ffd70 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 ba46fe8ade226ba4310a4f27e39f9a29599c86e4..515c7de0546184a5e08722feeff634586c3e6640 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 b5d8e3276395ae24bbb1b448eafc12b8e978f401..2dc933f1c683829560feab7a4a887f46adecdcee 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 a98e49f97ac6e75a595b57e7a2d57920dd7c2241..f5490ffba99a97e49ac8253d3d61f4f9502d6ce3 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 9ebbcc8a7dd2ba0a2b4d2bb89d018371108d2c45..0d970826f6518d9637526eb21238aef3df1efd01 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 05d4c20b70d668c04076eb40cdf8587cd7d4429d..d54482a8892df8cc878436c99cd87fd833469edd 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 e44ccbee607b4bc7171edcdf7978c46cc47ddd8a..3bdc96db87109ab715983cc22e2d91b27367e22b 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 2b24ce348b28c7f3b26d8f10845df74542f573d7..4c22f3be314f720d500c3e30953b076811b36e33 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 6e2f575c8057bd7c32323459fb29098b6939a0e4..71f73c8c0d754c0c88804b5ce4c09101adb9dacd 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 eb0daab93d4f6c7e8d10ca7adbc572412ff1a9e1..b9cdcefd8f497211f113f5e5d9aab7da19c0188d 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 492615d831b5843f39e7e678adb188ae5ccd686a..aa37eaa1bb3ea097b697f74880d519bc4e8554b4 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 bce5a299e71d53d8b343faaea819c04f9d987b18..d369082b6994262109600776547053d1548cf06c 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 c2f3512545cbcd9087138cbd2fc648ce0acd0bf5..6170b0506671fc584d33b54f990ca517f61346c5 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 10afada60d84f3b27185cc8e63f32b0334a93f1a..25e540a428bf8dc38b85768d8ba52e7e93858f35 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 8a5ddd837bded69f0c124f5c78ab5b53a76a7a51..b4f073ae297e2bb50a12151e10df7422b6e7675a 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 3b13f705e693e990f5bfcbbf82040d43730ecbfa..6760f8852d41e2d2c6d961eef3950cd91885a7cf 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 5b6dc6adbcd34f2bd9810b24c98924cd072772b9..4ca125390c6d52d20b42afe102741ca27d9185de 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 b19b8e9759e4b3c4becf622f1abfcbdc9ef43e16..70f37077ea17704278a5077e1f1475e8335d5452 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 2f536d9243b81d615501c4834955bc02dd0597ae..75f1dae26812391427d2fb7438591a48e6659fa6 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 b1c6bc739608bfc5119341001cc944f537483103..5b41b3d74e41fc56df2a7f1d691954e794e2543d 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 a0505250c4529a1e65b0fc2affa66ea5431154d1..781fccb7442164ea4df0bd5eb0d272077e846510 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 b1dfd091f4ac3ae7ac92be2b5e665abf96b56e03..0031ff75e1425f6218000552f58c29f2237112d3 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 d7a23f91b4fa5f79960b51cd8ed77cb63006c43f..9a1068ac985913821d9e6d3e9d2728ab7a8bdbb8 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 8fcce72f5d2a27a0d6d3edd19f18ec3bf943ece3..7f5354d4b0a9441337306e758ef1271af2f3d881 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 eb5232af5d0083f8ec48d6d92ac09154348199ad..f6557e3b28828e72394c588d307cc00fb100cb9f 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 334c50cda0322a140112c459a43dcb793975534f..fd96ac79004daaa637b8156ac8501ec7ba509b69 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 1e7e7b49c6f1154f6f91459954225ae3e9e7cc3d..282eef5ffb891be06dcf981d5196a31abc62fb00 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 9ebbcc8a7dd2ba0a2b4d2bb89d018371108d2c45..87c687cd7609551ac11f76ad87f46de8e5c2c3e9 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 0dcf6b5a96fab48f114d7abd107eaa48d18198d2..fffbe59a57cd9238cb26077a14c0703b39715139 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 2c6ed9c8790bbce02afdd745fe4de5ce47c6d75b..8d0de436a37b7ac710259835c83cf0110bc735e4 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 18468b5825d81c3642fb18ddddb1b262f702d957..854a4acd784d784cc44922cbba6960541b4e0930 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 fd69ad543db5ba0f951cb0f97d6ee182c5cdfece..210bb84f19182acaa1868d178a934d530250f9c6 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 ba628d5a9d45eba6a973a5cd5e174006a67315f2..b780bbd97bc0ff2cf2511ab2d7bd240255719988 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 52d4847290f0da27693e50e000573c3714987db9..629a5d2ec13f3ca774bff611e9fc4bb4c4984ace 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 4860d35bacf093deefc54441a1c1e93319131073..434f552c566c92d39748cabc196bf1a7727c1c47 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 449415a3c633c9e99751c30aa1eb9157b83e8909..853a265908fdd664650fc7a6f3207565354174cf 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 e9ea12f3d47588ad15e99ece23548c8b1036ea45..3cc9f7a46c7f9ed41856b1fdb4d683eebb77890b 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 8313587b7d1c959c923c6923d53dc5947222f9e3..677290483ee7540fa8843f80dacbc14ac88c6199 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 3bb7b5d5b6908ad9997f584362d6a25ea92fb912..3da19786e41e5c549bf2bb898e5f719f834864be 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 326031d8b9cc2e773a3aa9b0dd7c32cbc6b35ea9..51d5a536b19dc63e7a1d294a7b6f9b913b580332 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 a3566a88e4d9da249161a2b5f4b85e5f902a9721..f0f9d7aa511cb75000bb1ffc05547e0ffa39d429 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 3331953e55235440aad746c588bd86207e9a392c..01cf673b18aa50a79b7bd3444b5237797225bf71 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 4f24a6b035706a5f88af9a2ce65e2d81138d90a1..7b5b312d9529c8dff0ad58cf17c68697ec7eb252 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 c28cb0c21c50e295821958cd846be979f5b461fc..e41495818ba6c46a8db596e429724f550714d829 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 84ece82c4ab3c41eb9ad17b3b11878b3809e349f..685b2713fa967b6e7f2775599c232f3a56a6662f 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 73019ae58a246d24430ead7e6f21d6b410c98189..9163be06c30f405927da5eec10cd27614f344dc0 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 1dd1da80213005b5cf5c300dd6498055ac2bf017..5879576a4341859623e3572e17bd8d1dfc0d66d2 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 79f1988386cbf09a4a13e2c5a72222e22bcc6f7f..9940266cfb3d2460885ee9ff34993f1e8d871c50 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 d60fdb904c749ce3b251510dff3cc63cea70d42e..9d48ab1df9660f027a156d24211b3bb962a88169 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 a3820a0a7fa4db0c58797bf3a8094a9fa8db1068..5ac99284b79bc1270685822f569be0ed8c6edbc0 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 a140dff6b23b1a2085d32c58b1095fa8739bb505..45c0a68019123a451536e3312947981ddbdb66ff 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 51ef22c4d50fb832d404cbd2757269b98d4a60c4..67a36857f1c378727dd1d895a71969c4fb5e4a96 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 31e529951036ee065a7aaa0751a8881a7c4053ac..a1b0ddc8bad923618b093f298f615474bec3e89a 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 e9ea12f3d47588ad15e99ece23548c8b1036ea45..890ede23c6edb60a65dcce74857138a8e68c56d2 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 b197f2f6e26bc22ecdbf1fd0145670c803238b84..d15e7e99177357147b3400445ea9531f12b820d1 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 diff --git a/cv/tracking/fairmot/pytorch/src/lib/logger.py b/cv/tracking/fairmot/pytorch/src/lib/logger.py index ab3aab36625019c63c05eff133e03d4a1cc84700..b31e05cea771e1bc139015a8b2fbdd24a8dc548f 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 ba844f0996557d02f2a2b8e32875d6e4e82a5c3f..e6fe43c8d2d753a5301b846c8134a03a781d5ecc 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 b8d44e52e67fb75560d4aa6d5651730beb1b3995..374f5ccc283bfdfe526b008ef731c4a4e9285443 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 18a981d80ca6d886cb495994331d45bf20ca27d7..0832047ce8bca2ac558253d980803ca833ea7094 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 472d96aedb737ecc7fe9a4c661596711fabc70b7..4645ac99a5367419214a4aad9844cb57b5692110 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 869473033809df84c8b8a73a2ac1719fbbd8d0d0..a78f48b418a3284cd6b42f6976760b635294dd66 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 3185931a50313e2151b646364de59656d3d65987..297f26c8727a4d47aafe781d2e031af67929d50c 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 83a1068f31894d33f9782e310a07567244d3b6d0..1f87bd415ddea03c1ed8df9a13a318378f7d7684 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 2d9a43674525f2b0e571d766862eb3b40d6de1ca..a463063671a424dede1069511bd6fdaee9edabfb 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 be6f915d23db3354623dbef727b3cca5d78f0a87..97bfaf730173ab18db32e9e874b606ef59ab0e59 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 d6ddadba59c17b94e60f068db6a406d82a665dbf..7e5dc2ad4ce9590826dd73225fcf94ba5bc0d12d 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 9264232f680170d5bda6ce00b8c120515d13f01d..667cd83a69b9a02d86187e0f92882316bc97d773 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 f269ef63a4da4a6c337e60e7d0b79c9263249a5d..d549b1bf957b81584f30447e382d51a07efb796a 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 f21d9415c07a0dbf720841ddf7d34a0815dfa9eb..627044e46c4891ec515e9a57d618dc186808e71e 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 1dcd85ab3ba0c3846e8aab16c7b5b5ce884d6f35..ecdc5c1eafa42a727a2519a7cdab3632ca07f553 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 5193cb0ca5042d22301121384dfd18bd30a2a665..1044c742c4e8e9f936a1329f6eb5ffa28465dc46 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 77c96bec8b791c0acd733fc5bbd3cb664178de19..1fb59432c9bda30a371e7b519a60b343df789b49 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 f050f7399b05f8e8f6bdc00406758572d1ba1645..9aa1fca5af26840732e5ce580631b36bd0c24715 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 e300abc89e4adb6eb4849442001732b9873f0cf9..6a1e1a0a10ab0e2257e23e2a44e84fe855c2b78f 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 e380854ddee5fb7d847405573654e4b2c9efaef5..b83622b8dc30780c9fe772abb0c1ee92128cbff3 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 7d40f3b619da466a367d51fd212c5389abf2bb2b..9c963d1693cc763cdd63c2b7c8f95e9be7e8704b 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 31bc1df3fd1432557acb28568a9de4951647eecb..b8a3736cf425adf1c8578adf10af94419dec6afe 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 31bc1df3fd1432557acb28568a9de4951647eecb..b8a3736cf425adf1c8578adf10af94419dec6afe 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 c94a8b8818340e0448e5b41ac57721a444526ce4..d2a4e94d288e76e5483e0b13f842775f3c1f6225 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 80679a90cdad0c73c7050196dbf17b57e1c2bb16..733fb86a5147a90d7b6cb3a34313c89e9be9d702 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 7bcc99d3f596140b2eb88398190e98eea8441a5d..2ea20dfc676774f9b9b206073c984d2d46fa6d2e 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 e28aba1a323ccdfb9bf7b62409024f3a9c5e7b51..2aee5e1f436a5d5eb7d00d383239e7a4bc0c9051 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 d748abfd06142e2c8bb447bbddf2cd6b1ff3470f..9708be884501962c65b62c33f6d74226cf2ea97c 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 284f2aedd1130ede3f2a61de4379d57ca077647e..9a43eb39bfd541c99b8891d04745b36d10ff9fe3 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 b91b123d88b5a1ad8928787b8eaf1c916ead3447..bfdff55527eebedff9c8c6d1084f45e0ba284799 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 a3dccbadb7d6f568bf9cbe822bfdcb63013d6cbd..724bf5b8e30197d32cc1d9037fcc8c3f450d4c57 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 3c3d21f260824c484265ca806ac480e3b59744d8..21bdf3f3e19a03f6811ec51e746593edec0fb2b9 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 4abd8f5670a3694ade1884946cca2189f2c54935..71e097a66d1698813724e6a60bc5875a111980d6 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 5493d79be9bb349d322bd334565fdd2cb625548b..3e799c850c7ec17b4929b6b246d856e925a7e768 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 29c22ddb4fdc661abccfc12a341c48f0883edd42..e5d8a4fd0965de26d7b629cc87a74d5b8834d6c9 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 258fb17d7d7139fc9974e482892dfbfae6c3448d..097d85a13ccadd48293926f9b579bfd6603a7aab 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 147d9ea8f2fd948455fb3cc9f977b3199ac942ad..88ad09fd45111ba9b337a2131fd182c05f5acdcd 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 c30dfa3b7dec972a2f0db18b7b8884c81d0dd57f..3b69129d1fec0190ed07505d91d78f0c7b7d324c 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 3e12a9e2f322d2ac67ec9e89e14d842779d8c947..36d0f72764823b19a862cea3a7dab955b995e0da 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 e0673f4ae8171940cc9936b63c8a4924c69a81ff..fb7d430a9b5c9b66d2830835fd8f4e975d9a267e 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 3af7b365ece7cc7ded7e2445d3f14ede48ca0bad..d107d8f6f4f51426006469f7b80d416679040561 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 8ff379afc9ad7b9de40ee2ddd19820b7099c32d3..684e8217a6555a9e1ddd6032ecde2723bd0fbf08 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 de3b2fa09a95554d008c9f25907feecaf93b7255..72ff73f23e0af0848f1204e98583dec288d7dba5 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 a07cd961e9fd328e529e896157692b83d3003890..97bd7ae109f4141d19be42a7b6449b8714a23973 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 f7b5750403ed7327c68596d8a51bb938337d0596..d7f2cf69ab957e550be9fe10cda1e298564fff12 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 b49d38379496798fe7d9cb31fc5d1a9dc814570b..ed186f9fbb54d575fa6b48a765961a6abf3b2f93 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 53a35882432edb469d149e1e3ca0a3bb0635f724..11f052472bb651b54ae27098083144d8b995ff70 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 9230aea638157a1b86b89bf85db3f2a33d9605ca..f0a3deb8e2ffd9d67410ba7871b86945add5b683 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 625057b2b7972954925acf91fc06cd450023a742..cfc7490164ad7efb52cfa094127faf46282a5225 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 3fa1f429ef2aa2b201aff9887ecfdaaaa4087e9c..788d64a05763cc60297f6902fa48aafa684a0ad4 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 2cd8c9e6091d8ceaf9a73f60b63c52aa58730bc9..c14bccdbc0030f5a5a72d4b9bbe1c6bf434dcb02 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 f47fcc39489f628ea98be7951f2f43528fa1fc26..e2241f14d9d56d99c0deb0ddd489a8da9bd600f3 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 5c6b9b1c02bdab55a0060da33fda1b5dfef7ae9e..ae3d9c2a554ad3438cd69d329b7ca9008768b695 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 faf078008207a192093e1d3e8e75742e6e0aa1f6..75ffb2d8abf49a13213a5cacad6fab3040521292 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 9096f1ad72b36a55611d39f65eda88ba9a74a11b..a9dcf7afdf1cfa71bbf33b7ab545aa3c694d9388 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 d0264efc71ecff1c1451b9caeb603a5aedb01081..1932d852f17604a7e52896570f8acea301a49f7d 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 52f4b8898e6203e02e543d3c6d30f113820787e3..63a0b9e61b96989c53d41004c22354ba3c49cd35 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/language_model/bert/pytorch/fwd_loss_bwd_trainer.py b/nlp/language_model/bert/pytorch/fwd_loss_bwd_trainer.py index eb20925d01214385efbc352bdeb86dbf3e5eb960..2732d6477b403de0b380e86496f359c773635dba 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 bcb01e477e2595f75e103efb2f8beae6272b4974..6336fdc77c5fc626384f887d9e89aa67857abef7 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 0a77c569e426f6cbcdb77eb140765bc88f448bc4..398f6d147a7468d433084d274af81fb48a29fbed 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"} diff --git a/nlp/translation/t5/pytorch/examples_ix/init_torch.sh b/nlp/translation/t5/pytorch/examples_ix/init_torch.sh index be46de60b3f8d84d52d3102b48ab7121202131e3..a90a9e1f8a8204b411f9de3b3d2b810ca746a0cf 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 7608e4f15b7c488556f7081b68e4909104c9473a..f526c4ac634917c2955dc1f95e50bcda1300a8c1 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 a36b63e031718ce787ef97cc0e5685abfa4438f6..c5ff12ed09675fe5240abce126470aa6a10e6a8c 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 54557c8ff112a9b1d4f5ab6779830a917831485e..88bd318532bdf8f46d006cb38b4888d9c4ccd65b 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 98a901689adbaa2009775f7fcb8e16b12b37a11c..9ca2e87d7f20ff7fe9f6484dfe8124395f80d7ed 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/collaborative_filtering/ncf/pytorch/download_dataset.sh b/recommendation/collaborative_filtering/ncf/pytorch/download_dataset.sh old mode 100644 new mode 100755 index 581204825b954d4426db4a63ac891c15f9a4967e..00dc4ddb3b0f1c886cfc1e0fe62054ffa1a6b21a --- 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 ebd6adf492f5f4f44f8b4ed657be27dac7fb9dca..deaa81277b201e25395255a48202f84b5bff3aba --- 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 9e3d06874011ad6597e0b0393239a7319d97b709..9164347b0b8a717501c8aed77c895ad9095f20ac --- 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 c524d6504bc7f42102bb5e4bf71b80b0f43f4d20..eba3ea4972801c072b63111fd190bf53773c10e2 --- 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 00c3f3e5184b9e056e9dd705d9be926e440438f1..a6610782b6e765d56e37b4a137b18ac0fff2f101 --- 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 \ diff --git a/recommendation/ctr/dlrm/pytorch/scripts/dist_train.py b/recommendation/ctr/dlrm/pytorch/scripts/dist_train.py index fb70658fd0f05c685b1573ae505fb8cfd4a33b6d..e57ec0f58175a3260360654e1160bfeffccb92bd 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 diff --git a/speech/speech_recognition/conformer/pytorch/wenet/bin/recognize.py b/speech/speech_recognition/conformer/pytorch/wenet/bin/recognize.py index a15e88dddb19d7885e9c42f3cae7b3cd29cf2d80..86acc4503fd1d9e39b23a67115e4805738fb7032 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 67edb01e312c298534bb83cb236e710329c3cc12..d25b2d36f701ea18b0b477bf3a6628c107a6e39c --- 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