Update app.py
Browse files
app.py
CHANGED
@@ -1,26 +1,20 @@
|
|
1 |
-
from config import
|
2 |
from mmcv import Config
|
3 |
from mmdet.models import build_detector
|
4 |
import torch
|
5 |
|
6 |
def main():
|
7 |
-
|
8 |
-
print(f"Model type: {MLP['type']}")
|
9 |
|
10 |
-
|
11 |
-
|
12 |
|
13 |
-
|
14 |
-
model.eval()
|
15 |
|
16 |
-
# Print model architecture summary
|
17 |
-
print(model)
|
18 |
-
|
19 |
-
# Optional: dummy input test (batch of 1 image with 3 channels, 800x1333)
|
20 |
dummy_input = torch.randn(1, 3, 800, 1333)
|
21 |
with torch.no_grad():
|
22 |
-
|
23 |
-
print("Forward
|
24 |
|
25 |
if __name__ == "__main__":
|
26 |
main()
|
|
|
1 |
+
from config import model
|
2 |
from mmcv import Config
|
3 |
from mmdet.models import build_detector
|
4 |
import torch
|
5 |
|
6 |
def main():
|
7 |
+
print(f"Model type: {model['type']}")
|
|
|
8 |
|
9 |
+
detector = build_detector(model, train_cfg=model.get('train_cfg'), test_cfg=model.get('test_cfg'))
|
10 |
+
detector.eval()
|
11 |
|
12 |
+
print(detector)
|
|
|
13 |
|
|
|
|
|
|
|
|
|
14 |
dummy_input = torch.randn(1, 3, 800, 1333)
|
15 |
with torch.no_grad():
|
16 |
+
output = detector.forward_dummy(dummy_input)
|
17 |
+
print("Forward output:", output)
|
18 |
|
19 |
if __name__ == "__main__":
|
20 |
main()
|