Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
deepdraw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
medai
software
deepdraw
Commits
e3786801
Commit
e3786801
authored
5 years ago
by
Tim Laibacher
Browse files
Options
Downloads
Patches
Plain Diff
Remove model tests
parent
a70ddb7f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#32556
passed
5 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/ip/binseg/test/test_models.py
+0
-55
0 additions, 55 deletions
bob/ip/binseg/test/test_models.py
with
0 additions
and
55 deletions
bob/ip/binseg/test/test_models.py
deleted
100644 → 0
+
0
−
55
View file @
a70ddb7f
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import
torch
import
unittest
import
numpy
as
np
from
bob.ip.binseg.modeling.driu
import
build_driu
from
bob.ip.binseg.modeling.driuod
import
build_driuod
from
bob.ip.binseg.modeling.hed
import
build_hed
from
bob.ip.binseg.modeling.unet
import
build_unet
from
bob.ip.binseg.modeling.resunet
import
build_res50unet
class
Tester
(
unittest
.
TestCase
):
"""
Unit test for model architectures
"""
def
setUp
(
self
):
self
.
x
=
torch
.
randn
(
1
,
3
,
544
,
544
)
self
.
hw
=
np
.
array
(
self
.
x
.
shape
)[[
2
,
3
]]
def
test_driu
(
self
):
model
=
build_driu
()
out
=
model
(
self
.
x
)
out_hw
=
np
.
array
(
out
.
shape
)[[
2
,
3
]]
self
.
assertEqual
(
self
.
hw
.
all
(),
out_hw
.
all
())
def
test_driuod
(
self
):
model
=
build_driuod
()
out
=
model
(
self
.
x
)
out_hw
=
np
.
array
(
out
.
shape
)[[
2
,
3
]]
self
.
assertEqual
(
self
.
hw
.
all
(),
out_hw
.
all
())
def
test_hed
(
self
):
model
=
build_hed
()
out
=
model
(
self
.
x
)
# NOTE: HED outputs a list of length 4. We test only for the last concat-fuse layer
out_hw
=
np
.
array
(
out
[
4
].
shape
)[[
2
,
3
]]
self
.
assertEqual
(
self
.
hw
.
all
(),
out_hw
.
all
())
def
test_unet
(
self
):
model
=
build_unet
()
out
=
model
(
self
.
x
)
out_hw
=
np
.
array
(
out
.
shape
)[[
2
,
3
]]
self
.
assertEqual
(
self
.
hw
.
all
(),
out_hw
.
all
())
def
test_resunet
(
self
):
model
=
build_res50unet
()
out
=
model
(
self
.
x
)
out_hw
=
np
.
array
(
out
.
shape
)[[
2
,
3
]]
self
.
assertEqual
(
self
.
hw
.
all
(),
out_hw
.
all
())
if
__name__
==
'
__main__
'
:
unittest
.
main
()
\ No newline at end of file
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