FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
docker-python/tests/test_chainercv.py at master · feibyte/docker-python · GitHub
feibyte
/
docker-python
Public
forked from
Kaggle/docker-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
docker-python
/
tests
/
test_chainercv.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (28 loc) · 957 Bytes
Breadcrumbs
docker-python
/
tests
/
test_chainercv.py
Copy path
File metadata and controls
35 lines (28 loc) · 957 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from
__future__
import
division
import
math
import
numpy
import
unittest
from
chainercv
.
utils
import
tile_images
class
TestChainerCV
(
unittest
.
TestCase
):
def
test_tile_images
(
self
):
B
=
numpy
.
random
.
randint
(
10
,
20
)
n_col
=
numpy
.
random
.
randint
(
2
,
5
)
H
=
30
W
=
40
fill
=
128
pad
=
0
imgs
=
numpy
.
random
.
uniform
(
255
,
size
=
(
B
,
3
,
H
,
W
))
tile
=
tile_images
(
imgs
,
n_col
,
pad
,
fill
=
fill
)
if
isinstance
(
pad
,
int
):
pad_y
=
pad
pad_x
=
pad
else
:
pad_y
,
pad_x
=
pad
n_row
=
int
(
math
.
ceil
(
B
/
n_col
))
self
.
assertTrue
(
n_col
>=
1
and
n_row
>=
1
)
start_y_11
=
H
+
pad_y
+
pad_y
//
2
start_x_11
=
W
+
pad_x
+
pad_x
//
2
tile_11
=
tile
[:,
start_y_11
:
start_y_11
+
H
,
start_x_11
:
start_x_11
+
W
]
numpy
.
testing
.
assert_equal
(
tile_11
,
imgs
[(
n_col
-
1
)
+
2
])
Back
|
FazBrowse Home
|
New Git URL