-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Image generation] added progress bar to C++ samples
- Loading branch information
1 parent
7ef754c
commit d254b1e
Showing
7 changed files
with
62 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (C) 2023-2025 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "indicators/progress_bar.hpp" | ||
|
||
bool progress_bar(size_t step, size_t num_steps, ov::Tensor& /* latent */) { | ||
using namespace indicators; | ||
|
||
static ProgressBar bar{ | ||
option::BarWidth{50}, | ||
option::ForegroundColor{Color::green}, | ||
option::FontStyles{std::vector<FontStyle>{FontStyle::bold}}, | ||
option::ShowElapsedTime{true}, | ||
option::ShowRemainingTime{true}, | ||
}; | ||
|
||
std::stringstream stream; | ||
stream << "Image generation step " << (step + 1) << " / " << num_steps; | ||
|
||
bar.set_option(option::PostfixText{stream.str()}); | ||
bar.set_progress((100 * (step + 1)) / num_steps); | ||
|
||
return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters