Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
210610347
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2021
210610347
Commits
8595d364
Commit
8595d364
authored
3 years ago
by
hexiangdong2019
Browse files
Options
Downloads
Patches
Plain Diff
修改pred_mask
parent
01d38994
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.py
+1
-1
1 addition, 1 deletion
main.py
miou.py
+0
-4
0 additions, 4 deletions
miou.py
with
1 addition
and
5 deletions
main.py
+
1
−
1
View file @
8595d364
...
...
@@ -221,7 +221,7 @@ class EvalCallBack(Callback):
for
data
in
self
.
eval_dataset
.
create_dict_iterator
():
image
=
Tensor
(
data
[
'
data
'
])
net_out
=
self
.
model
.
predict
(
image
)
net_out
=
net_out
.
asnumpy
()
net_out
=
np
.
amax
(
net_out
.
asnumpy
()
,
axis
=
0
)
Iou
.
add_batch
(
net_out
,
data
[
'
label
'
].
asnumpy
())
acc_
,
acc_cls
,
iu
,
mean_iu
,
fwavacc
=
Iou
.
evaluate
()
print
(
acc_
)
...
...
This diff is collapsed.
Click to expand it.
miou.py
+
0
−
4
View file @
8595d364
...
...
@@ -11,11 +11,7 @@ class IOUMetric:
self
.
hist
=
np
.
zeros
((
num_classes
,
num_classes
))
def
_fast_hist
(
self
,
label_pred
,
label_true
):
print
(
label_pred
.
shape
)
print
(
label_true
.
shape
)
mask
=
np
.
bitwise_and
(
label_true
>=
0
,
label_true
<
self
.
num_classes
)
print
(
label_true
[
mask
].
shape
)
print
(
label_pred
[
mask
].
shape
)
hist
=
np
.
bincount
(
self
.
num_classes
*
label_true
[
mask
].
astype
(
int
)
+
label_pred
[
mask
],
minlength
=
self
.
num_classes
**
2
).
reshape
(
self
.
num_classes
,
self
.
num_classes
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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