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
d4484474
Commit
d4484474
authored
Feb 04, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix crop
parent
5aed2cc0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
tensorpack/dataflow/imgaug/crop.py
tensorpack/dataflow/imgaug/crop.py
+3
-2
tensorpack/models/image_sample.py
tensorpack/models/image_sample.py
+1
-0
No files found.
tensorpack/dataflow/imgaug/crop.py
View file @
d4484474
...
...
@@ -4,6 +4,7 @@
# Author: Yuxin Wu <ppwwyyxx@gmail.com>
from
.base
import
ImageAugmentor
import
cv2
__all__
=
[
'RandomCrop'
,
'CenterCrop'
,
'Resize'
]
...
...
@@ -42,11 +43,11 @@ class Resize(ImageAugmentor):
def
__init__
(
self
,
shape
):
"""
Args:
shape: (
w, h
)
shape: (
h, w
)
"""
self
.
_init
(
locals
())
def
_augment
(
self
,
img
):
img
.
arr
=
cv2
.
resize
(
img
.
arr
,
self
.
shape
,
img
.
arr
,
self
.
shape
[::
-
1
]
,
interpolation
=
cv2
.
INTER_CUBIC
)
tensorpack/models/image_sample.py
View file @
d4484474
...
...
@@ -46,6 +46,7 @@ def ImageSample(template, mapping):
mapping: bxh2xw2x2 (y, x) real-value coordinates
Return: bxh2xw2xc
"""
assert
template
.
get_shape
()
.
ndims
==
4
and
mapping
.
get_shape
()
.
ndims
==
4
mapping
=
tf
.
maximum
(
mapping
,
0.0
)
tf
.
check_numerics
(
mapping
,
"mapping"
)
lcoor
=
tf
.
cast
(
mapping
,
tf
.
int32
)
# floor
...
...
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