Skip to content
Snippets Groups Projects
Verified Commit 12e08320 authored by Mélodie Boillet's avatar Mélodie Boillet
Browse files

Add tqdm during mean and std computation

parent 32e4cddb
No related branches found
No related tags found
1 merge request!448Add tqdm during mean and std computation
......@@ -7,6 +7,7 @@ import json
import numpy as np
from torch.utils.data import Dataset
from tqdm import tqdm
from dan.datasets.utils import natural_sort
from dan.utils import read_image, token_to_ind
......@@ -132,7 +133,7 @@ class OCRDataset(Dataset):
diff = np.zeros((3,))
nb_pixels = 0
for metric in ["mean", "std"]:
for ind in range(len(self.samples)):
for ind in tqdm(range(len(self.samples)), desc=f"Computing {metric} value"):
img = np.array(self.get_sample_img(ind))
if metric == "mean":
total += np.sum(img, axis=(0, 1))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment