Skip to content

Commit 12a30a1

Browse files
author
Jianfeng Wang
authored
feat(detection): Detection better adapted to v1.2 (#92)
* fix(models): reformat distributed processing logic * fix(detection): fix an FPN bug, rerun all models * chore(models): update copyright years
1 parent 924d3b8 commit 12a30a1

File tree

138 files changed

+859
-469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+859
-469
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2424
- uses: actions/checkout@v2
25-
25+
2626
- name: Set up Python ${{ matrix.python-version }}
2727
uses: actions/setup-python@v1
2828
with:

hubconf.py

+21-10
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,30 @@
2828
shufflenet_v2_x2_0,
2929
)
3030
from official.vision.detection.configs import (
31-
faster_rcnn_res50_coco_1x_800size,
32-
faster_rcnn_res101_coco_2x_800size,
31+
faster_rcnn_res18_coco_3x_800size,
32+
faster_rcnn_res34_coco_3x_800size,
33+
faster_rcnn_res50_coco_3x_800size,
34+
faster_rcnn_res101_coco_3x_800size,
3335
faster_rcnn_resx101_coco_2x_800size,
34-
retinanet_res50_coco_1x_800size,
35-
retinanet_res101_coco_2x_800size,
36+
retinanet_res18_coco_3x_800size,
37+
retinanet_res34_coco_3x_800size,
38+
retinanet_res50_coco_3x_800size,
39+
retinanet_res101_coco_3x_800size,
3640
retinanet_resx101_coco_2x_800size,
37-
freeanchor_res50_coco_1x_800size,
38-
freeanchor_res101_coco_2x_800size,
39-
fcos_res50_coco_1x_800size,
40-
fcos_res101_coco_2x_800size,
41+
freeanchor_res18_coco_3x_800size,
42+
freeanchor_res34_coco_3x_800size,
43+
freeanchor_res50_coco_3x_800size,
44+
freeanchor_res101_coco_3x_800size,
45+
freeanchor_resx101_coco_2x_800size,
46+
fcos_res18_coco_3x_800size,
47+
fcos_res34_coco_3x_800size,
48+
fcos_res50_coco_3x_800size,
49+
fcos_res101_coco_3x_800size,
4150
fcos_resx101_coco_2x_800size,
42-
atss_res50_coco_1x_800size,
43-
atss_res101_coco_2x_800size,
51+
atss_res18_coco_3x_800size,
52+
atss_res34_coco_3x_800size,
53+
atss_res50_coco_3x_800size,
54+
atss_res101_coco_3x_800size,
4455
atss_resx101_coco_2x_800size,
4556
)
4657
from official.vision.detection.models import FasterRCNN, RetinaNet, FreeAnchor, FCOS, ATSS

official/assets/cat_det_out.jpg

96 Bytes
Loading

official/nlp/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/nlp/bert/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/nlp/bert/config_args.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an
88
# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9-
10-
119
import argparse
1210

1311

official/nlp/bert/model.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44
# ---------------------------------------------------------------------
55
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
66
#
7-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
7+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
88
#
99
# Unless required by applicable law or agreed to in writing,
1010
# software distributed under the License is distributed on an
1111
# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
#
1313
# This file has been modified by Megvii ("Megvii Modifications").
14-
# All Megvii Modifications are Copyright (C) 2014-2020 Megvii Inc. All rights reserved.
14+
# All Megvii Modifications are Copyright (C) 2014-2021 Megvii Inc. All rights reserved.
1515
# ----------------------------------------------------------------------
16-
1716
"""Megengine BERT model."""
1817

1918
import copy

official/nlp/bert/mrpc_dataset.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an
88
# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
99
import csv
1010
import os
1111

12-
from tokenization import BertTokenizer # pylint: disable=import-error
13-
1412
import numpy as np
1513

