Spaces:
Sleeping
Sleeping
Update model/CMFNet.py
Browse files- model/CMFNet.py +0 -17
model/CMFNet.py
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
import torch
|
2 |
import torch.nn as nn
|
3 |
-
from utils import network_parameters
|
4 |
-
from thop import profile
|
5 |
from model.block import SAB, CAB, PAB, conv, SAM, conv3x3, conv_down
|
6 |
|
7 |
##########################################################################
|
@@ -193,18 +191,3 @@ class CMFNet(nn.Module):
|
|
193 |
return [x_final + mixed_img, mixed_img, mix_r[1], x1_img, x2_img, x3_img, x_final]
|
194 |
|
195 |
|
196 |
-
if __name__ == "__main__":
|
197 |
-
import time
|
198 |
-
model = CMFNet()
|
199 |
-
|
200 |
-
for idx, m in enumerate(model.modules()):
|
201 |
-
print(idx, "-", m)
|
202 |
-
s = time.time()
|
203 |
-
|
204 |
-
rgb = torch.ones(1, 3, 256, 256, dtype=torch.float, requires_grad=False)
|
205 |
-
out = model(rgb)
|
206 |
-
flops, params = profile(model, inputs=(rgb,))
|
207 |
-
print('parameters:', params)
|
208 |
-
print('flops', flops)
|
209 |
-
print('time: {:.4f}ms'.format((time.time()-s)*10))
|
210 |
-
|
|
|
1 |
import torch
|
2 |
import torch.nn as nn
|
|
|
|
|
3 |
from model.block import SAB, CAB, PAB, conv, SAM, conv3x3, conv_down
|
4 |
|
5 |
##########################################################################
|
|
|
191 |
return [x_final + mixed_img, mixed_img, mix_r[1], x1_img, x2_img, x3_img, x_final]
|
192 |
|
193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|