from config import model | |
from mmcv.utils import Config | |
from mmdet.models import build_detector | |
import torch | |
def main(): | |
print(f"Model type: {model['type']}") | |
detector = build_detector(model, train_cfg=model.get('train_cfg'), test_cfg=model.get('test_cfg')) | |
detector.eval() | |
print(detector) | |
dummy_input = torch.randn(1, 3, 800, 1333) | |
with torch.no_grad(): | |
output = detector.forward_dummy(dummy_input) | |
print("Forward output:", output) | |
if __name__ == "__main__": | |
main() | |