File size: 723 Bytes
6dd59cc
c197dad
 
 
2cec8f9
c197dad
 
 
2cec8f9
c197dad
 
2cec8f9
c197dad
 
 
 
 
 
 
 
 
 
 
2cec8f9
c68a924
c197dad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from config import MLP
from mmcv import Config
from mmdet.models import build_detector
import torch

def main():
    # Print model type from config
    print(f"Model type: {MLP['type']}")

    # Build the model from the config dict
    model = build_detector(MLP, train_cfg=MLP.get('train_cfg'), test_cfg=MLP.get('test_cfg'))

    # Set model to evaluation mode
    model.eval()

    # Print model architecture summary
    print(model)

    # Optional: dummy input test (batch of 1 image with 3 channels, 800x1333)
    dummy_input = torch.randn(1, 3, 800, 1333)
    with torch.no_grad():
        result = model.forward_dummy(dummy_input)
        print("Forward pass output:", result)

if __name__ == "__main__":
    main()