You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
452 B
21 lines
452 B
# Copyright (c) OpenMMLab. All rights reserved.
|
|
import torch
|
|
|
|
from mmpose.models.backbones import AlexNet
|
|
|
|
|
|
def test_alexnet_backbone():
|
|
"""Test alexnet backbone."""
|
|
model = AlexNet(-1)
|
|
model.train()
|
|
|
|
imgs = torch.randn(1, 3, 256, 192)
|
|
feat = model(imgs)
|
|
assert feat.shape == (1, 256, 7, 5)
|
|
|
|
model = AlexNet(1)
|
|
model.train()
|
|
|
|
imgs = torch.randn(1, 3, 224, 224)
|
|
feat = model(imgs)
|
|
assert feat.shape == (1, 1)
|
|
|