Skip to content

Commit dc7fffe

Browse files
committed
clean debug
1 parent 921f2a7 commit dc7fffe

2 files changed

Lines changed: 2 additions & 35 deletions

File tree

app/Graph/acc_check.cpp

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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)});

app/Graph/graph_build.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ int main(int argc, char* argv[]) {
3131
} else {
3232
image_folder = IMAGENET_PATH;
3333
}
34-
std::cout << "Using image folder: " << image_folder << std::endl;
3534

3635
std::vector<std::string> image_paths;
3736
for (const auto& entry : fs::directory_iterator(image_folder)) {
@@ -42,9 +41,6 @@ int main(int argc, char* argv[]) {
4241
}
4342
}
4443

45-
std::cout << "Found " << image_paths.size() << " images to process"
46-
<< std::endl;
47-
4844
std::unordered_map<int, std::string> class_names;
4945
try {
5046
class_names = load_class_names(IMAGENET_LABELS);
@@ -60,10 +56,6 @@ int main(int argc, char* argv[]) {
6056
}
6157

6258
try {
63-
std::cout << "\nProcessing image: " << image_path << std::endl;
64-
std::cout << "Original size: " << image.cols << "x" << image.rows
65-
<< ", channels: " << image.channels() << std::endl;
66-
6759
if (model_name == "alexnet_mnist") {
6860
it_lab_ai::Tensor input = prepare_mnist_image(image);
6961
it_lab_ai::Shape sh1({1, 5, 5, 3});

0 commit comments

Comments
 (0)