Skip to content

Commit

Permalink
Removed irrelevant changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-savelyevv committed Sep 25, 2023
1 parent da10c34 commit 6ebe749
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 29 deletions.
24 changes: 0 additions & 24 deletions examples/post_training_quantization/openvino/mobilenet_v2/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,30 +102,6 @@ def get_model_size(ir_path: str, m_type: str = "Mb", verbose: bool = True) -> fl
)
val_data_loader = torch.utils.data.DataLoader(val_dataset, batch_size=1, shuffle=False)

class Loader:
def __init__(self, dataloader):
self.dataloader = dataloader
self.i = 0

def __iter__(self):
self.i = 0
self.iter = self.dataloader.__iter__()
return self

def __next__(self):
if self.i > 100:
raise StopIteration
self.i += 1
return next(self.iter)

# def __len__(self):
# return 101

# from time import sleep
# from nncf.common.logging.track_progress import track
# for n in track(Loader(val_data_loader)):
# sleep(0.1)

path_to_model = download(MODEL_URL, MODEL_PATH)
ov_model = ov.Core().read_model(path_to_model / "mobilenet_v2_fp32.xml")

Expand Down
17 changes: 12 additions & 5 deletions nncf/common/logging/track_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from rich.style import StyleType
from rich.text import Text

# INTEL_BLUE_COLOR = (0, 174, 239)
INTEL_BLUE_COLOR = (0, 113, 197)


Expand Down Expand Up @@ -51,7 +50,11 @@ def render(self, task: Task) -> Text:


class TimeElapsedColumnWithStyle(ProgressColumn):
"""Renders time elapsed."""
"""
Renders time elapsed.
Similar to TimeElapsedColumn, but with addition of style parameter.
"""

def __init__(self, style: Union[str, StyleType]):
super().__init__()
Expand All @@ -67,7 +70,11 @@ def render(self, task: "Task") -> Text:


class TimeRemainingColumnWithStyle(ProgressColumn):
"""Renders estimated time remaining."""
"""
Renders estimated time remaining.
Similar to TimeRemainingColumn, but with addition of style parameter.
"""

# Only refresh twice a second to prevent jitter
max_refresh = 0.5
Expand Down Expand Up @@ -157,7 +164,7 @@ def __init__(
self.update_period = update_period
self.task = None

text_style = f"rgb{INTEL_BLUE_COLOR}".replace(' ', '')
text_style = f"rgb({INTEL_BLUE_COLOR[0]},{INTEL_BLUE_COLOR[1]},{INTEL_BLUE_COLOR[2]})"

self.columns: List[ProgressColumn] = (
[TextColumn("[progress.description]{task.description}")] if description else []
Expand All @@ -169,7 +176,7 @@ def __init__(
complete_style=complete_style,
finished_style=finished_style,
pulse_style=pulse_style,
bar_width=None
bar_width=None,
),
TaskProgressColumn(show_speed=show_speed),
IterationsColumn(style=text_style),
Expand Down

0 comments on commit 6ebe749

Please sign in to comment.