Skip to content

Commit

Permalink
update the progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
dailenson authored and dai gang committed Dec 17, 2023
1 parent 8ae31a9 commit 457bb76
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ def main(opt):
if opt.sample_size == 'all':
batch_samples = len(test_loader)
else:
batch_samples = int(opt.sample_size)*len(writer_dict)/cfg.TRAIN.IMS_PER_BATCH
batch_samples = int(opt.sample_size)*len(writer_dict)//cfg.TRAIN.IMS_PER_BATCH

batch_num, num_count= 0, 0
data_iter = iter(test_loader)
with torch.no_grad():
for data in tqdm.tqdm(test_loader):
for _ in tqdm.tqdm(range(batch_samples)):
batch_num += 1
if batch_num > batch_samples:
break
else:
data = next(data_iter)
# prepare input
coords, coords_len, character_id, writer_id, img_list, char_img = data['coords'].cuda(), \
data['coords_len'].cuda(), \
Expand Down

0 comments on commit 457bb76

Please sign in to comment.