AI / app.py
Moditha24's picture
Update app.py
c197dad verified
raw
history blame
723 Bytes
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()