Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.learn.tensorflow
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
bob
bob.learn.tensorflow
Commits
ce97d05e
Commit
ce97d05e
authored
6 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
Add an extra feed option to the extractors
parent
5328bd78
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!79
Add keras-based models, add pixel-wise loss, other improvements
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/learn/tensorflow/extractors/Base.py
+6
-2
6 additions, 2 deletions
bob/learn/tensorflow/extractors/Base.py
with
6 additions
and
2 deletions
bob/learn/tensorflow/extractors/Base.py
+
6
−
2
View file @
ce97d05e
...
...
@@ -20,7 +20,7 @@ def normalize_checkpoint_path(path):
class
Base
:
def
__init__
(
self
,
output_name
,
input_shape
,
checkpoint
,
scopes
,
input_transform
=
None
,
output_transform
=
None
,
input_dtype
=
'
float32
'
,
**
kwargs
):
input_dtype
=
'
float32
'
,
extra_feed
=
None
,
**
kwargs
):
self
.
output_name
=
output_name
self
.
input_shape
=
input_shape
...
...
@@ -29,6 +29,7 @@ class Base:
self
.
input_transform
=
input_transform
self
.
output_transform
=
output_transform
self
.
input_dtype
=
input_dtype
self
.
extra_feed
=
extra_feed
self
.
session
=
None
super
().
__init__
(
**
kwargs
)
...
...
@@ -60,8 +61,11 @@ class Base:
self
.
load
()
data
=
np
.
ascontiguousarray
(
data
,
dtype
=
self
.
input_dtype
)
feed_dict
=
{
self
.
input
:
data
}
if
self
.
extra_feed
is
not
None
:
feed_dict
.
update
(
self
.
extra_feed
)
return
self
.
session
.
run
(
self
.
output
,
feed_dict
=
{
self
.
input
:
data
}
)
return
self
.
session
.
run
(
self
.
output
,
feed_dict
=
feed_dict
)
def
get_output
(
self
,
data
,
mode
):
raise
NotImplementedError
()
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