Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenCV
Opencv Zoo
提交
d028d74e
O
Opencv Zoo
项目概览
OpenCV
/
Opencv Zoo
10 个月 前同步成功
通知
148
Star
400
Fork
122
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv Zoo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
d028d74e
编写于
1月 06, 2023
作者:
W
Wanli
提交者:
GitHub
1月 06, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix some error and bugs (#112)
上级
6c59fd8a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
8 addition
and
8 deletion
+8
-8
models/image_classification_mobilenet/demo.py
models/image_classification_mobilenet/demo.py
+2
-2
models/image_classification_mobilenet/mobilenet_v1.py
models/image_classification_mobilenet/mobilenet_v1.py
+2
-2
models/image_classification_mobilenet/mobilenet_v2.py
models/image_classification_mobilenet/mobilenet_v2.py
+2
-2
tools/eval/README.md
tools/eval/README.md
+1
-1
tools/quantize/inc_configs/mobilenet.yaml
tools/quantize/inc_configs/mobilenet.yaml
+1
-1
未找到文件。
models/image_classification_mobilenet/demo.py
浏览文件 @
d028d74e
...
@@ -39,8 +39,8 @@ if __name__ == '__main__':
...
@@ -39,8 +39,8 @@ if __name__ == '__main__':
models
=
{
models
=
{
'v1'
:
MobileNetV1
(
modelPath
=
'./image_classification_mobilenetv1_2022apr.onnx'
,
labelPath
=
args
.
label
,
backendId
=
args
.
backend
,
targetId
=
args
.
target
),
'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
),
'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
),
'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-
act_int8-wt_
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
]
model
=
models
[
args
.
model
]
...
...
models/image_classification_mobilenet/mobilenet_v1.py
浏览文件 @
d028d74e
...
@@ -21,7 +21,7 @@ class MobileNetV1:
...
@@ -21,7 +21,7 @@ class MobileNetV1:
self
.
std
=
[
0.229
,
0.224
,
0.225
]
self
.
std
=
[
0.229
,
0.224
,
0.225
]
# load labels
# load labels
self
.
labels
=
self
.
_load_labels
()
self
.
_
labels
=
self
.
_load_labels
()
def
_load_labels
(
self
):
def
_load_labels
(
self
):
labels
=
[]
labels
=
[]
...
@@ -68,7 +68,7 @@ class MobileNetV1:
...
@@ -68,7 +68,7 @@ class MobileNetV1:
for
o
in
output_blob
:
for
o
in
output_blob
:
class_id_list
=
o
.
argsort
()[::
-
1
][:
self
.
top_k
]
class_id_list
=
o
.
argsort
()[::
-
1
][:
self
.
top_k
]
batched_class_id_list
.
append
(
class_id_list
)
batched_class_id_list
.
append
(
class_id_list
)
if
len
(
self
.
labels
)
>
0
:
if
len
(
self
.
_
labels
)
>
0
:
batched_predicted_labels
=
[]
batched_predicted_labels
=
[]
for
class_id_list
in
batched_class_id_list
:
for
class_id_list
in
batched_class_id_list
:
predicted_labels
=
[]
predicted_labels
=
[]
...
...
models/image_classification_mobilenet/mobilenet_v2.py
浏览文件 @
d028d74e
...
@@ -21,7 +21,7 @@ class MobileNetV2:
...
@@ -21,7 +21,7 @@ class MobileNetV2:
self
.
std
=
[
0.229
,
0.224
,
0.225
]
self
.
std
=
[
0.229
,
0.224
,
0.225
]
# load labels
# load labels
self
.
labels
=
self
.
_load_labels
()
self
.
_
labels
=
self
.
_load_labels
()
def
_load_labels
(
self
):
def
_load_labels
(
self
):
labels
=
[]
labels
=
[]
...
@@ -68,7 +68,7 @@ class MobileNetV2:
...
@@ -68,7 +68,7 @@ class MobileNetV2:
for
o
in
output_blob
:
for
o
in
output_blob
:
class_id_list
=
o
.
argsort
()[::
-
1
][:
self
.
top_k
]
class_id_list
=
o
.
argsort
()[::
-
1
][:
self
.
top_k
]
batched_class_id_list
.
append
(
class_id_list
)
batched_class_id_list
.
append
(
class_id_list
)
if
len
(
self
.
labels
)
>
0
:
if
len
(
self
.
_
labels
)
>
0
:
batched_predicted_labels
=
[]
batched_predicted_labels
=
[]
for
class_id_list
in
batched_class_id_list
:
for
class_id_list
in
batched_class_id_list
:
predicted_labels
=
[]
predicted_labels
=
[]
...
...
tools/eval/README.md
浏览文件 @
d028d74e
...
@@ -19,7 +19,7 @@ Supported datasets:
...
@@ -19,7 +19,7 @@ Supported datasets:
-
[
ImageNet
](
#imagenet
)
-
[
ImageNet
](
#imagenet
)
-
[
WIDERFace
](
#widerface
)
-
[
WIDERFace
](
#widerface
)
-
[
LFW
](
#lfw
)
-
[
LFW
](
#lfw
)
-
[
ICDAR
](
#
icdar
)
-
[
ICDAR
](
#
ICDAR2003
)
-
[
IIIT5K
](
#iiit5k
)
-
[
IIIT5K
](
#iiit5k
)
## ImageNet
## ImageNet
...
...
tools/quantize/inc_configs/mobilenet.yaml
浏览文件 @
d028d74e
...
@@ -51,7 +51,7 @@ evaluation: # optional. required if use
...
@@ -51,7 +51,7 @@ evaluation: # optional. required if use
ImagenetRaw
:
ImagenetRaw
:
data_path
:
/path/to/imagenet/val
data_path
:
/path/to/imagenet/val
image_list
:
/path/to/imagenet/val.txt
# download from http://dl.caffe.berkeleyvision.org/caffe_ilsvrc12.tar.gz
image_list
:
/path/to/imagenet/val.txt
# download from http://dl.caffe.berkeleyvision.org/caffe_ilsvrc12.tar.gz
transform
:
transform
:
Rescale
:
{}
Rescale
:
{}
Resize
:
Resize
:
size
:
256
size
:
256
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录