Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
4d71805b
Commit
4d71805b
authored
Aug 21, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
super() in transforms. update docs
parent
8da260de
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
28 deletions
+39
-28
CHANGES.md
CHANGES.md
+2
-2
docs/tutorial/inference.md
docs/tutorial/inference.md
+9
-4
examples/FasterRCNN/common.py
examples/FasterRCNN/common.py
+1
-0
examples/README.md
examples/README.md
+20
-20
tensorpack/dataflow/imgaug/transform.py
tensorpack/dataflow/imgaug/transform.py
+3
-0
tensorpack/utils/serialize.py
tensorpack/utils/serialize.py
+4
-2
No files found.
CHANGES.md
View file @
4d71805b
...
...
@@ -6,9 +6,9 @@ The backward compatibilty will be __preserved for at least several months__, wit
so you don't need to look at here very often.
Here are a list of things that were changed, starting from an early version.
TensorFlow itself also
APIs changes
and those are not listed here.
TensorFlow itself also
changes API
and those are not listed here.
+
[2018/04/05] msgpack is replaced by pyarrow. If you want
compatibility with old serialized data
,
+
[2018/04/05] msgpack is replaced by pyarrow. If you want
old behavior
,
`export TENSORPACK_SERIALIZE=msgpack`
.
+
[2018/03/20]
`ModelDesc`
starts to use simplified interfaces:
+
`_get_inputs()`
renamed to
`inputs()`
and returns
`tf.placeholder`
s.
...
...
docs/tutorial/inference.md
View file @
4d71805b
...
...
@@ -23,8 +23,8 @@ You can use this predicate to choose a different code path in inference mode.
Tensorpack is a training interface -- it doesn't care what happened after training.
It saves models to standard checkpoint format.
Y
ou can build the graph for inference, load the checkpoint, and then use whatever deployment methods TensorFlow supports.
But you'll need to read TF docs and
do it on your own
.
So y
ou can build the graph for inference, load the checkpoint, and then use whatever deployment methods TensorFlow supports.
But you'll need to read TF docs and
__do it on your own__
.
### Don't Use Training Metagraph for Inference
...
...
@@ -50,6 +50,11 @@ with TowerContext('', is_training=False):
### OfflinePredictor
The only tool tensorpack has for after-training inference is
[
OfflinePredictor
](
../modules/predict.html#tensorpack.predict.OfflinePredictor
)
,
a simple function to build the graph and return a callable for you.
It is mainly for quick demo purposes.
It only runs inference on numpy arrays, therefore may not be the most efficient way.
Check out examples and docs for its usage.
OfflinePredictor is only for quick demo purposes.
It runs inference on numpy arrays, therefore may not be the most efficient way.
It also has very limited functionalities.
If you need anything more complicated, please __do it on your own__ because Tensorpack
doesn't care what happened after training.
examples/FasterRCNN/common.py
View file @
4d71805b
...
...
@@ -38,6 +38,7 @@ class CustomResize(transform.TransformAugmentorBase):
size (int): the size to resize the shortest edge to.
max_size (int): maximum allowed longest edge.
"""
super
(
CustomResize
,
self
)
.
__init__
()
self
.
_init
(
locals
())
def
_get_augment_params
(
self
,
img
):
...
...
examples/README.md
View file @
4d71805b
tensorpack/dataflow/imgaug/transform.py
View file @
4d71805b
...
...
@@ -56,6 +56,7 @@ class ImageTransform(object):
class
ResizeTransform
(
ImageTransform
):
def
__init__
(
self
,
h
,
w
,
newh
,
neww
,
interp
):
super
(
ResizeTransform
,
self
)
.
__init__
()
self
.
_init
(
locals
())
def
apply_image
(
self
,
img
):
...
...
@@ -75,6 +76,7 @@ class ResizeTransform(ImageTransform):
class
CropTransform
(
ImageTransform
):
def
__init__
(
self
,
h0
,
w0
,
h
,
w
):
super
(
CropTransform
,
self
)
.
__init__
()
self
.
_init
(
locals
())
def
apply_image
(
self
,
img
):
...
...
@@ -89,6 +91,7 @@ class CropTransform(ImageTransform):
class
WarpAffineTransform
(
ImageTransform
):
def
__init__
(
self
,
mat
,
dsize
,
interp
=
cv2
.
INTER_LINEAR
,
borderMode
=
cv2
.
BORDER_CONSTANT
,
borderValue
=
0
):
super
(
WarpAffineTransform
,
self
)
.
__init__
()
self
.
_init
(
locals
())
def
apply_image
(
self
,
img
):
...
...
tensorpack/utils/serialize.py
View file @
4d71805b
...
...
@@ -10,8 +10,9 @@ __all__ = ['loads', 'dumps']
def
dumps_msgpack
(
obj
):
"""
Serialize an object.
Returns:
Implementation-dependent bytes-like object
Implementation-dependent bytes-like object
.
"""
return
msgpack
.
dumps
(
obj
,
use_bin_type
=
True
)
...
...
@@ -29,7 +30,8 @@ def dumps_pyarrow(obj):
Serialize an object.
Returns:
Implementation-dependent bytes-like object
Implementation-dependent bytes-like object.
May not be compatible across different versions of pyarrow.
"""
return
pa
.
serialize
(
obj
)
.
to_buffer
()
...
...
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