Skip to content

Commit cb081df

Browse files
authored
Add mobilenet qdq model (#313)
1 parent 68feb4d commit cb081df

File tree

4 files changed

+499
-1
lines changed

4 files changed

+499
-1
lines changed

image_classification/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
<label class="btn btn-outline-info" id="float16Label">
7171
<input type="radio" name="layout" id="float16" autocomplete="off">Float16
7272
</label>
73+
<label class="btn btn-outline-info" id="uint8Label">
74+
<input type="radio" name="layout" id="uint8" autocomplete="off">Uint8
75+
</label>
7376
</div>
7477
</div>
7578
</div>

image_classification/main.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {ResNet50V1FP16Nchw} from './resnet50v1_fp16_nchw.js';
44
import {EfficientNetFP16Nchw} from './efficientnet_fp16_nchw.js';
55
import {MobileNetV2Nchw} from './mobilenet_nchw.js';
66
import {MobileNetV2Nhwc} from './mobilenet_nhwc.js';
7+
import {MobileNetV2Uint8Nhwc} from './mobilenet_uint8_nhwc.js';
78
import {SqueezeNetNchw} from './squeezenet_nchw.js';
89
import {SqueezeNetNhwc} from './squeezenet_nhwc.js';
910
import {ResNet50V2Nchw} from './resnet50v2_nchw.js';
@@ -52,6 +53,9 @@ const modelList = {
5253
'squeezenet',
5354
'resnet50v2',
5455
],
56+
'uint8': [
57+
'mobilenet',
58+
],
5559
},
5660
'gpu': {
5761
'float32': [
@@ -102,16 +106,19 @@ $('#backendBtns .btn').on('change', async (e) => {
102106
if (backendId == 'webnn_gpu') {
103107
ui.handleBtnUI('#float16Label', false);
104108
ui.handleBtnUI('#float32Label', false);
109+
ui.handleBtnUI('#uint8Label', true);
105110
$('#float32').click();
106111
utils.displayAvailableModels(modelList, modelIds, deviceType, dataType);
107112
} else if (backendId == 'webnn_npu') {
108113
ui.handleBtnUI('#float16Label', false);
109114
ui.handleBtnUI('#float32Label', true);
115+
ui.handleBtnUI('#uint8Label', true);
110116
$('#float16').click();
111117
utils.displayAvailableModels(modelList, modelIds, deviceType, 'float16');
112118
} else {
113119
ui.handleBtnUI('#float16Label', true);
114120
ui.handleBtnUI('#float32Label', false);
121+
ui.handleBtnUI('#uint8Label', false);
115122
$('#float32').click();
116123
utils.displayAvailableModels(modelList, modelIds, deviceType, 'float32');
117124
}
@@ -130,6 +137,8 @@ $('#modelBtns .btn').on('change', async (e) => {
130137
modelName = modelId;
131138
if (dataType == 'float16') {
132139
modelName += 'fp16';
140+
} else if (dataType == 'uint8') {
141+
modelName += 'uint8';
133142
}
134143

135144
await main();
@@ -298,6 +307,7 @@ function constructNetObject(type) {
298307
'efficientnetfp16nchw': new EfficientNetFP16Nchw(),
299308
'mobilenetnchw': new MobileNetV2Nchw(),
300309
'mobilenetnhwc': new MobileNetV2Nhwc(),
310+
'mobilenetuint8nhwc': new MobileNetV2Uint8Nhwc(),
301311
'squeezenetnchw': new SqueezeNetNchw(),
302312
'squeezenetnhwc': new SqueezeNetNhwc(),
303313
'resnet50v2nchw': new ResNet50V2Nchw(),

0 commit comments

Comments
 (0)