Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fast-rcnn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
maxmzkr
fast-rcnn
Commits
a32acb81
Commit
a32acb81
authored
9 years ago
by
Ross Girshick
Browse files
Options
Downloads
Patches
Plain Diff
re-eval: option to use mat files; some pylint fixes
parent
1e85e7d9
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/fast_rcnn/config.py
+1
-1
1 addition, 1 deletion
lib/fast_rcnn/config.py
lib/fast_rcnn/test.py
+3
-4
3 additions, 4 deletions
lib/fast_rcnn/test.py
lib/fast_rcnn/train.py
+3
-4
3 additions, 4 deletions
lib/fast_rcnn/train.py
tools/reval.py
+27
-2
27 additions, 2 deletions
tools/reval.py
with
34 additions
and
11 deletions
lib/fast_rcnn/config.py
+
1
−
1
View file @
a32acb81
...
...
@@ -120,7 +120,7 @@ __C.RNG_SEED = 3
__C
.
EPS
=
1e-14
# Root directory of project
__C
.
ROOT_DIR
=
o
p
s
.
abspath
(
osp
.
join
(
osp
.
dirname
(
__file__
),
'
..
'
,
'
..
'
))
__C
.
ROOT_DIR
=
os
p
.
abspath
(
osp
.
join
(
osp
.
dirname
(
__file__
),
'
..
'
,
'
..
'
))
# Place outputs under an experiments directory
__C
.
EXP_DIR
=
'
default
'
...
...
This diff is collapsed.
Click to expand it.
lib/fast_rcnn/test.py
+
3
−
4
View file @
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).
...
...
This diff is collapsed.
Click to expand it.
lib/fast_rcnn/train.py
+
3
−
4
View file @
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
fast_rcnn.finetuning
as
finetuning
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
)
...
...
This diff is collapsed.
Click to expand it.
tools/reval.py
+
27
−
2
View file @
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment