提交 d67b5efe 编写于 作者: Y Yizhuang Zhou 提交者: Xinran Xu

update pretrained models & fix pycocotools

1. add pretrained resnet152, snetv2_0.5x, 1.5x and 2.0x
2. move `import pycocotools` inside `main` to prevernt import error
上级 fa9e459e
......@@ -60,8 +60,12 @@ export PYTHONPATH=/path/to/models:$PYTHONPATH
| ResNet34 | 73.960 | 91.630 |
| ResNet50 | 76.254 | 93.056 |
| ResNet101 | 77.944 | 93.844 |
| ResNet152 | 78.582 | 94.130 |
| ResNeXt50 32x4d | 77.592 | 93.644 |
| ShuffleNetV2 x1.0 | 69.369 | 88.793 |
| ShuffleNetV2 x0.5 | 60.696 | 82.190 |
| ShuffleNetV2 x1.0 | 69.372 | 88.764 |
| ShuffleNetV2 x1.5 | 72.806 | 90.792 |
| ShuffleNetV2 x2.0 | 75.074 | 92.278 |
### 目标检测
......
......@@ -12,6 +12,7 @@
| ResNet34 | 73.960 | 91.630 |
| ResNet50 | 76.254 | 93.056 |
| ResNet101 | 77.944 | 93.844 |
| ResNet152 | 78.582 | 94.130 |
| ResNeXt50 32x4d | 77.592 | 93.644 |
用户可以通过`megengine.hub`直接加载本目录下定义好的模型,例如:
......
......@@ -341,6 +341,9 @@ def resnet101(**kwargs):
return ResNet(Bottleneck, [3, 4, 23, 3], **kwargs)
@hub.pretrained(
"https://data.megengine.org.cn/models/weights/resnet152_fbaug_78582_7551aff3.pkl"
)
def resnet152(**kwargs):
r"""ResNet-152 model from
`"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf>`_
......
......@@ -8,7 +8,10 @@
| 模型 | top1 acc | top5 acc |
| --- | --- | --- |
| shufflenet_v2_x1_0 | 69.369 | 88.793 |
| ShuffleNetV2 x0.5 | 60.696 | 82.190 |
| ShuffleNetV2 x1.0 | 69.372 | 88.764 |
| ShuffleNetV2 x1.5 | 72.806 | 90.792 |
| ShuffleNetV2 x2.0 | 75.074 | 92.278 |
用户可以通过`megengine.hub`直接加载本目录下定义好的模型,例如:
......
......@@ -216,10 +216,16 @@ class ShuffleNetV2(M.Module):
M.init.fill_(m.bias, 0)
@hub.pretrained(
"https://data.megengine.org.cn/models/weights/snetv2_x2_0_75115_497d4601.pkl"
)
def shufflenet_v2_x2_0(num_classes=1000):
return ShuffleNetV2(num_classes=num_classes, model_size="2.0x")
@hub.pretrained(
"https://data.megengine.org.cn/models/weights/snetv2_x1_5_72775_38ac4273.pkl"
)
def shufflenet_v2_x1_5(num_classes=1000):
return ShuffleNetV2(num_classes=num_classes, model_size="1.5x")
......@@ -231,5 +237,8 @@ def shufflenet_v2_x1_0(num_classes=1000):
return ShuffleNetV2(num_classes=num_classes, model_size="1.0x")
@hub.pretrained(
"https://data.megengine.org.cn/models/weights/snetv2_x0_5_60750_c28db1a2.pkl"
)
def shufflenet_v2_x0_5(num_classes=1000):
return ShuffleNetV2(num_classes=num_classes, model_size="0.5x")
......@@ -21,8 +21,6 @@ from megengine import jit
from megengine.data import DataLoader, SequentialSampler
from megengine.data.dataset import COCO as COCODataset
from tqdm import tqdm
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from official.vision.detection.tools.nms import py_cpu_nms
......@@ -272,6 +270,9 @@ def make_parser():
def main():
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
parser = make_parser()
args = parser.parse_args()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册