Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DL Object Detection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Jakob Bjørn Hyldgaard
DL Object Detection
Commits
33f638c4
Commit
33f638c4
authored
2 years ago
by
Jakob
Browse files
Options
Downloads
Patches
Plain Diff
changed mobilenet to decoder
parent
fcf4a86d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MobileNetV1.py
+7
-7
7 additions, 7 deletions
MobileNetV1.py
with
7 additions
and
7 deletions
MobileNetV1.py
+
7
−
7
View file @
33f638c4
...
...
@@ -18,10 +18,10 @@ from Yolo_v1_fcs import Yolo_v1_fcs
import
warnings
warnings
.
filterwarnings
(
"
ignore
"
,
category
=
UserWarning
)
m
ode
l
=
torch
.
hub
.
load
(
'
pytorch/vision:v0.10.0
'
,
'
mobilenet_v2
'
,
pretrained
=
True
)
dec
ode
r
=
torch
.
hub
.
load
(
'
pytorch/vision:v0.10.0
'
,
'
mobilenet_v2
'
,
pretrained
=
True
)
#Enable following to only get CNN part:
m
ode
l
=
torch
.
nn
.
Sequential
(
*
(
list
(
m
ode
l
.
children
())[:
-
1
]))
m
ode
l
.
eval
()
dec
ode
r
=
torch
.
nn
.
Sequential
(
*
(
list
(
dec
ode
r
.
children
())[:
-
1
]))
dec
ode
r
.
eval
()
preprocess
=
transforms
.
Compose
([
transforms
.
Resize
(
256
),
...
...
@@ -40,9 +40,9 @@ def runCNN(image):
input_batch
=
preprocessImage
(
image
)
if
torch
.
cuda
.
is_available
():
input_batch
=
input_batch
.
to
(
'
cuda
'
)
m
ode
l
.
to
(
'
cuda
'
)
dec
ode
r
.
to
(
'
cuda
'
)
with
torch
.
no_grad
():
return
m
ode
l
(
input_batch
)
return
dec
ode
r
(
input_batch
)
if
__name__
==
"
__main__
"
:
...
...
@@ -66,9 +66,9 @@ if __name__=="__main__":
print
(
output
.
shape
)
size
=
reduce
(
lambda
x
,
y
:
x
*
y
,
output
.
shape
)
m
ode
l
=
Yolo_v1_fcs
(
size
)
dec
ode
r
=
Yolo_v1_fcs
(
size
)
output
=
m
ode
l
(
output
)
output
=
dec
ode
r
(
output
)
fig
,
ax
=
plt
.
subplots
()
ax
.
imshow
(
input_image
)
...
...
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