You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lightweight C++ library for performing high-performance inference on MNIST handwritten digits using a modified AlexNet architecture. Designed for efficiency and educational purposes, this project demonstrates how classic CNNs can be optimized for small-scale tasks in native environments.
9
+
A lightweight C++ library for performing high-performance inference on classification tasks. Designed for efficiency and educational purposes, this project demonstrates how classic CNNs can be optimized for small-scale tasks in native environments.
10
10
### Key Features:
11
11
12
12
* C++17 implementation for bare-metal performance
13
13
14
14
* Simplified AlexNet for 28×28 grayscale images
15
15
16
+
* Googlenet, Densenet, Resnet and Yolo11x-cls for images of any size
17
+
16
18
* Parallel computing via Intel OneTBB (Threading Building Blocks)
17
19
18
-
* Pre-trained model: AlexNet-model.h5 included
20
+
* Pre-trained model: AlexNet-model.h5, Googlenet.onnx included
19
21
## **Some files used to create the library**
20
22
### Neural network models
21
23
You need to download [Alexnet-model.h5](https://github.com/moizahmed97/Convolutional-Neural-Net-Designer/blob/master/AlexNet-model.h5) to the folder *docs*
@@ -30,9 +32,9 @@ Other models:</br>
30
32
31
33
## **How do I launch the inference?**
32
34
* Make sure you install the project dependencies by running: *pip install -r requirements.txt*
33
-
* You need to run the script *parser.py* that is located in app/AlexNet to read weights from a model *Alexnet-model.h5* and the json file with the weights will be stored in the *docs* folder.
35
+
* You need to run the script *parser.py* that is located in app/converters to read weights from a model *Alexnet-model.h5* or *parser_onnx.py* to read weights from a models ONNX or YOLO and the json file with the weights will be stored in the *docs* folder.
34
36
* Then put the test images in png format in the folder *docs/input*
35
-
* After building the project, which is described below, run Graph_build in folder *build/bin*
37
+
* After building the project, which is described below, run Graph_build with the parameter --model (alexnet_mnist or googlenet or densenet or resnet or yolo) and the parameter --parallel if you need. App Graph_build is located in folder *build/bin*
36
38
37
39
## **Building a Project**
38
40
### *Windows*
@@ -69,7 +71,7 @@ To build and run this project locally on Windows, follow these steps:
69
71
```
70
72
and run the file
71
73
```bash
72
-
Graph_Build.exe
74
+
Graph_Build.exe --model alexnet_mnist
73
75
```
74
76
### *Linux/macOS*
75
77
To build and run this project locally on Linux or macOS, follow these steps:
@@ -116,7 +118,7 @@ To build and run this project locally on Windows, follow these steps:
116
118
```
117
119
and run the file
118
120
```bash
119
-
./Graph_Build
121
+
./Graph_Build --model alexnet_mnist
120
122
```
121
123
122
124
## Test Process
@@ -147,10 +149,14 @@ To start the testing process locally, you need to go to the directory
147
149
./run_test
148
150
```
149
151
150
-
## **Accuracy validation**
152
+
## **Accuracy validation for Alexnet on MNIST**
151
153
To run accuracy validation you need to use the MNIST dataset, which you can download [here](https://github.com/DeepTrackAI/MNIST_dataset/tree/main/mnist/test) and put it in a folder *docs/mnist/mnist/test*
152
-
Now you can run accuracy check - *build\bin\ACC_MNIST.exe*
153
-
***The accuracy should be 98.02%**
154
+
Now you can run accuracy check - *build\bin\ACC.exe --model alexnet_mnist*
155
+
***The accuracy should be 98.01%**
156
+
157
+
## **Accuracy validation for ONNX or YOLO models on ImageNet**
158
+
To run accuracy validation you need to use the ImageNet dataset, which you can download [here](https://www.kaggle.com/datasets/sautkin/imagenet1kvalid) and put it in a folder *docs/Imagenet/*
159
+
Now you can run accuracy check - *build\bin\ACC.exe --model googlenet*
0 commit comments