未验证 提交 d028d74e 编写于 作者: W Wanli 提交者: GitHub

fix some error and bugs (#112)

上级 6c59fd8a
......@@ -39,8 +39,8 @@ if __name__ == '__main__':
models = {
'v1': MobileNetV1(modelPath='./image_classification_mobilenetv1_2022apr.onnx', labelPath=args.label, backendId=args.backend, targetId=args.target),
'v2': MobileNetV2(modelPath='./image_classification_mobilenetv2_2022apr.onnx', labelPath=args.label, backendId=args.backend, targetId=args.target),
'v1-q': MobileNetV1(modelPath='./image_classification_mobilenetv1_2022apr-act_int8-wt_int8-quantized.onnx', labelPath=args.label, backendId=args.backend, targetId=args.target),
'v2-q': MobileNetV2(modelPath='./image_classification_mobilenetv2_2022apr-act_int8-wt_int8-quantized.onnx', labelPath=args.label, backendId=args.backend, targetId=args.target)
'v1-q': MobileNetV1(modelPath='./image_classification_mobilenetv1_2022apr-int8-quantized.onnx', labelPath=args.label, backendId=args.backend, targetId=args.target),
'v2-q': MobileNetV2(modelPath='./image_classification_mobilenetv2_2022apr-int8-quantized.onnx', labelPath=args.label, backendId=args.backend, targetId=args.target)
}
model = models[args.model]
......
......@@ -21,7 +21,7 @@ class MobileNetV1:
self.std=[0.229, 0.224, 0.225]
# load labels
self.labels = self._load_labels()
self._labels = self._load_labels()
def _load_labels(self):
labels = []
......@@ -68,7 +68,7 @@ class MobileNetV1:
for o in output_blob:
class_id_list = o.argsort()[::-1][:self.top_k]
batched_class_id_list.append(class_id_list)
if len(self.labels) > 0:
if len(self._labels) > 0:
batched_predicted_labels = []
for class_id_list in batched_class_id_list:
predicted_labels = []
......
......@@ -21,7 +21,7 @@ class MobileNetV2:
self.std=[0.229, 0.224, 0.225]
# load labels
self.labels = self._load_labels()
self._labels = self._load_labels()
def _load_labels(self):
labels = []
......@@ -68,7 +68,7 @@ class MobileNetV2:
for o in output_blob:
class_id_list = o.argsort()[::-1][:self.top_k]
batched_class_id_list.append(class_id_list)
if len(self.labels) > 0:
if len(self._labels) > 0:
batched_predicted_labels = []
for class_id_list in batched_class_id_list:
predicted_labels = []
......
......@@ -19,7 +19,7 @@ Supported datasets:
- [ImageNet](#imagenet)
- [WIDERFace](#widerface)
- [LFW](#lfw)
- [ICDAR](#icdar)
- [ICDAR](#ICDAR2003)
- [IIIT5K](#iiit5k)
## ImageNet
......
......@@ -51,7 +51,7 @@ evaluation: # optional. required if use
ImagenetRaw:
data_path: /path/to/imagenet/val
image_list: /path/to/imagenet/val.txt # download from http://dl.caffe.berkeleyvision.org/caffe_ilsvrc12.tar.gz
transform:
transform:
Rescale: {}
Resize:
size: 256
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册