From f66944078c0ed61b1a39a0f903f0f4df1bde9ca5 Mon Sep 17 00:00:00 2001 From: "hongliang.yuan" Date: Fri, 13 Dec 2024 03:06:15 +0000 Subject: [PATCH] sync internal file --- cv/classification/alexnet/pytorch/__init__.py | 15 - .../alexnet/pytorch/common_utils/__init__.py | 17 +- .../alexnet/pytorch/common_utils/dist.py | 18 +- .../pytorch/common_utils/metric_logger.py | 18 +- .../alexnet/pytorch/common_utils/misc.py | 17 +- .../pytorch/common_utils/smooth_value.py | 19 +- .../alexnet/pytorch/dataloader/__init__.py | 14 - .../pytorch/dataloader/classification.py | 23 +- .../pytorch/dataloader/dali_classification.py | 26 +- .../pytorch/dataloader/utils/__init__.py | 14 - .../utils/presets_classification.py | 17 +- .../alexnet/pytorch/model/alexnet.py | 15 - .../pytorch/start_scripts/get_num_devices.sh | 14 - .../start_scripts/train_alexnet_dist_torch.sh | 15 - .../start_scripts/train_alexnet_torch.sh | 15 - cv/classification/alexnet/pytorch/train.py | 17 +- .../alexnet/pytorch/train_horovod.py | 15 - cv/classification/alexnet/pytorch/utils_.py | 17 +- .../pytorch/common_utils/smooth_value.py | 6 +- .../efficientnet_b4/pytorch/train.py | 2 - .../googlenet/pytorch/__init__.py | 14 - .../pytorch/common_utils/__init__.py | 8 - .../googlenet/pytorch/common_utils/misc.py | 8 - .../pytorch/common_utils/smooth_value.py | 5 +- .../googlenet/pytorch/dataloader/__init__.py | 8 - .../pytorch/dataloader/utils/__init__.py | 8 - cv/classification/googlenet/pytorch/train.py | 15 +- cv/classification/googlenet/pytorch/utils_.py | 16 +- .../resnet50/pytorch/__init__.py | 14 - .../resnet50/pytorch/common_utils/__init__.py | 14 - .../resnet50/pytorch/common_utils/dist.py | 3 +- .../resnet50/pytorch/common_utils/misc.py | 8 - .../resnet50/pytorch/dataloader/__init__.py | 8 - .../pytorch/dataloader/utils/__init__.py | 8 - .../utils/presets_classification.py | 14 - cv/classification/resnet50/pytorch/train.py | 3 +- .../seresnext/pytorch/seresnext.py | 14 - .../pytorch/dataloaders/transforms_det.py | 3 +- .../pytorch/start_scripts/get_num_devices.sh | 15 +- .../pytorch/start_scripts/init_torch.sh | 15 +- ...rain_fasterrcnn_resnet50_amp_dist_torch.sh | 15 - .../train_fasterrcnn_resnet50_amp_torch.sh | 15 - .../train_fasterrcnn_resnet50_dist_torch.sh | 15 - .../train_fasterrcnn_resnet50_torch.sh | 15 - cv/detection/fasterrcnn/pytorch/train.py | 3 +- cv/detection/fasterrcnn/pytorch/utils/dist.py | 3 +- .../fasterrcnn/pytorch/utils/smooth_value.py | 5 +- .../retinanet/pytorch/common_utils/dist.py | 4 +- .../pytorch/common_utils/metric_logger.py | 4 +- .../pytorch/common_utils/smooth_value.py | 4 +- .../retinanet/pytorch/dataloader/detection.py | 2 +- .../pytorch/dataloader/utils/coco_utils.py | 4 +- .../pytorch/dataloader/utils/pascal_voc.py | 4 +- .../dataloader/utils/presets_detection.py | 4 +- .../dataloader/utils/presets_segmentation.py | 4 +- .../dataloader/utils/transforms_det.py | 3 +- cv/detection/retinanet/pytorch/engine.py | 3 +- cv/detection/retinanet/pytorch/train.py | 3 +- .../configs/_base_/det_datasets/icdar2015.py | 2 - .../_base_/det_models/dbnet_r18_fpnc.py | 2 - .../_base_/det_pipelines/dbnet_pipeline.py | 2 - .../dbnet/dbnet_r18_fpnc_1200e_icdar2015.py | 2 - .../dbnet_r50dcnv2_fpnc_1200e_icdar2015.py | 2 - cv/ocr/dbnet/pytorch/dbnet/__init__.py | 16 +- cv/ocr/dbnet/pytorch/dbnet/apis/train.py | 2 - .../pytorch/dbnet/datasets/icdar_dataset.py | 2 - .../dbnet/datasets/pipelines/transforms.py | 2 - cv/ocr/dbnet/pytorch/dbnet/models/builder.py | 2 - .../models/common/detectors/single_stage.py | 2 - .../models/textdet/dense_heads/db_head.py | 1 - .../detectors/single_stage_text_detector.py | 2 - .../dbnet/models/textdet/losses/db_loss.py | 2 - .../core/evaluation/bbox_overlaps.py | 2 - .../dbnet_det/core/evaluation/eval_hooks.py | 2 - .../dbnet_det/core/evaluation/mean_ap.py | 2 - .../dbnet_det/core/evaluation/recall.py | 2 - .../dbnet_det/datasets/pipelines/loading.py | 2 - .../datasets/samplers/class_aware_sampler.py | 2 - .../pytorch/dbnet_det/models/__init__.py | 2 - .../dbnet_det/models/backbones/__init__.py | 2 - .../dbnet_det/models/detectors/base.py | 2 - .../models/detectors/single_stage.py | 2 - .../dbnet_det/models/utils/__init__.py | 2 - .../dbnet/pytorch/dbnet_det/utils/__init__.py | 1 - .../dbnet/pytorch/dbnet_det/utils/logger.py | 2 - cv/ocr/dbnet/pytorch/tools/analyze_logs.py | 2 - cv/ocr/satrn/pytorch/base/apis/__init__.py | 3 - .../pytorch/base/basic_utils/__init__.py | 2 +- .../pytorch/base/basic_utils/lmdb_util.py | 4 - cv/ocr/satrn/pytorch/base/csrc/build.sh | 14 - cv/ocr/satrn/pytorch/base/csrc/clean.sh | 14 - cv/ocr/satrn/pytorch/base/csrc/install.sh | 14 - .../satrn/pytorch/base/csrc/satrn/__init__.py | 14 - cv/ocr/satrn/pytorch/base/ocrcv/__init__.py | 3 - .../base/ocrcv/runner/epoch_based_runner.py | 2 - .../unet3d/pytorch/common_utils/dist.py | 4 +- .../pytorch/common_utils/metric_logger.py | 4 +- .../pytorch/common_utils/smooth_value.py | 4 +- .../unet3d/pytorch/prepare.sh | 14 - cv/tracking/fairmot/pytorch/src/lib/logger.py | 14 - cv/tracking/fairmot/pytorch/src/lib/opts.py | 14 - .../pytorch/src/lib/trains/base_trainer.py | 14 - cv/tracking/fairmot/pytorch/src/track.py | 2 - cv/tracking/fairmot/pytorch/src/train.py | 14 - .../fairmot/pytorch/train_dla34_mot17.sh | 16 +- .../fairmot/pytorch/train_hrnet18_mot17.sh | 16 +- .../fairmot/pytorch/train_hrnet32_mot17.sh | 16 +- .../bert/pytorch/fwd_loss_bwd_trainer.py | 3 +- .../bert/pytorch/run_pretraining.py | 2 +- .../train_bert_pretraining_amp_dist.sh | 17 +- .../ctr/dlrm/pytorch/dlrm/dist_model.py | 14 - .../ctr/dlrm/pytorch/scripts/dist_train.py | 14 - .../ctr/dlrm/pytorch/scripts/train.py | 14 - .../tacotron2/pytorch/loss_scaler.py | 262 +++++++++--------- .../tacotron2/pytorch/train.py | 2 - 115 files changed, 221 insertions(+), 1002 deletions(-) diff --git a/cv/classification/alexnet/pytorch/__init__.py b/cv/classification/alexnet/pytorch/__init__.py index 011573976..6faec1658 100644 --- a/cv/classification/alexnet/pytorch/__init__.py +++ b/cv/classification/alexnet/pytorch/__init__.py @@ -1,18 +1,3 @@ -# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# 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 7d2e011f7..32e8c4f57 100644 --- a/cv/classification/alexnet/pytorch/common_utils/__init__.py +++ b/cv/classification/alexnet/pytorch/common_utils/__init__.py @@ -1,18 +1,3 @@ -# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# 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 @@ -35,4 +20,4 @@ def manual_seed(seed, deterministic=False): torch.backends.cudnn.benchmark = False else: torch.backends.cudnn.deterministic = False - torch.backends.cudnn.benchmark = True + torch.backends.cudnn.benchmark = True \ No newline at end of file diff --git a/cv/classification/alexnet/pytorch/common_utils/dist.py b/cv/classification/alexnet/pytorch/common_utils/dist.py index f556707d9..ea56ca267 100644 --- a/cv/classification/alexnet/pytorch/common_utils/dist.py +++ b/cv/classification/alexnet/pytorch/common_utils/dist.py @@ -1,18 +1,6 @@ -# Copyright (c) Facebook, Inc. and its affiliates. 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) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + 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 eadf5fe15..960641c4d 100644 --- a/cv/classification/alexnet/pytorch/common_utils/metric_logger.py +++ b/cv/classification/alexnet/pytorch/common_utils/metric_logger.py @@ -1,18 +1,6 @@ -# Copyright (c) Facebook, Inc. and its affiliates. 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) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + 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 8c5e49bcd..c9b501cf8 100644 --- a/cv/classification/alexnet/pytorch/common_utils/misc.py +++ b/cv/classification/alexnet/pytorch/common_utils/misc.py @@ -1,18 +1,3 @@ -# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# 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 @@ -23,4 +8,4 @@ def mkdir(path): os.makedirs(path) except OSError as e: if e.errno != errno.EEXIST: - raise + raise \ No newline at end of file diff --git a/cv/classification/alexnet/pytorch/common_utils/smooth_value.py b/cv/classification/alexnet/pytorch/common_utils/smooth_value.py index 3360b91f6..30cb89d60 100644 --- a/cv/classification/alexnet/pytorch/common_utils/smooth_value.py +++ b/cv/classification/alexnet/pytorch/common_utils/smooth_value.py @@ -1,18 +1,5 @@ -# Copyright (c) Facebook, Inc. and its affiliates. 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) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. from collections import defaultdict, deque @@ -85,4 +72,4 @@ class SmoothedValue(object): avg=self.avg, global_avg=self.global_avg, max=self.max, - value=self.value) + value=self.value) \ No newline at end of file diff --git a/cv/classification/alexnet/pytorch/dataloader/__init__.py b/cv/classification/alexnet/pytorch/dataloader/__init__.py index 66b217b85..e69de29bb 100644 --- a/cv/classification/alexnet/pytorch/dataloader/__init__.py +++ b/cv/classification/alexnet/pytorch/dataloader/__init__.py @@ -1,14 +0,0 @@ -# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# 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 a6c0a6b6d..030af6dee 100644 --- a/cv/classification/alexnet/pytorch/dataloader/classification.py +++ b/cv/classification/alexnet/pytorch/dataloader/classification.py @@ -1,18 +1,11 @@ -# Copyright (c) Facebook, Inc. and its affiliates. 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) 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 os diff --git a/cv/classification/alexnet/pytorch/dataloader/dali_classification.py b/cv/classification/alexnet/pytorch/dataloader/dali_classification.py index 3662fdd16..4c92283b2 100644 --- a/cv/classification/alexnet/pytorch/dataloader/dali_classification.py +++ b/cv/classification/alexnet/pytorch/dataloader/dali_classification.py @@ -1,19 +1,11 @@ -# Copyright (c) Facebook, Inc. and its affiliates. 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) 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 os @@ -126,4 +118,4 @@ def main(arguments): if __name__ == '__main__': import os, time, sys import argparse - sys.exit(main(sys.argv[1:])) + sys.exit(main(sys.argv[1:])) \ No newline at end of file diff --git a/cv/classification/alexnet/pytorch/dataloader/utils/__init__.py b/cv/classification/alexnet/pytorch/dataloader/utils/__init__.py index 66b217b85..e69de29bb 100644 --- a/cv/classification/alexnet/pytorch/dataloader/utils/__init__.py +++ b/cv/classification/alexnet/pytorch/dataloader/utils/__init__.py @@ -1,14 +0,0 @@ -# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# 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 f1f58abbd..b3f559af4 100644 --- a/cv/classification/alexnet/pytorch/dataloader/utils/presets_classification.py +++ b/cv/classification/alexnet/pytorch/dataloader/utils/presets_classification.py @@ -1,18 +1,5 @@ -# Copyright (c) Facebook, Inc. and its affiliates. 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) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 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 0be32bb48..484f404f5 100644 --- a/cv/classification/alexnet/pytorch/model/alexnet.py +++ b/cv/classification/alexnet/pytorch/model/alexnet.py @@ -1,18 +1,3 @@ -# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# 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 9e79ba138..7c543335e 100644 --- a/cv/classification/alexnet/pytorch/start_scripts/get_num_devices.sh +++ b/cv/classification/alexnet/pytorch/start_scripts/get_num_devices.sh @@ -1,18 +1,4 @@ #!/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_dist_torch.sh b/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_dist_torch.sh index ce98a6b2f..24b76e6c2 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,18 +1,3 @@ -#!/bin/bash -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 a24350f53..abe0229d6 100644 --- a/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_torch.sh +++ b/cv/classification/alexnet/pytorch/start_scripts/train_alexnet_torch.sh @@ -1,18 +1,3 @@ -#!/bin/bash -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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-path /home/datasets/cv/imagenet \ diff --git a/cv/classification/alexnet/pytorch/train.py b/cv/classification/alexnet/pytorch/train.py index b7b8ad9fc..9a5fa8745 100644 --- a/cv/classification/alexnet/pytorch/train.py +++ b/cv/classification/alexnet/pytorch/train.py @@ -1,18 +1,5 @@ -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# 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) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import datetime import os diff --git a/cv/classification/alexnet/pytorch/train_horovod.py b/cv/classification/alexnet/pytorch/train_horovod.py index fdb5b15d3..fee424a75 100644 --- a/cv/classification/alexnet/pytorch/train_horovod.py +++ b/cv/classification/alexnet/pytorch/train_horovod.py @@ -1,18 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# 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 torch.backends.cudnn as cudnn diff --git a/cv/classification/alexnet/pytorch/utils_.py b/cv/classification/alexnet/pytorch/utils_.py index 3adf157da..3d34c4df0 100644 --- a/cv/classification/alexnet/pytorch/utils_.py +++ b/cv/classification/alexnet/pytorch/utils_.py @@ -1,18 +1,5 @@ -# Copyright (c) Facebook, Inc. and its affiliates. 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) 2022 Iluvatar CoreX. All rights reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. from collections import defaultdict, deque, OrderedDict diff --git a/cv/classification/efficientnet_b4/pytorch/common_utils/smooth_value.py b/cv/classification/efficientnet_b4/pytorch/common_utils/smooth_value.py index ce54196fe..30cb89d60 100755 --- a/cv/classification/efficientnet_b4/pytorch/common_utils/smooth_value.py +++ b/cv/classification/efficientnet_b4/pytorch/common_utils/smooth_value.py @@ -1,6 +1,6 @@ +# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. + from collections import defaultdict, deque import datetime @@ -72,4 +72,4 @@ class SmoothedValue(object): avg=self.avg, global_avg=self.global_avg, max=self.max, - value=self.value) + value=self.value) \ No newline at end of file diff --git a/cv/classification/efficientnet_b4/pytorch/train.py b/cv/classification/efficientnet_b4/pytorch/train.py index 98e92eba3..949b9470e 100755 --- a/cv/classification/efficientnet_b4/pytorch/train.py +++ b/cv/classification/efficientnet_b4/pytorch/train.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import datetime diff --git a/cv/classification/googlenet/pytorch/__init__.py b/cv/classification/googlenet/pytorch/__init__.py index 70667c25f..6faec1658 100755 --- a/cv/classification/googlenet/pytorch/__init__.py +++ b/cv/classification/googlenet/pytorch/__init__.py @@ -1,17 +1,3 @@ -# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# 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/common_utils/__init__.py b/cv/classification/googlenet/pytorch/common_utils/__init__.py index 7e6377c90..32e8c4f57 100755 --- a/cv/classification/googlenet/pytorch/common_utils/__init__.py +++ b/cv/classification/googlenet/pytorch/common_utils/__init__.py @@ -1,11 +1,3 @@ -# 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 random import numpy as np diff --git a/cv/classification/googlenet/pytorch/common_utils/misc.py b/cv/classification/googlenet/pytorch/common_utils/misc.py index 3e366eca5..c9b501cf8 100755 --- a/cv/classification/googlenet/pytorch/common_utils/misc.py +++ b/cv/classification/googlenet/pytorch/common_utils/misc.py @@ -1,11 +1,3 @@ -# 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 os import sys import errno diff --git a/cv/classification/googlenet/pytorch/common_utils/smooth_value.py b/cv/classification/googlenet/pytorch/common_utils/smooth_value.py index d4e3d2b6f..30cb89d60 100755 --- a/cv/classification/googlenet/pytorch/common_utils/smooth_value.py +++ b/cv/classification/googlenet/pytorch/common_utils/smooth_value.py @@ -1,5 +1,4 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. +# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. @@ -73,4 +72,4 @@ class SmoothedValue(object): avg=self.avg, global_avg=self.global_avg, max=self.max, - value=self.value) + value=self.value) \ No newline at end of file diff --git a/cv/classification/googlenet/pytorch/dataloader/__init__.py b/cv/classification/googlenet/pytorch/dataloader/__init__.py index 23eeb3777..e69de29bb 100755 --- a/cv/classification/googlenet/pytorch/dataloader/__init__.py +++ b/cv/classification/googlenet/pytorch/dataloader/__init__.py @@ -1,8 +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. diff --git a/cv/classification/googlenet/pytorch/dataloader/utils/__init__.py b/cv/classification/googlenet/pytorch/dataloader/utils/__init__.py index 23eeb3777..e69de29bb 100755 --- a/cv/classification/googlenet/pytorch/dataloader/utils/__init__.py +++ b/cv/classification/googlenet/pytorch/dataloader/utils/__init__.py @@ -1,8 +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. diff --git a/cv/classification/googlenet/pytorch/train.py b/cv/classification/googlenet/pytorch/train.py index 63d1ccb4e..bc6a458e3 100755 --- a/cv/classification/googlenet/pytorch/train.py +++ b/cv/classification/googlenet/pytorch/train.py @@ -1,17 +1,4 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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) 2022 Iluvatar CoreX. All rights reserved. # 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 31a4eebae..3d34c4df0 100755 --- a/cv/classification/googlenet/pytorch/utils_.py +++ b/cv/classification/googlenet/pytorch/utils_.py @@ -1,18 +1,6 @@ +# 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. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# 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/resnet50/pytorch/__init__.py b/cv/classification/resnet50/pytorch/__init__.py index 38ed0d0b2..6faec1658 100644 --- a/cv/classification/resnet50/pytorch/__init__.py +++ b/cv/classification/resnet50/pytorch/__init__.py @@ -1,17 +1,3 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/resnet50/pytorch/common_utils/__init__.py b/cv/classification/resnet50/pytorch/common_utils/__init__.py index 855a91a92..32e8c4f57 100644 --- a/cv/classification/resnet50/pytorch/common_utils/__init__.py +++ b/cv/classification/resnet50/pytorch/common_utils/__init__.py @@ -1,17 +1,3 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/resnet50/pytorch/common_utils/dist.py b/cv/classification/resnet50/pytorch/common_utils/dist.py index ac4831fba..ea56ca267 100644 --- a/cv/classification/resnet50/pytorch/common_utils/dist.py +++ b/cv/classification/resnet50/pytorch/common_utils/dist.py @@ -1,5 +1,4 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. +# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/classification/resnet50/pytorch/common_utils/misc.py b/cv/classification/resnet50/pytorch/common_utils/misc.py index 3e366eca5..c9b501cf8 100644 --- a/cv/classification/resnet50/pytorch/common_utils/misc.py +++ b/cv/classification/resnet50/pytorch/common_utils/misc.py @@ -1,11 +1,3 @@ -# 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 os import sys import errno diff --git a/cv/classification/resnet50/pytorch/dataloader/__init__.py b/cv/classification/resnet50/pytorch/dataloader/__init__.py index 23eeb3777..e69de29bb 100644 --- a/cv/classification/resnet50/pytorch/dataloader/__init__.py +++ b/cv/classification/resnet50/pytorch/dataloader/__init__.py @@ -1,8 +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. diff --git a/cv/classification/resnet50/pytorch/dataloader/utils/__init__.py b/cv/classification/resnet50/pytorch/dataloader/utils/__init__.py index 23eeb3777..e69de29bb 100644 --- a/cv/classification/resnet50/pytorch/dataloader/utils/__init__.py +++ b/cv/classification/resnet50/pytorch/dataloader/utils/__init__.py @@ -1,8 +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. diff --git a/cv/classification/resnet50/pytorch/dataloader/utils/presets_classification.py b/cv/classification/resnet50/pytorch/dataloader/utils/presets_classification.py index b2b518d02..b3f559af4 100644 --- a/cv/classification/resnet50/pytorch/dataloader/utils/presets_classification.py +++ b/cv/classification/resnet50/pytorch/dataloader/utils/presets_classification.py @@ -1,17 +1,3 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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) 2022 Iluvatar CoreX. All rights reserved. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/classification/resnet50/pytorch/train.py b/cv/classification/resnet50/pytorch/train.py index 3e13694d0..03feeb0a0 100644 --- a/cv/classification/resnet50/pytorch/train.py +++ b/cv/classification/resnet50/pytorch/train.py @@ -1,5 +1,4 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. +# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import datetime diff --git a/cv/classification/seresnext/pytorch/seresnext.py b/cv/classification/seresnext/pytorch/seresnext.py index 8785f87ac..8c6def1cd 100644 --- a/cv/classification/seresnext/pytorch/seresnext.py +++ b/cv/classification/seresnext/pytorch/seresnext.py @@ -1,17 +1,3 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 functools import partial from torchvision.models.resnet import _resnet diff --git a/cv/detection/fasterrcnn/pytorch/dataloaders/transforms_det.py b/cv/detection/fasterrcnn/pytorch/dataloaders/transforms_det.py index 3df4d47f0..405e760c0 100644 --- a/cv/detection/fasterrcnn/pytorch/dataloaders/transforms_det.py +++ b/cv/detection/fasterrcnn/pytorch/dataloaders/transforms_det.py @@ -1,5 +1,4 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. +# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 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 5fac573bb..f0701ce8d 100644 --- a/cv/detection/fasterrcnn/pytorch/start_scripts/get_num_devices.sh +++ b/cv/detection/fasterrcnn/pytorch/start_scripts/get_num_devices.sh @@ -1,18 +1,5 @@ #!/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 686347477..1c2d7f9ec 100644 --- a/cv/detection/fasterrcnn/pytorch/start_scripts/init_torch.sh +++ b/cv/detection/fasterrcnn/pytorch/start_scripts/init_torch.sh @@ -1,16 +1,3 @@ #!/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 00566f825..72400ed0b 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,18 +1,3 @@ -#!/bin/bash -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 93790ccea..cff0d78d6 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,18 +1,3 @@ -#!/bin/bash -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 2d26c3cc1..395bc09c4 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,18 +1,3 @@ -#!/bin/bash -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 37405b9db..37b813b2f 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,18 +1,3 @@ -#!/bin/bash -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/VOC2012_sample \ diff --git a/cv/detection/fasterrcnn/pytorch/train.py b/cv/detection/fasterrcnn/pytorch/train.py index ff4e99813..0370396b7 100644 --- a/cv/detection/fasterrcnn/pytorch/train.py +++ b/cv/detection/fasterrcnn/pytorch/train.py @@ -1,5 +1,4 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. +# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. r"""PyTorch Detection Training. diff --git a/cv/detection/fasterrcnn/pytorch/utils/dist.py b/cv/detection/fasterrcnn/pytorch/utils/dist.py index dcd2330d1..e23dc5146 100644 --- a/cv/detection/fasterrcnn/pytorch/utils/dist.py +++ b/cv/detection/fasterrcnn/pytorch/utils/dist.py @@ -1,5 +1,4 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. +# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/detection/fasterrcnn/pytorch/utils/smooth_value.py b/cv/detection/fasterrcnn/pytorch/utils/smooth_value.py index bfe9279f4..4014b96e4 100644 --- a/cv/detection/fasterrcnn/pytorch/utils/smooth_value.py +++ b/cv/detection/fasterrcnn/pytorch/utils/smooth_value.py @@ -1,5 +1,4 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. +# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. @@ -74,4 +73,4 @@ class SmoothedValue(object): avg=self.avg, global_avg=self.global_avg, max=self.max, - value=self.value) + value=self.value) \ No newline at end of file diff --git a/cv/detection/retinanet/pytorch/common_utils/dist.py b/cv/detection/retinanet/pytorch/common_utils/dist.py index 6b6fe4154..ea56ca267 100644 --- a/cv/detection/retinanet/pytorch/common_utils/dist.py +++ b/cv/detection/retinanet/pytorch/common_utils/dist.py @@ -1,6 +1,6 @@ +# 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. + from collections import defaultdict, deque import datetime diff --git a/cv/detection/retinanet/pytorch/common_utils/metric_logger.py b/cv/detection/retinanet/pytorch/common_utils/metric_logger.py index 2c70e32fc..960641c4d 100644 --- a/cv/detection/retinanet/pytorch/common_utils/metric_logger.py +++ b/cv/detection/retinanet/pytorch/common_utils/metric_logger.py @@ -1,6 +1,6 @@ +# 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. + from collections import defaultdict import datetime diff --git a/cv/detection/retinanet/pytorch/common_utils/smooth_value.py b/cv/detection/retinanet/pytorch/common_utils/smooth_value.py index 32c7e6337..30cb89d60 100644 --- a/cv/detection/retinanet/pytorch/common_utils/smooth_value.py +++ b/cv/detection/retinanet/pytorch/common_utils/smooth_value.py @@ -1,6 +1,6 @@ +# 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. + from collections import defaultdict, deque import datetime diff --git a/cv/detection/retinanet/pytorch/dataloader/detection.py b/cv/detection/retinanet/pytorch/dataloader/detection.py index 7558f5da4..ecd66e196 100644 --- a/cv/detection/retinanet/pytorch/dataloader/detection.py +++ b/cv/detection/retinanet/pytorch/dataloader/detection.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# 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 diff --git a/cv/detection/retinanet/pytorch/dataloader/utils/coco_utils.py b/cv/detection/retinanet/pytorch/dataloader/utils/coco_utils.py index 4cc0b0f2b..cef31f4a8 100644 --- a/cv/detection/retinanet/pytorch/dataloader/utils/coco_utils.py +++ b/cv/detection/retinanet/pytorch/dataloader/utils/coco_utils.py @@ -1,6 +1,6 @@ +# 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. + import copy import os diff --git a/cv/detection/retinanet/pytorch/dataloader/utils/pascal_voc.py b/cv/detection/retinanet/pytorch/dataloader/utils/pascal_voc.py index d8c46a4c2..d60942541 100644 --- a/cv/detection/retinanet/pytorch/dataloader/utils/pascal_voc.py +++ b/cv/detection/retinanet/pytorch/dataloader/utils/pascal_voc.py @@ -1,6 +1,6 @@ +# 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. + from collections import OrderedDict import cv2 diff --git a/cv/detection/retinanet/pytorch/dataloader/utils/presets_detection.py b/cv/detection/retinanet/pytorch/dataloader/utils/presets_detection.py index 5263e1bb4..75946f078 100644 --- a/cv/detection/retinanet/pytorch/dataloader/utils/presets_detection.py +++ b/cv/detection/retinanet/pytorch/dataloader/utils/presets_detection.py @@ -1,6 +1,6 @@ +# 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. + from . import transforms_det as T diff --git a/cv/detection/retinanet/pytorch/dataloader/utils/presets_segmentation.py b/cv/detection/retinanet/pytorch/dataloader/utils/presets_segmentation.py index b123f2314..45e0d029b 100644 --- a/cv/detection/retinanet/pytorch/dataloader/utils/presets_segmentation.py +++ b/cv/detection/retinanet/pytorch/dataloader/utils/presets_segmentation.py @@ -1,6 +1,6 @@ +# 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. + from . import transforms_seg as T diff --git a/cv/detection/retinanet/pytorch/dataloader/utils/transforms_det.py b/cv/detection/retinanet/pytorch/dataloader/utils/transforms_det.py index 3df4d47f0..405e760c0 100644 --- a/cv/detection/retinanet/pytorch/dataloader/utils/transforms_det.py +++ b/cv/detection/retinanet/pytorch/dataloader/utils/transforms_det.py @@ -1,5 +1,4 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. +# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. diff --git a/cv/detection/retinanet/pytorch/engine.py b/cv/detection/retinanet/pytorch/engine.py index 0e64fb571..9afb3bdad 100644 --- a/cv/detection/retinanet/pytorch/engine.py +++ b/cv/detection/retinanet/pytorch/engine.py @@ -1,6 +1,5 @@ +# 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. import math import sys diff --git a/cv/detection/retinanet/pytorch/train.py b/cv/detection/retinanet/pytorch/train.py index 92ebe8fb9..59e8c73ae 100644 --- a/cv/detection/retinanet/pytorch/train.py +++ b/cv/detection/retinanet/pytorch/train.py @@ -1,5 +1,4 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. +# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. r"""PyTorch Detection Training. diff --git a/cv/ocr/dbnet/pytorch/configs/_base_/det_datasets/icdar2015.py b/cv/ocr/dbnet/pytorch/configs/_base_/det_datasets/icdar2015.py index 6e14ae222..bcbabfb00 100755 --- a/cv/ocr/dbnet/pytorch/configs/_base_/det_datasets/icdar2015.py +++ b/cv/ocr/dbnet/pytorch/configs/_base_/det_datasets/icdar2015.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. dataset_type = 'IcdarDataset' data_root = 'OCR_Detect' diff --git a/cv/ocr/dbnet/pytorch/configs/_base_/det_models/dbnet_r18_fpnc.py b/cv/ocr/dbnet/pytorch/configs/_base_/det_models/dbnet_r18_fpnc.py index 4d9fa24e1..98f0896d0 100755 --- a/cv/ocr/dbnet/pytorch/configs/_base_/det_models/dbnet_r18_fpnc.py +++ b/cv/ocr/dbnet/pytorch/configs/_base_/det_models/dbnet_r18_fpnc.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. model = dict( type='DBNet', backbone=dict( diff --git a/cv/ocr/dbnet/pytorch/configs/_base_/det_pipelines/dbnet_pipeline.py b/cv/ocr/dbnet/pytorch/configs/_base_/det_pipelines/dbnet_pipeline.py index cd0433641..40eee02db 100755 --- a/cv/ocr/dbnet/pytorch/configs/_base_/det_pipelines/dbnet_pipeline.py +++ b/cv/ocr/dbnet/pytorch/configs/_base_/det_pipelines/dbnet_pipeline.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) diff --git a/cv/ocr/dbnet/pytorch/configs/textdet/dbnet/dbnet_r18_fpnc_1200e_icdar2015.py b/cv/ocr/dbnet/pytorch/configs/textdet/dbnet/dbnet_r18_fpnc_1200e_icdar2015.py index 40ca14bc3..467903fef 100755 --- a/cv/ocr/dbnet/pytorch/configs/textdet/dbnet/dbnet_r18_fpnc_1200e_icdar2015.py +++ b/cv/ocr/dbnet/pytorch/configs/textdet/dbnet/dbnet_r18_fpnc_1200e_icdar2015.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. _base_ = [ '../../_base_/default_runtime.py', '../../_base_/schedules/schedule_sgd_1200e.py', diff --git a/cv/ocr/dbnet/pytorch/configs/textdet/dbnet/dbnet_r50dcnv2_fpnc_1200e_icdar2015.py b/cv/ocr/dbnet/pytorch/configs/textdet/dbnet/dbnet_r50dcnv2_fpnc_1200e_icdar2015.py index a7eee5a97..6089f1e59 100755 --- a/cv/ocr/dbnet/pytorch/configs/textdet/dbnet/dbnet_r50dcnv2_fpnc_1200e_icdar2015.py +++ b/cv/ocr/dbnet/pytorch/configs/textdet/dbnet/dbnet_r50dcnv2_fpnc_1200e_icdar2015.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. _base_ = [ '../../_base_/default_runtime.py', '../../_base_/schedules/schedule_sgd_1200e.py', diff --git a/cv/ocr/dbnet/pytorch/dbnet/__init__.py b/cv/ocr/dbnet/pytorch/dbnet/__init__.py index ed46a6711..c8dd39597 100755 --- a/cv/ocr/dbnet/pytorch/dbnet/__init__.py +++ b/cv/ocr/dbnet/pytorch/dbnet/__init__.py @@ -56,15 +56,15 @@ assert (dbnet_cv_version >= digit_version(dbnet_cv_minimum_version) f'Please use DBNET_CV >= {dbnet_cv_minimum_version}, ' \ f'<= {dbnet_cv_maximum_version} instead.' -# dbnet_det_minimum_version = '2.21.0' -# dbnet_det_maximum_version = '3.0.0' -# dbnet_det_version = digit_version(dbnet_det.__version__) +# mmdet_minimum_version = '2.21.0' +# mmdet_maximum_version = '3.0.0' +# mmdet_version = digit_version(mmdet.__version__) -# assert (dbnet_det_version >= digit_version(dbnet_det_minimum_version) -# and dbnet_det_version <= digit_version(dbnet_det_maximum_version)), \ -# f'dbnet_detection {dbnet_det.__version__} is incompatible ' \ +# assert (mmdet_version >= digit_version(mmdet_minimum_version) +# and mmdet_version <= digit_version(mmdet_maximum_version)), \ +# f'MMDetection {mmdet.__version__} is incompatible ' \ # f'with MMOCR {__version__}. ' \ -# f'Please use dbnet_detection >= {dbnet_det_minimum_version}, ' \ -# f'<= {dbnet_det_maximum_version} instead.' +# f'Please use MMDetection >= {mmdet_minimum_version}, ' \ +# f'<= {mmdet_maximum_version} instead.' __all__ = ['__version__', 'short_version', 'digit_version'] diff --git a/cv/ocr/dbnet/pytorch/dbnet/apis/train.py b/cv/ocr/dbnet/pytorch/dbnet/apis/train.py index 6532a5320..f079e6f82 100755 --- a/cv/ocr/dbnet/pytorch/dbnet/apis/train.py +++ b/cv/ocr/dbnet/pytorch/dbnet/apis/train.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. import warnings diff --git a/cv/ocr/dbnet/pytorch/dbnet/datasets/icdar_dataset.py b/cv/ocr/dbnet/pytorch/dbnet/datasets/icdar_dataset.py index 5881a2c91..fb1717837 100755 --- a/cv/ocr/dbnet/pytorch/dbnet/datasets/icdar_dataset.py +++ b/cv/ocr/dbnet/pytorch/dbnet/datasets/icdar_dataset.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. import dbnet_cv import numpy as np diff --git a/cv/ocr/dbnet/pytorch/dbnet/datasets/pipelines/transforms.py b/cv/ocr/dbnet/pytorch/dbnet/datasets/pipelines/transforms.py index fd2dd6283..83003385c 100755 --- a/cv/ocr/dbnet/pytorch/dbnet/datasets/pipelines/transforms.py +++ b/cv/ocr/dbnet/pytorch/dbnet/datasets/pipelines/transforms.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. import math diff --git a/cv/ocr/dbnet/pytorch/dbnet/models/builder.py b/cv/ocr/dbnet/pytorch/dbnet/models/builder.py index b2e3cdc65..581e7dffa 100755 --- a/cv/ocr/dbnet/pytorch/dbnet/models/builder.py +++ b/cv/ocr/dbnet/pytorch/dbnet/models/builder.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. import warnings diff --git a/cv/ocr/dbnet/pytorch/dbnet/models/common/detectors/single_stage.py b/cv/ocr/dbnet/pytorch/dbnet/models/common/detectors/single_stage.py index 8408ead5c..9c280f12c 100755 --- a/cv/ocr/dbnet/pytorch/dbnet/models/common/detectors/single_stage.py +++ b/cv/ocr/dbnet/pytorch/dbnet/models/common/detectors/single_stage.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. import warnings diff --git a/cv/ocr/dbnet/pytorch/dbnet/models/textdet/dense_heads/db_head.py b/cv/ocr/dbnet/pytorch/dbnet/models/textdet/dense_heads/db_head.py index dc6a68995..a9f7175fc 100755 --- a/cv/ocr/dbnet/pytorch/dbnet/models/textdet/dense_heads/db_head.py +++ b/cv/ocr/dbnet/pytorch/dbnet/models/textdet/dense_heads/db_head.py @@ -85,7 +85,6 @@ class DBHead(HeadMixin, BaseModule): def _init_thr(self, inner_channels, bias=False): in_channels = inner_channels - seq = Sequential( nn.Conv2d( in_channels, inner_channels // 4, 3, padding=1, bias=bias), diff --git a/cv/ocr/dbnet/pytorch/dbnet/models/textdet/detectors/single_stage_text_detector.py b/cv/ocr/dbnet/pytorch/dbnet/models/textdet/detectors/single_stage_text_detector.py index d42abfa5c..e0248902f 100755 --- a/cv/ocr/dbnet/pytorch/dbnet/models/textdet/detectors/single_stage_text_detector.py +++ b/cv/ocr/dbnet/pytorch/dbnet/models/textdet/detectors/single_stage_text_detector.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. import torch diff --git a/cv/ocr/dbnet/pytorch/dbnet/models/textdet/losses/db_loss.py b/cv/ocr/dbnet/pytorch/dbnet/models/textdet/losses/db_loss.py index 4dc0a69e5..531ca7755 100755 --- a/cv/ocr/dbnet/pytorch/dbnet/models/textdet/losses/db_loss.py +++ b/cv/ocr/dbnet/pytorch/dbnet/models/textdet/losses/db_loss.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn.functional as F diff --git a/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/bbox_overlaps.py b/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/bbox_overlaps.py index 2d1102ac1..5d6eb82fc 100755 --- a/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/bbox_overlaps.py +++ b/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/bbox_overlaps.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. import numpy as np diff --git a/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/eval_hooks.py b/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/eval_hooks.py index 5cf56f999..c977c2b48 100755 --- a/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/eval_hooks.py +++ b/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/eval_hooks.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. import bisect import os.path as osp diff --git a/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/mean_ap.py b/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/mean_ap.py index 9b9c55a2e..0e70ebd21 100755 --- a/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/mean_ap.py +++ b/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/mean_ap.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. from multiprocessing import Pool diff --git a/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/recall.py b/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/recall.py index 25b1ca1dc..ba361f199 100755 --- a/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/recall.py +++ b/cv/ocr/dbnet/pytorch/dbnet_det/core/evaluation/recall.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. from collections.abc import Sequence diff --git a/cv/ocr/dbnet/pytorch/dbnet_det/datasets/pipelines/loading.py b/cv/ocr/dbnet/pytorch/dbnet_det/datasets/pipelines/loading.py index 391b32849..1446bcfd3 100755 --- a/cv/ocr/dbnet/pytorch/dbnet_det/datasets/pipelines/loading.py +++ b/cv/ocr/dbnet/pytorch/dbnet_det/datasets/pipelines/loading.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. import os.path as osp diff --git a/cv/ocr/dbnet/pytorch/dbnet_det/datasets/samplers/class_aware_sampler.py b/cv/ocr/dbnet/pytorch/dbnet_det/datasets/samplers/class_aware_sampler.py index f6a17cdbf..28a8e9e6b 100755 --- a/cv/ocr/dbnet/pytorch/dbnet_det/datasets/samplers/class_aware_sampler.py +++ b/cv/ocr/dbnet/pytorch/dbnet_det/datasets/samplers/class_aware_sampler.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. import math diff --git a/cv/ocr/dbnet/pytorch/dbnet_det/models/__init__.py b/cv/ocr/dbnet/pytorch/dbnet_det/models/__init__.py index 65006afdc..1d9c3415a 100755 --- a/cv/ocr/dbnet/pytorch/dbnet_det/models/__init__.py +++ b/cv/ocr/dbnet/pytorch/dbnet_det/models/__init__.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. from .backbones import * # noqa: F401,F403 from .builder import (BACKBONES, DETECTORS, HEADS, LOSSES, NECKS, diff --git a/cv/ocr/dbnet/pytorch/dbnet_det/models/backbones/__init__.py b/cv/ocr/dbnet/pytorch/dbnet_det/models/backbones/__init__.py index 866f54e17..9d0ec69d0 100755 --- a/cv/ocr/dbnet/pytorch/dbnet_det/models/backbones/__init__.py +++ b/cv/ocr/dbnet/pytorch/dbnet_det/models/backbones/__init__.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. # from .csp_darknet import CSPDarknet # from .darknet import Darknet diff --git a/cv/ocr/dbnet/pytorch/dbnet_det/models/detectors/base.py b/cv/ocr/dbnet/pytorch/dbnet_det/models/detectors/base.py index 35a02dbc7..a5353df8c 100755 --- a/cv/ocr/dbnet/pytorch/dbnet_det/models/detectors/base.py +++ b/cv/ocr/dbnet/pytorch/dbnet_det/models/detectors/base.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. from abc import ABCMeta, abstractmethod from collections import OrderedDict diff --git a/cv/ocr/dbnet/pytorch/dbnet_det/models/detectors/single_stage.py b/cv/ocr/dbnet/pytorch/dbnet_det/models/detectors/single_stage.py index 1b6b2d391..ae3f1b29c 100755 --- a/cv/ocr/dbnet/pytorch/dbnet_det/models/detectors/single_stage.py +++ b/cv/ocr/dbnet/pytorch/dbnet_det/models/detectors/single_stage.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. import warnings diff --git a/cv/ocr/dbnet/pytorch/dbnet_det/models/utils/__init__.py b/cv/ocr/dbnet/pytorch/dbnet_det/models/utils/__init__.py index 848e7eabc..2682bb0c9 100755 --- a/cv/ocr/dbnet/pytorch/dbnet_det/models/utils/__init__.py +++ b/cv/ocr/dbnet/pytorch/dbnet_det/models/utils/__init__.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. # from .brick_wrappers import AdaptiveAvgPool2d, adaptive_avg_pool2d # from .builder import build_linear_layer, build_transformer diff --git a/cv/ocr/dbnet/pytorch/dbnet_det/utils/__init__.py b/cv/ocr/dbnet/pytorch/dbnet_det/utils/__init__.py index d0c3a821d..17e93409e 100755 --- a/cv/ocr/dbnet/pytorch/dbnet_det/utils/__init__.py +++ b/cv/ocr/dbnet/pytorch/dbnet_det/utils/__init__.py @@ -9,7 +9,6 @@ from .logger import get_caller_name, get_root_logger, log_img_scale # from .split_batch import split_batch from .util_distribution import build_ddp, build_dp, get_device - # __all__ = [ # 'get_root_logger', 'collect_env', 'find_latest_checkpoint', # 'update_data_root', 'setup_multi_processes', 'get_caller_name', diff --git a/cv/ocr/dbnet/pytorch/dbnet_det/utils/logger.py b/cv/ocr/dbnet/pytorch/dbnet_det/utils/logger.py index d9736e700..2de27f607 100755 --- a/cv/ocr/dbnet/pytorch/dbnet_det/utils/logger.py +++ b/cv/ocr/dbnet/pytorch/dbnet_det/utils/logger.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. import inspect import logging diff --git a/cv/ocr/dbnet/pytorch/tools/analyze_logs.py b/cv/ocr/dbnet/pytorch/tools/analyze_logs.py index 5ad1b7645..c0714c508 100755 --- a/cv/ocr/dbnet/pytorch/tools/analyze_logs.py +++ b/cv/ocr/dbnet/pytorch/tools/analyze_logs.py @@ -1,5 +1,3 @@ -# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) OpenMMLab. All rights reserved. """Modified from https://github.com/open- mmlab/mmdetection/blob/master/tools/analysis_tools/analyze_logs.py.""" diff --git a/cv/ocr/satrn/pytorch/base/apis/__init__.py b/cv/ocr/satrn/pytorch/base/apis/__init__.py index 6708a6fd3..776a08dd8 100755 --- a/cv/ocr/satrn/pytorch/base/apis/__init__.py +++ b/cv/ocr/satrn/pytorch/base/apis/__init__.py @@ -1,7 +1,4 @@ # Copyright (c) OpenMMLab. All rights reserved. -# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. - from .train import init_random_seed, train_detector from .utils import (disable_text_recog_aug_test, replace_image_to_tensor, tensor2grayimgs) diff --git a/cv/ocr/satrn/pytorch/base/basic_utils/__init__.py b/cv/ocr/satrn/pytorch/base/basic_utils/__init__.py index b5264a747..489d60df6 100755 --- a/cv/ocr/satrn/pytorch/base/basic_utils/__init__.py +++ b/cv/ocr/satrn/pytorch/base/basic_utils/__init__.py @@ -21,5 +21,5 @@ __all__ = [ 'equal_len', 'is_2dlist', 'valid_boundary', 'lmdb_converter', 'drop_orientation', 'convert_annotations', 'is_not_png', 'list_to_file', 'list_from_file', 'is_on_same_line', 'stitch_boxes_into_lines', - 'StringStrip', 'revert_sync_batchnorm' + 'StringStrip', 'revert_sync_batchnorm' ] diff --git a/cv/ocr/satrn/pytorch/base/basic_utils/lmdb_util.py b/cv/ocr/satrn/pytorch/base/basic_utils/lmdb_util.py index 21215eaf8..d62902061 100755 --- a/cv/ocr/satrn/pytorch/base/basic_utils/lmdb_util.py +++ b/cv/ocr/satrn/pytorch/base/basic_utils/lmdb_util.py @@ -46,7 +46,3 @@ def lmdb_converter(img_list_file, output, batch_size=1000, coding='utf-8'): value = str(len(lines)).encode(coding) txn.put(key, value) print('done', flush=True) - - - - diff --git a/cv/ocr/satrn/pytorch/base/csrc/build.sh b/cv/ocr/satrn/pytorch/base/csrc/build.sh index cb72716d2..f891e76cb 100755 --- a/cv/ocr/satrn/pytorch/base/csrc/build.sh +++ b/cv/ocr/satrn/pytorch/base/csrc/build.sh @@ -1,18 +1,4 @@ #!/bin/bash -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. MAX_JOBS=${MAX_JOBS:-$(nproc --all)} PYTHON_PATH=$(which python3) diff --git a/cv/ocr/satrn/pytorch/base/csrc/clean.sh b/cv/ocr/satrn/pytorch/base/csrc/clean.sh index 5d2ddf3e6..2b2cd07bb 100755 --- a/cv/ocr/satrn/pytorch/base/csrc/clean.sh +++ b/cv/ocr/satrn/pytorch/base/csrc/clean.sh @@ -1,17 +1,3 @@ -# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# 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 c0ddeb3f0..017388ad9 100755 --- a/cv/ocr/satrn/pytorch/base/csrc/install.sh +++ b/cv/ocr/satrn/pytorch/base/csrc/install.sh @@ -1,17 +1,3 @@ -# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# 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 dbce4e59b..16281fe0b 100755 --- a/cv/ocr/satrn/pytorch/base/csrc/satrn/__init__.py +++ b/cv/ocr/satrn/pytorch/base/csrc/satrn/__init__.py @@ -1,15 +1 @@ -# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# 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/ocrcv/__init__.py b/cv/ocr/satrn/pytorch/base/ocrcv/__init__.py index 01fa080e4..461b113b0 100755 --- a/cv/ocr/satrn/pytorch/base/ocrcv/__init__.py +++ b/cv/ocr/satrn/pytorch/base/ocrcv/__init__.py @@ -1,7 +1,4 @@ # Copyright (c) Open-MMLab. All rights reserved. -# Copyright (c) 2022, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. - from .fileio import * from .image import * from .utils import * diff --git a/cv/ocr/satrn/pytorch/base/ocrcv/runner/epoch_based_runner.py b/cv/ocr/satrn/pytorch/base/ocrcv/runner/epoch_based_runner.py index 71458c840..5cb5cebc7 100755 --- a/cv/ocr/satrn/pytorch/base/ocrcv/runner/epoch_based_runner.py +++ b/cv/ocr/satrn/pytorch/base/ocrcv/runner/epoch_based_runner.py @@ -1,5 +1,3 @@ -# Copyright (c) 2023-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. # Copyright (c) Open-MMLab. All rights reserved. import os.path as osp import platform diff --git a/cv/semantic_segmentation/unet3d/pytorch/common_utils/dist.py b/cv/semantic_segmentation/unet3d/pytorch/common_utils/dist.py index ce1f87807..1d5cb4b16 100644 --- a/cv/semantic_segmentation/unet3d/pytorch/common_utils/dist.py +++ b/cv/semantic_segmentation/unet3d/pytorch/common_utils/dist.py @@ -1,6 +1,6 @@ +# 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. + from collections import defaultdict, deque import datetime 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 2c70e32fc..960641c4d 100644 --- a/cv/semantic_segmentation/unet3d/pytorch/common_utils/metric_logger.py +++ b/cv/semantic_segmentation/unet3d/pytorch/common_utils/metric_logger.py @@ -1,6 +1,6 @@ +# 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. + from collections import defaultdict import datetime 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 32c7e6337..30cb89d60 100644 --- a/cv/semantic_segmentation/unet3d/pytorch/common_utils/smooth_value.py +++ b/cv/semantic_segmentation/unet3d/pytorch/common_utils/smooth_value.py @@ -1,6 +1,6 @@ +# 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. + from collections import defaultdict, deque import datetime diff --git a/cv/semantic_segmentation/unet3d/pytorch/prepare.sh b/cv/semantic_segmentation/unet3d/pytorch/prepare.sh index 10d1829c0..f7e5389e4 100644 --- a/cv/semantic_segmentation/unet3d/pytorch/prepare.sh +++ b/cv/semantic_segmentation/unet3d/pytorch/prepare.sh @@ -1,18 +1,4 @@ #!/bin/bash -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. apt update -y apt install -y numactl git wget diff --git a/cv/tracking/fairmot/pytorch/src/lib/logger.py b/cv/tracking/fairmot/pytorch/src/lib/logger.py index 628d3fff0..b74f2e565 100644 --- a/cv/tracking/fairmot/pytorch/src/lib/logger.py +++ b/cv/tracking/fairmot/pytorch/src/lib/logger.py @@ -1,17 +1,3 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 78280575b..211042717 100644 --- a/cv/tracking/fairmot/pytorch/src/lib/opts.py +++ b/cv/tracking/fairmot/pytorch/src/lib/opts.py @@ -1,17 +1,3 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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) 2022 Iluvatar CoreX. All rights reserved. # Copyright (c) ifzhang. All Rights Reserved. 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 e8ec9d385..cae8d41b0 100644 --- a/cv/tracking/fairmot/pytorch/src/lib/trains/base_trainer.py +++ b/cv/tracking/fairmot/pytorch/src/lib/trains/base_trainer.py @@ -1,17 +1,3 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/track.py b/cv/tracking/fairmot/pytorch/src/track.py index 03b7e71ad..a6f50c86a 100644 --- a/cv/tracking/fairmot/pytorch/src/track.py +++ b/cv/tracking/fairmot/pytorch/src/track.py @@ -1,5 +1,3 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. 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 ac2876ec3..86549f936 100644 --- a/cv/tracking/fairmot/pytorch/src/train.py +++ b/cv/tracking/fairmot/pytorch/src/train.py @@ -1,17 +1,3 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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) 2022 Iluvatar CoreX. All rights reserved. # Copyright (c) ifzhang. All Rights Reserved. diff --git a/cv/tracking/fairmot/pytorch/train_dla34_mot17.sh b/cv/tracking/fairmot/pytorch/train_dla34_mot17.sh index e26dcf5c1..c4f644e90 100644 --- a/cv/tracking/fairmot/pytorch/train_dla34_mot17.sh +++ b/cv/tracking/fairmot/pytorch/train_dla34_mot17.sh @@ -1,18 +1,4 @@ -#!/bin/bash -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 python3 src/train.py mot --exp_id mot17_dla34 --data_cfg './src/lib/cfg/mot17.json' "$@" exit $? diff --git a/cv/tracking/fairmot/pytorch/train_hrnet18_mot17.sh b/cv/tracking/fairmot/pytorch/train_hrnet18_mot17.sh index 73925f21b..7db4338b4 100644 --- a/cv/tracking/fairmot/pytorch/train_hrnet18_mot17.sh +++ b/cv/tracking/fairmot/pytorch/train_hrnet18_mot17.sh @@ -1,18 +1,4 @@ -#!/bin/bash -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 python3 ./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 80f979dcd..8fb2b6180 100644 --- a/cv/tracking/fairmot/pytorch/train_hrnet32_mot17.sh +++ b/cv/tracking/fairmot/pytorch/train_hrnet32_mot17.sh @@ -1,18 +1,4 @@ -#!/bin/bash -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 python3 ./src/train.py mot --exp_id mot17_hrnet32 --arch 'hrnet_32' \ --data_cfg './src/lib/cfg/mot17.json' \ 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 edf734fb4..eb20925d0 100644 --- a/nlp/language_model/bert/pytorch/fwd_loss_bwd_trainer.py +++ b/nlp/language_model/bert/pytorch/fwd_loss_bwd_trainer.py @@ -1,8 +1,7 @@ # coding=utf-8 +# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. # Copyright (c) 2019-2021 NVIDIA CORPORATION. All rights reserved. # Copyright 2020 MLBenchmark Group. 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. diff --git a/nlp/language_model/bert/pytorch/run_pretraining.py b/nlp/language_model/bert/pytorch/run_pretraining.py index 6336fdc77..bcb01e477 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, Shanghai Iluvatar CoreX Semiconductor Co., Ltd +# Copyright (c) 2022 Iluvatar CoreX. All rights reserved. # 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 e2d69cd36..771c5021c 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,18 +1,3 @@ -#!/bin/bash -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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"} @@ -50,4 +35,4 @@ run_pretraining.py --init_checkpoint ${DATA}/model.ckpt-28252.apex.pt \ --seed=17103 --skip_checkpoint \ --train_batch_size 81 --learning_rate=3.6e-4 \ --max_steps 7400 --eval_batch_size 52 \ ---gradient_accumulation_steps=3 "$@" +--gradient_accumulation_steps=3 "$@" \ No newline at end of file diff --git a/recommendation/ctr/dlrm/pytorch/dlrm/dist_model.py b/recommendation/ctr/dlrm/pytorch/dlrm/dist_model.py index d5c4f9184..467fb9ba2 100644 --- a/recommendation/ctr/dlrm/pytorch/dlrm/dist_model.py +++ b/recommendation/ctr/dlrm/pytorch/dlrm/dist_model.py @@ -1,17 +1,3 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """Distributed version of DLRM model In order to code the hybrid decomposition, the model code needs to be restructured. I don't know a clean enough diff --git a/recommendation/ctr/dlrm/pytorch/scripts/dist_train.py b/recommendation/ctr/dlrm/pytorch/scripts/dist_train.py index 1e9879c90..bf915d111 100644 --- a/recommendation/ctr/dlrm/pytorch/scripts/dist_train.py +++ b/recommendation/ctr/dlrm/pytorch/scripts/dist_train.py @@ -1,17 +1,3 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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/recommendation/ctr/dlrm/pytorch/scripts/train.py b/recommendation/ctr/dlrm/pytorch/scripts/train.py index 1f91b22c4..51fe8d218 100644 --- a/recommendation/ctr/dlrm/pytorch/scripts/train.py +++ b/recommendation/ctr/dlrm/pytorch/scripts/train.py @@ -1,17 +1,3 @@ -# Copyright (c) 2022-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """Reference training script Only Criteo data is supported at the moment, one hot embedding. """ diff --git a/speech/speech_synthesis/tacotron2/pytorch/loss_scaler.py b/speech/speech_synthesis/tacotron2/pytorch/loss_scaler.py index 0662a60e2..88cc9cf29 100644 --- a/speech/speech_synthesis/tacotron2/pytorch/loss_scaler.py +++ b/speech/speech_synthesis/tacotron2/pytorch/loss_scaler.py @@ -1,131 +1,131 @@ -import torch - -class LossScaler: - - def __init__(self, scale=1): - self.cur_scale = scale - - # `params` is a list / generator of torch.Variable - def has_overflow(self, params): - return False - - # `x` is a torch.Tensor - def _has_inf_or_nan(x): - return False - - # `overflow` is boolean indicating whether we overflowed in gradient - def update_scale(self, overflow): - pass - - @property - def loss_scale(self): - return self.cur_scale - - def scale_gradient(self, module, grad_in, grad_out): - return tuple(self.loss_scale * g for g in grad_in) - - def backward(self, loss): - scaled_loss = loss*self.loss_scale - scaled_loss.backward() - -class DynamicLossScaler: - - def __init__(self, - init_scale=2**32, - scale_factor=2., - scale_window=1000): - self.cur_scale = init_scale - self.cur_iter = 0 - self.last_overflow_iter = -1 - self.scale_factor = scale_factor - self.scale_window = scale_window - - # `params` is a list / generator of torch.Variable - def has_overflow(self, params): -# return False - for p in params: - if p.grad is not None and DynamicLossScaler._has_inf_or_nan(p.grad.data): - return True - - return False - - # `x` is a torch.Tensor - def _has_inf_or_nan(x): - cpu_sum = float(x.float().sum()) - if cpu_sum == float('inf') or cpu_sum == -float('inf') or cpu_sum != cpu_sum: - return True - return False - - # `overflow` is boolean indicating whether we overflowed in gradient - def update_scale(self, overflow): - if overflow: - #self.cur_scale /= self.scale_factor - self.cur_scale = max(self.cur_scale/self.scale_factor, 1) - self.last_overflow_iter = self.cur_iter - else: - if (self.cur_iter - self.last_overflow_iter) % self.scale_window == 0: - self.cur_scale *= self.scale_factor -# self.cur_scale = 1 - self.cur_iter += 1 - - @property - def loss_scale(self): - return self.cur_scale - - def scale_gradient(self, module, grad_in, grad_out): - return tuple(self.loss_scale * g for g in grad_in) - - def backward(self, loss): - scaled_loss = loss*self.loss_scale - scaled_loss.backward() - -############################################################## -# Example usage below here -- assuming it's in a separate file -############################################################## -if __name__ == "__main__": - import torch - from torch.autograd import Variable - from dynamic_loss_scaler import DynamicLossScaler - - # N is batch size; D_in is input dimension; - # H is hidden dimension; D_out is output dimension. - N, D_in, H, D_out = 64, 1000, 100, 10 - - # Create random Tensors to hold inputs and outputs, and wrap them in Variables. - x = Variable(torch.randn(N, D_in), requires_grad=False) - y = Variable(torch.randn(N, D_out), requires_grad=False) - - w1 = Variable(torch.randn(D_in, H), requires_grad=True) - w2 = Variable(torch.randn(H, D_out), requires_grad=True) - parameters = [w1, w2] - - learning_rate = 1e-6 - optimizer = torch.optim.SGD(parameters, lr=learning_rate) - loss_scaler = DynamicLossScaler() - - for t in range(500): - y_pred = x.mm(w1).clamp(min=0).mm(w2) - loss = (y_pred - y).pow(2).sum() * loss_scaler.loss_scale - print('Iter {} loss scale: {}'.format(t, loss_scaler.loss_scale)) - print('Iter {} scaled loss: {}'.format(t, loss.data[0])) - print('Iter {} unscaled loss: {}'.format(t, loss.data[0] / loss_scaler.loss_scale)) - - # Run backprop - optimizer.zero_grad() - loss.backward() - - # Check for overflow - has_overflow = DynamicLossScaler.has_overflow(parameters) - - # If no overflow, unscale grad and update as usual - if not has_overflow: - for param in parameters: - param.grad.data.mul_(1. / loss_scaler.loss_scale) - optimizer.step() - # Otherwise, don't do anything -- ie, skip iteration - else: - print('OVERFLOW!') - - # Update loss scale for next iteration - loss_scaler.update_scale(has_overflow) - +import torch + +class LossScaler: + + def __init__(self, scale=1): + self.cur_scale = scale + + # `params` is a list / generator of torch.Variable + def has_overflow(self, params): + return False + + # `x` is a torch.Tensor + def _has_inf_or_nan(x): + return False + + # `overflow` is boolean indicating whether we overflowed in gradient + def update_scale(self, overflow): + pass + + @property + def loss_scale(self): + return self.cur_scale + + def scale_gradient(self, module, grad_in, grad_out): + return tuple(self.loss_scale * g for g in grad_in) + + def backward(self, loss): + scaled_loss = loss*self.loss_scale + scaled_loss.backward() + +class DynamicLossScaler: + + def __init__(self, + init_scale=2**32, + scale_factor=2., + scale_window=1000): + self.cur_scale = init_scale + self.cur_iter = 0 + self.last_overflow_iter = -1 + self.scale_factor = scale_factor + self.scale_window = scale_window + + # `params` is a list / generator of torch.Variable + def has_overflow(self, params): +# return False + for p in params: + if p.grad is not None and DynamicLossScaler._has_inf_or_nan(p.grad.data): + return True + + return False + + # `x` is a torch.Tensor + def _has_inf_or_nan(x): + cpu_sum = float(x.float().sum()) + if cpu_sum == float('inf') or cpu_sum == -float('inf') or cpu_sum != cpu_sum: + return True + return False + + # `overflow` is boolean indicating whether we overflowed in gradient + def update_scale(self, overflow): + if overflow: + #self.cur_scale /= self.scale_factor + self.cur_scale = max(self.cur_scale/self.scale_factor, 1) + self.last_overflow_iter = self.cur_iter + else: + if (self.cur_iter - self.last_overflow_iter) % self.scale_window == 0: + self.cur_scale *= self.scale_factor +# self.cur_scale = 1 + self.cur_iter += 1 + + @property + def loss_scale(self): + return self.cur_scale + + def scale_gradient(self, module, grad_in, grad_out): + return tuple(self.loss_scale * g for g in grad_in) + + def backward(self, loss): + scaled_loss = loss*self.loss_scale + scaled_loss.backward() + +############################################################## +# Example usage below here -- assuming it's in a separate file +############################################################## +if __name__ == "__main__": + import torch + from torch.autograd import Variable + from dynamic_loss_scaler import DynamicLossScaler + + # N is batch size; D_in is input dimension; + # H is hidden dimension; D_out is output dimension. + N, D_in, H, D_out = 64, 1000, 100, 10 + + # Create random Tensors to hold inputs and outputs, and wrap them in Variables. + x = Variable(torch.randn(N, D_in), requires_grad=False) + y = Variable(torch.randn(N, D_out), requires_grad=False) + + w1 = Variable(torch.randn(D_in, H), requires_grad=True) + w2 = Variable(torch.randn(H, D_out), requires_grad=True) + parameters = [w1, w2] + + learning_rate = 1e-6 + optimizer = torch.optim.SGD(parameters, lr=learning_rate) + loss_scaler = DynamicLossScaler() + + for t in range(500): + y_pred = x.mm(w1).clamp(min=0).mm(w2) + loss = (y_pred - y).pow(2).sum() * loss_scaler.loss_scale + print('Iter {} loss scale: {}'.format(t, loss_scaler.loss_scale)) + print('Iter {} scaled loss: {}'.format(t, loss.data[0])) + print('Iter {} unscaled loss: {}'.format(t, loss.data[0] / loss_scaler.loss_scale)) + + # Run backprop + optimizer.zero_grad() + loss.backward() + + # Check for overflow + has_overflow = DynamicLossScaler.has_overflow(parameters) + + # If no overflow, unscale grad and update as usual + if not has_overflow: + for param in parameters: + param.grad.data.mul_(1. / loss_scaler.loss_scale) + optimizer.step() + # Otherwise, don't do anything -- ie, skip iteration + else: + print('OVERFLOW!') + + # Update loss scale for next iteration + loss_scaler.update_scale(has_overflow) + diff --git a/speech/speech_synthesis/tacotron2/pytorch/train.py b/speech/speech_synthesis/tacotron2/pytorch/train.py index 36e7bb9be..c7091460b 100644 --- a/speech/speech_synthesis/tacotron2/pytorch/train.py +++ b/speech/speech_synthesis/tacotron2/pytorch/train.py @@ -1,5 +1,3 @@ -# Copyright (c) 2023-2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. -# All Rights Reserved. import os import sys import time -- Gitee