1614
import megengine as mge
1715
from megengine.data import DataLoader
1816
from megengine.data.dataset import ArrayDataset
1917
from megengine.data.sampler import RandomSampler, SequentialSampler
2018

19+
from official.nlp.bert.tokenization import BertTokenizer
20+
2121
logger = mge.get_logger(__name__)
2222

2323

official/nlp/bert/test.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an
88
# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9-
109
from tqdm import tqdm
1110

12-
from mrpc_dataset import MRPCDataset
13-
1411
import megengine as mge
1512
import megengine.functional as F
1613

1714
from official.nlp.bert.config_args import get_args
1815
from official.nlp.bert.model import BertForSequenceClassification, create_hub_bert
16+
from official.nlp.bert.mrpc_dataset import MRPCDataset
1917

2018
args = get_args()
2119
logger = mge.get_logger(__name__)

official/nlp/bert/tokenization.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
# ---------------------------------------------------------------------
44
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
55
#
6-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
6+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
77
#
88
# Unless required by applicable law or agreed to in writing,
99
# software distributed under the License is distributed on an
1010
# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
#
1212
# This file has been modified by Megvii ("Megvii Modifications").
13-
# All Megvii Modifications are Copyright (C) 2014-2020 Megvii Inc. All rights reserved.
13+
# All Megvii Modifications are Copyright (C) 2014-2021 Megvii Inc. All rights reserved.
1414
# ----------------------------------------------------------------------
1515
"""Tokenization classes."""
1616

official/nlp/bert/train.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an
88
# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9-
109
from tqdm import tqdm
1110

12-
from mrpc_dataset import MRPCDataset
13-
1411
import megengine as mge
1512
import megengine.functional as F
1613
import megengine.optimizer as optim
1714
from megengine.autodiff import GradManager
1815

1916
from official.nlp.bert.config_args import get_args
2017
from official.nlp.bert.model import BertForSequenceClassification, create_hub_bert
18+
from official.nlp.bert.mrpc_dataset import MRPCDataset
2119

2220
args = get_args()
2321
logger = mge.get_logger(__name__)

official/quantization/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/quantization/calibration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/quantization/finetune.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/quantization/inference.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/quantization/models/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/quantization/models/mobilenet_v2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# ------------------------------------------------------------------------------
3232
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
3333
#
34-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
34+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
3535
#
3636
# Unless required by applicable law or agreed to in writing,
3737
# software distributed under the License is distributed on an

official/quantization/models/resnet.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# ------------------------------------------------------------------------------
3232
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
3333
#
34-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
34+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
3535
#
3636
# Unless required by applicable law or agreed to in writing,
3737
# software distributed under the License is distributed on an

official/quantization/models/shufflenet.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# ------------------------------------------------------------------------------
2525
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
2626
#
27-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
27+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
2828
#
2929
# Unless required by applicable law or agreed to in writing,
3030
# software distributed under the License is distributed on an

official/quantization/param_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/quantization/test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/quantization/train.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/vision/classification/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/vision/classification/resnet/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/vision/classification/resnet/inference.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/vision/classification/resnet/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# ------------------------------------------------------------------------------
3232
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
3333
#
34-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
34+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
3535
#
3636
# Unless required by applicable law or agreed to in writing,
3737
# software distributed under the License is distributed on an

official/vision/classification/resnet/test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/vision/classification/resnet/train.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/vision/classification/shufflenet/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/vision/classification/shufflenet/inference.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/vision/classification/shufflenet/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# ------------------------------------------------------------------------------
2525
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
2626
#
27-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
27+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
2828
#
2929
# Unless required by applicable law or agreed to in writing,
3030
# software distributed under the License is distributed on an

official/vision/classification/shufflenet/test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

official/vision/classification/shufflenet/train.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
33
#
4-
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
4+
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
55
#
66
# Unless required by applicable law or agreed to in writing,
77
# software distributed under the License is distributed on an

0 commit comments

Comments
 (0)