add .gitignore in the alldata directory

This commit is contained in:
2025-07-21 18:37:41 +08:00
parent c10b0719c7
commit 5343c29e1b
16 changed files with 9860 additions and 4 deletions

View File

@@ -213,6 +213,7 @@ def train(opt, show_number = 2, amp=False):
preds = model(image, text).log_softmax(2)
preds_size = torch.IntTensor([preds.size(1)] * batch_size)
preds = preds.permute(1, 0, 2)
print(f"preds shape : {preds.shape}")
torch.backends.cudnn.enabled = False
cost = criterion(preds, text.to(device), preds_size.to(device), length.to(device))
torch.backends.cudnn.enabled = True
@@ -265,6 +266,9 @@ def train(opt, show_number = 2, amp=False):
#show_number = min(show_number, len(labels))
start = random.randint(0,len(labels) - show_number )
print(f"start index for showing results: {start}")
print(f"labels length: {len(labels)}")
print(f"labels : {labels}")
for gt, pred, confidence in zip(labels[start:start+show_number], preds[start:start+show_number], confidence_score[start:start+show_number]):
if 'Attn' in opt.Prediction:
gt = gt[:gt.find('[s]')]