Skip to content

Commit b4fe279

Browse files
committed
Fulfill the proposed deletions
1 parent 001eb6b commit b4fe279

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

src/cleanvision/dataset/utils.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ def build_dataset(
2222
verbose: bool = True,
2323
) -> Dataset:
2424
if data_path:
25-
return FSDataset(data_folder=data_path, storage_opts=storage_opts, verbose=verbose)
25+
return FSDataset(
26+
data_folder=data_path, storage_opts=storage_opts, verbose=verbose
27+
)
2628
elif filepaths:
27-
return FSDataset(filepaths=filepaths, storage_opts=storage_opts, verbose=verbose)
29+
return FSDataset(
30+
filepaths=filepaths, storage_opts=storage_opts, verbose=verbose
31+
)
2832
elif hf_dataset and image_key:
2933
return HFDataset(hf_dataset, image_key)
3034
elif torchvision_dataset:

src/cleanvision/issue_managers/duplicate_issue_manager.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ def find_issues(
126126

127127
results: List[Dict[str, Union[str, int]]] = []
128128
if n_jobs == 1:
129-
for idx in tqdm(dataset.index, leave=verbose, desc="Computing hashes", smoothing=0):
129+
for idx in tqdm(
130+
dataset.index, leave=verbose, desc="Computing hashes", smoothing=0
131+
):
130132
results.append(compute_hash(idx, dataset, to_compute, self.params))
131133
else:
132134
args = [
@@ -145,7 +147,10 @@ def find_issues(
145147
p.imap_unordered(
146148
compute_hash_wrapper, args, chunksize=chunksize
147149
),
148-
total=len(dataset), leave=verbose, desc="Computing hashes", smoothing=0,
150+
total=len(dataset),
151+
leave=verbose,
152+
desc="Computing hashes",
153+
smoothing=0,
149154
)
150155
)
151156

src/cleanvision/issue_managers/image_property_issue_manager.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ def find_issues(
139139
if to_be_computed:
140140
results: List[Dict[str, Union[int, float, str]]] = []
141141
if n_jobs == 1:
142-
for idx in tqdm(dataset.index, leave=verbose, desc="Computing scores", smoothing=0):
142+
for idx in tqdm(
143+
dataset.index, leave=verbose, desc="Computing scores", smoothing=0
144+
):
143145
results.append(
144146
compute_scores(
145147
idx, dataset, to_be_computed, self.image_properties
@@ -162,7 +164,10 @@ def find_issues(
162164
p.imap_unordered(
163165
compute_scores_wrapper, args, chunksize=chunksize
164166
),
165-
total=len(dataset), leave=verbose, desc="Computing scores", smoothing=0,
167+
total=len(dataset),
168+
leave=verbose,
169+
desc="Computing scores",
170+
smoothing=0,
166171
)
167172
)
168173

src/cleanvision/utils/base_issue_manager.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from abc import ABC, abstractmethod
2-
from tabnanny import verbose
32
from typing import Dict, Any
43

54
import pandas as pd

0 commit comments

Comments
 (0)