diff --git a/README.md b/README.md index ac8a18d3795bb16a8ff721c582d2182e525caeec..460bad5df09eb345d79762a3d60b8c1d4f64fdf8 100644 --- a/README.md +++ b/README.md @@ -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 | ### 目标检测 diff --git a/official/vision/classification/resnet/README.md b/official/vision/classification/resnet/README.md index c00e575aadc527b5b1b94cfaf394f423dd8b5066..c418db18b44cf5a4d6cd96fb2d15ab56da3077c9 100644 --- a/official/vision/classification/resnet/README.md +++ b/official/vision/classification/resnet/README.md @@ -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`直接加载本目录下定义好的模型,例如: diff --git a/official/vision/classification/resnet/model.py b/official/vision/classification/resnet/model.py index 0022bcdd84815cce480ec4086fceda80e1903027..8321082e6a0c3e10ec2478aa493ad03bb46c6859 100644 --- a/official/vision/classification/resnet/model.py +++ b/official/vision/classification/resnet/model.py @@ -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" `_ diff --git a/official/vision/classification/shufflenet/README.md b/official/vision/classification/shufflenet/README.md index f132137cc28565f3dccaab3033fb25789d910ffc..e60648ef3066f2cbcba814dcd4928fffc7a63e7b 100644 --- a/official/vision/classification/shufflenet/README.md +++ b/official/vision/classification/shufflenet/README.md @@ -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`直接加载本目录下定义好的模型,例如: diff --git a/official/vision/classification/shufflenet/model.py b/official/vision/classification/shufflenet/model.py index 096a6a6b65246af0a7c4b200540e5e55317d3ba5..fcd65450a24623dba28f36b2a13fe4335340d900 100644 --- a/official/vision/classification/shufflenet/model.py +++ b/official/vision/classification/shufflenet/model.py @@ -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") diff --git a/official/vision/detection/tools/test.py b/official/vision/detection/tools/test.py index 0d55fe59bf0b46935727c6e8c2316861262c8814..27f30decf20961cb064bc576a97e0afeffd223db 100644 --- a/official/vision/detection/tools/test.py +++ b/official/vision/detection/tools/test.py @@ -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()