Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
keras-frcnn
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sjjsmuel
keras-frcnn
Commits
c622eb29
Commit
c622eb29
authored
Mar 03, 2020
by
Jonas Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comments measure mean average precision
parent
37aca0a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
measure_map.py
measure_map.py
+8
-4
No files found.
measure_map.py
View file @
c622eb29
...
...
@@ -76,11 +76,12 @@ def get_map(pred, gt, f):
break
else
:
continue
print
(
found_match
)
T
[
pred_class
].
append
(
int
(
found_match
))
for
gt_box
in
gt
:
#if not gt_box['bbox_matched'] and not gt_box['difficult']:
# In case the GT was not found by the network
if
not
gt_box
[
'bbox_matched'
]:
if
gt_box
[
'class'
]
not
in
P
:
P
[
gt_box
[
'class'
]]
=
[]
...
...
@@ -135,7 +136,7 @@ C.model_path = 'data/model_frcnn.hdf5'
img_path
=
options
.
test_path
# Adapt size of image to input size of network and return also the resizing values
def
format_img
(
img
,
C
):
img_min_side
=
float
(
C
.
im_size
)
(
height
,
width
,
_
)
=
img
.
shape
...
...
@@ -209,8 +210,8 @@ all_imgs, _, _ = get_data(options.test_path)
test_imgs
=
all_imgs
T
=
{}
P
=
{}
T
=
{}
# Truth
P
=
{}
# Prediction
for
idx
,
img_data
in
enumerate
(
test_imgs
):
print
(
'{}/{}'
.
format
(
idx
,
len
(
test_imgs
)))
st
=
time
.
time
()
...
...
@@ -218,6 +219,9 @@ for idx, img_data in enumerate(test_imgs):
img
=
cv2
.
imread
(
filepath
,
cv2
.
IMREAD_IGNORE_ORIENTATION
|
cv2
.
IMREAD_COLOR
)
# X is the resized image
# fx is the resizing factor along the x axis
# fy is the resizing factor along the y axis
X
,
fx
,
fy
=
format_img
(
img
,
C
)
if
K
.
image_dim_ordering
()
==
'tf'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment