1- #include < algorithm>
1+ #include < algorithm>
22#include < filesystem>
33#include < iomanip>
44#include < numeric>
@@ -18,30 +18,21 @@ int main(int argc, char* argv[]) {
1818 for (int i = 1 ; i < argc; ++i) {
1919 if (std::string (argv[i]) == " --parallel" ) {
2020 parallel = true ;
21- std::cout << " Parallel mode" << std::endl;
2221 } else if (std::string (argv[i]) == " --model" && i + 1 < argc) {
2322 model_name = argv[++i];
2423 }
2524 }
2625
27- std::cout << " Testing model: " << model_name << std::endl;
28-
2926 std::string dataset_path;
3027 if (model_name == " alexnet_mnist" ) {
3128 dataset_path = MNIST_PATH ;
32- std::cout << " Using MNIST dataset: " << dataset_path << std::endl;
3329 } else {
3430 dataset_path = IMAGENET_ACC ;
35- std::cout << " Using ImageNet dataset: " << dataset_path << std::endl;
3631 }
3732
3833 std::string json_path = model_paths[model_name];
3934 std::vector<int > input_shape = get_input_shape_from_json (json_path);
4035
41- std::cout << " Input shape: " ;
42- for (const auto & dim : input_shape) {
43- std::cout << dim << " " ;
44- }
4536 std::cout << std::endl;
4637
4738 if (model_name == " alexnet_mnist" ) {
@@ -79,7 +70,7 @@ int main(int argc, char* argv[]) {
7970 for (int j = 0 ; j < 28 ; ++j) {
8071 size_t a = ind;
8172 for (size_t n = 0 ; n < name; n++) a += counts[n] + 1 ;
82- res[(a) * 28 * 28 + i * 28 + j] = channels[0 ].at <uchar>(j, i);
73+ res[(a)* 28 * 28 + i * 28 + j] = channels[0 ].at <uchar>(j, i);
8374 }
8475 }
8576 }
@@ -120,7 +111,6 @@ int main(int argc, char* argv[]) {
120111
121112 counts.resize (1000 , 0 );
122113
123- std::cout << " Counting images..." << std::endl;
124114 for (int class_id = 0 ; class_id < 1000 ; ++class_id) {
125115 std::ostringstream folder_oss;
126116 folder_oss << std::setw (5 ) << std::setfill (' 0' ) << class_id;
@@ -136,14 +126,8 @@ int main(int argc, char* argv[]) {
136126 }
137127 }
138128 }
139- if (counts[class_id] > 0 ) {
140- std::cout << " Class " << folder_oss.str () << " (ID: " << class_id
141- << " ): " << counts[class_id] << " images" << std::endl;
142- }
143129 }
144130
145- std::cout << " Total images: " << total_images << std::endl;
146-
147131 if (total_images == 0 ) {
148132 std::cerr << " No images found in dataset path: " << dataset_path
149133 << std::endl;
@@ -157,8 +141,6 @@ int main(int argc, char* argv[]) {
157141
158142 all_image_data.resize (total_images * image_size);
159143
160- std::cout << " Loading and processing images..." << std::endl;
161-
162144 size_t current_index = 0 ;
163145 for (int class_id = 0 ; class_id < 1000 ; ++class_id) {
164146 std::ostringstream folder_oss;
@@ -171,11 +153,6 @@ int main(int argc, char* argv[]) {
171153 if (entry.path ().extension () == " .png" ||
172154 entry.path ().extension () == " .jpg" ||
173155 entry.path ().extension () == " .jpeg" ) {
174- if (current_index % 100 == 0 ) {
175- std::cout << " Processed " << current_index << " /" << total_images
176- << " images" << std::endl;
177- }
178-
179156 cv::Mat image = cv::imread (entry.path ().string ());
180157 if (image.empty ()) {
181158 std::cerr << " Failed to load image: " << entry.path ().string ()
@@ -197,8 +174,6 @@ int main(int argc, char* argv[]) {
197174 }
198175 }
199176
200- std::cout << " All images processed, building graph..." << std::endl;
201-
202177 it_lab_ai::Shape input_shape_imagenet (
203178 {total_images, static_cast <size_t >(channels), static_cast <size_t >(height),
204179 static_cast <size_t >(width)});
0 commit comments