Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ayu___
fast-rcnn
提交
a32acb81
F
fast-rcnn
项目概览
Ayu___
/
fast-rcnn
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fast-rcnn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a32acb81
编写于
4月 24, 2015
作者:
R
Ross Girshick
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
re-eval: option to use mat files; some pylint fixes
上级
1e85e7d9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
11 deletion
+34
-11
lib/fast_rcnn/config.py
lib/fast_rcnn/config.py
+1
-1
lib/fast_rcnn/test.py
lib/fast_rcnn/test.py
+3
-4
lib/fast_rcnn/train.py
lib/fast_rcnn/train.py
+3
-4
tools/reval.py
tools/reval.py
+27
-2
未找到文件。
lib/fast_rcnn/config.py
浏览文件 @
a32acb81
...
...
@@ -120,7 +120,7 @@ __C.RNG_SEED = 3
__C
.
EPS
=
1e-14
# Root directory of project
__C
.
ROOT_DIR
=
o
ps
.
abspath
(
osp
.
join
(
osp
.
dirname
(
__file__
),
'..'
,
'..'
))
__C
.
ROOT_DIR
=
o
sp
.
abspath
(
osp
.
join
(
osp
.
dirname
(
__file__
),
'..'
,
'..'
))
# Place outputs under an experiments directory
__C
.
EXP_DIR
=
'default'
...
...
lib/fast_rcnn/test.py
浏览文件 @
a32acb81
...
...
@@ -14,11 +14,10 @@ import caffe
import
utils.cython_nms
import
cPickle
import
heapq
import
utils.
blob
from
utils.blob
import
im_list_to_
blob
import
os
def
_get_image_blob
(
im
):
im_pyra
=
[]
im_orig
=
im
.
astype
(
np
.
float32
,
copy
=
True
)
im_orig
-=
cfg
.
PIXEL_MEANS
...
...
@@ -40,7 +39,7 @@ def _get_image_blob(im):
processed_ims
.
append
(
im
)
# Create a blob to hold the input images
blob
=
utils
.
blob
.
im_list_to_blob
(
processed_ims
)
blob
=
im_list_to_blob
(
processed_ims
)
return
blob
,
np
.
array
(
im_scale_factors
)
...
...
@@ -117,7 +116,7 @@ def _clip_boxes(boxes, im_shape):
return
boxes
def
im_detect
(
net
,
im
,
boxes
):
blobs
,
im_scale_factors
=
_get_blobs
(
im
,
boxes
)
blobs
,
unused_
im_scale_factors
=
_get_blobs
(
im
,
boxes
)
# When mapping from image ROIs to feature map ROIs, there's some aliasing
# (some distinct image ROIs get mapped to the same feature ROI).
...
...
lib/fast_rcnn/train.py
浏览文件 @
a32acb81
...
...
@@ -7,10 +7,9 @@
from
fast_rcnn.config
import
cfg
,
get_output_path
import
numpy
as
np
import
cv2
import
caffe
import
finetuning
import
bbox_regression_targets
import
f
ast_rcnn.finetuning
as
f
inetuning
import
fast_rcnn.bbox_regression_targets
as
bbox_regression_targets
import
os
from
caffe.proto
import
caffe_pb2
...
...
@@ -77,7 +76,7 @@ class SolverWrapper(object):
for
shuffled_i
in
xrange
(
0
,
len
(
shuffled_inds
),
cfg
.
TRAIN
.
IMS_PER_BATCH
):
db_inds
=
shuffled_inds
[
shuffled_i
:
shuffled_i
+
cfg
.
TRAIN
.
IMS_PER_BATCH
]
cfg
.
TRAIN
.
IMS_PER_BATCH
]
minibatch_db
=
[
roidb
[
i
]
for
i
in
db_inds
]
blobs
=
finetuning
.
get_minibatch
(
minibatch_db
)
...
...
tools/reval.py
浏览文件 @
a32acb81
...
...
@@ -6,8 +6,29 @@ from fast_rcnn.config import cfg
from
datasets.factory
import
get_imdb
import
cPickle
import
os
,
sys
import
numpy
as
np
def
main
(
imdb_name
,
output_dir
):
def
from_mats
(
imdb_name
,
output_dir
):
import
scipy.io
as
sio
imdb
=
get_imdb
(
imdb_name
)
aps
=
[]
for
i
,
cls
in
enumerate
(
imdb
.
classes
[
1
:]):
mat
=
sio
.
loadmat
(
os
.
path
.
join
(
output_dir
,
cls
+
'_pr.mat'
))
ap
=
mat
[
'ap'
][
0
,
0
]
*
100
apAuC
=
mat
[
'ap_auc'
][
0
,
0
]
*
100
print
'!!! {} : {:.1f} {:.1f}'
.
format
(
cls
,
ap
,
apAuC
)
aps
.
append
(
ap
)
print
'~~~~~~~~~~~~~~~~~~~'
print
'Results (from mat files):'
for
ap
in
aps
:
print
'{:.1f}'
.
format
(
ap
)
print
'{:.1f}'
.
format
(
np
.
array
(
aps
).
mean
())
print
'~~~~~~~~~~~~~~~~~~~'
def
from_dets
(
imdb_name
,
output_dir
):
imdb
=
get_imdb
(
imdb_name
)
imdb
.
config
[
'use_salt'
]
=
False
imdb
.
config
[
'cleanup'
]
=
False
...
...
@@ -26,4 +47,8 @@ if __name__ == '__main__':
output_dir
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
output_dir
))
imdb_name
=
'voc_2007_test'
main
(
imdb_name
,
output_dir
)
if
len
(
sys
.
argv
)
>
2
:
from_mats
(
imdb_name
,
output_dir
)
else
:
from_dets
(
imdb_name
,
output_dir
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录