Skip to content

Commit 60fb20d

Browse files
author
Mark-ZhouWX
committed
optimize comment
1 parent 8464384 commit 60fb20d

17 files changed

+2
-229
lines changed

research/segment-anything/segment_anything/__init__.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# All rights reserved.
3-
4-
# This source code is licensed under the license found in the
5-
# LICENSE file in the root directory of this source tree.
6-
71
from .build_sam import (
82
build_sam,
93
build_sam_vit_h,

research/segment-anything/segment_anything/automatic_mask_generator.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# All rights reserved.
3-
4-
# This source code is licensed under the license found in the
5-
# LICENSE file in the root directory of this source tree.
6-
71
import numpy as np
82
import mindspore as ms
93
from mindspore import ops

research/segment-anything/segment_anything/build_sam.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# All rights reserved.
3-
4-
# This source code is licensed under the license found in the
5-
# LICENSE file in the root directory of this source tree.
61
import os.path
72

83
import mindspore as ms

research/segment-anything/segment_anything/evaluate/evaluator.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import mindspore as ms
44
from mindspore import nn
5-
from mindspore.dataset import RepeatDataset
5+
from mindspore.dataset import BatchDataset
66
from tqdm import tqdm
77

88
from segment_anything.utils import logger
@@ -15,7 +15,7 @@ class Evaluator:
1515
"""
1616
def __init__(self,
1717
network: nn.Cell,
18-
data_loader: RepeatDataset,
18+
data_loader: BatchDataset,
1919
metric: List[ms.train.Metric],
2020
input_column: List[List[str]],
2121
):

research/segment-anything/segment_anything/evaluate/metrics.py

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def eval(self):
4040
num_step = all_reduce(self.num_step)
4141
miou = sum_iou / num_step
4242
print(sum_iou, num_step, miou)
43-
# miou = self.sum_iou / self.num_step
4443
miou = miou.asnumpy()
4544
res_dict = dict(miou=miou)
4645
return res_dict

research/segment-anything/segment_anything/modeling/__init__.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# All rights reserved.
3-
4-
# This source code is licensed under the license found in the
5-
# LICENSE file in the root directory of this source tree.
6-
71
from .sam import Sam
82
from .image_encoder import ImageEncoderViT
93
from .mask_decoder import MaskDecoder

research/segment-anything/segment_anything/modeling/common.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# All rights reserved.
3-
4-
# This source code is licensed under the license found in the
5-
# LICENSE file in the root directory of this source tree.
6-
71
import mindspore as ms
82
from mindspore import nn, ops
93

research/segment-anything/segment_anything/modeling/image_encoder.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# All rights reserved.
3-
4-
# This source code is licensed under the license found in the
5-
# LICENSE file in the root directory of this source tree.
6-
71
import mindspore as ms
82
from mindspore import nn, ops
93

research/segment-anything/segment_anything/modeling/mask_decoder.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# All rights reserved.
3-
4-
# This source code is licensed under the license found in the
5-
# LICENSE file in the root directory of this source tree.
6-
71
import mindspore as ms
82
from mindspore import nn, ops
93

research/segment-anything/segment_anything/modeling/prompt_encoder.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# All rights reserved.
3-
4-
# This source code is licensed under the license found in the
5-
# LICENSE file in the root directory of this source tree.
6-
71
import numpy as np
82
import mindspore as ms
93
from mindspore import nn, ops

research/segment-anything/segment_anything/modeling/sam.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# All rights reserved.
3-
4-
# This source code is licensed under the license found in the
5-
# LICENSE file in the root directory of this source tree.
6-
71
import mindspore as ms
82
from mindspore import nn, ops
93

research/segment-anything/segment_anything/modeling/transformer.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# All rights reserved.
3-
4-
# This source code is licensed under the license found in the
5-
# LICENSE file in the root directory of this source tree.
6-
71
import mindspore as ms
82
from mindspore import Tensor, nn, ops
93

research/segment-anything/segment_anything/predictor.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# All rights reserved.
3-
4-
# This source code is licensed under the license found in the
5-
# LICENSE file in the root directory of this source tree.
6-
71
import numpy as np
82
import mindspore as ms
93

Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# All rights reserved.
3-
4-
# This source code is licensed under the license found in the
5-
# LICENSE file in the root directory of this source tree.

research/segment-anything/segment_anything/utils/amg.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# All rights reserved.
3-
4-
# This source code is licensed under the license found in the
5-
# LICENSE file in the root directory of this source tree.
6-
71
import numpy as np
82
import mindspore as ms
93
from mindspore import ops

research/segment-anything/segment_anything/utils/onnx.py

-144
This file was deleted.

research/segment-anything/segment_anything/utils/transforms.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# All rights reserved.
3-
4-
# This source code is licensed under the license found in the
5-
# LICENSE file in the root directory of this source tree.
6-
71
import numpy as np
82
import mindspore as ms
93
from mindspore import ops

0 commit comments

Comments
 (0)