|
@@ -1,4 +1,5 @@
|
|
|
import os
|
|
|
+import time
|
|
|
|
|
|
import torch
|
|
|
from torch.utils.tensorboard import SummaryWriter
|
|
@@ -144,9 +145,17 @@ class Trainer(BaseTrainer):
|
|
|
model.eval()
|
|
|
with torch.no_grad():
|
|
|
for batch_idx, (imgs, targets) in enumerate(data_loader_val):
|
|
|
+ t_start = time.time()
|
|
|
+ print(f'start to predict:{t_start}')
|
|
|
pred = model(self.move_to_device(imgs, self.device))
|
|
|
- pred_ = box_line_(pred) # 将box与line对应
|
|
|
- show_(imgs, pred_, epoch, writer)
|
|
|
+ # t_end = time.time()
|
|
|
+ # print(f'predict used:{t_end - t_start}')
|
|
|
+ # t_start=time.time()
|
|
|
+ # print(f'start to box_line:{t_start}')
|
|
|
+ # pred_ = box_line_(pred) # 将box与line对应
|
|
|
+ # t_end=time.time()
|
|
|
+ # print(f'box_line_ used:{t_end-t_start}')
|
|
|
+ # show_(imgs, pred_, epoch, writer)
|
|
|
if batch_idx == 0:
|
|
|
show_line(imgs[0], pred, epoch, writer)
|
|
|
break
|