Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
2e539758
Commit
2e539758
authored
Feb 11, 2018
by
Zhichao Lu
Committed by
lzc5123016
Feb 13, 2018
Browse files
Minor changes to make object_detection compatible with Python 3.
PiperOrigin-RevId: 185315101
parent
5f886f23
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
5 deletions
+4
-5
research/object_detection/builders/anchor_generator_builder_test.py
...bject_detection/builders/anchor_generator_builder_test.py
+0
-1
research/object_detection/utils/np_box_list_ops.py
research/object_detection/utils/np_box_list_ops.py
+1
-1
research/object_detection/utils/np_box_mask_list_ops.py
research/object_detection/utils/np_box_mask_list_ops.py
+1
-1
research/object_detection/utils/visualization_utils_test.py
research/object_detection/utils/visualization_utils_test.py
+2
-2
No files found.
research/object_detection/builders/anchor_generator_builder_test.py
View file @
2e539758
...
...
@@ -266,7 +266,6 @@ class AnchorGeneratorBuilderTest(tf.test.TestCase):
self
.
assertTrue
(
isinstance
(
anchor_generator_object
,
multiscale_grid_anchor_generator
.
MultiscaleGridAnchorGenerator
))
print
anchor_generator_object
.
_anchor_grid_info
for
level
,
anchor_grid_info
in
zip
(
range
(
3
,
8
),
anchor_generator_object
.
_anchor_grid_info
):
self
.
assertEqual
(
set
(
anchor_grid_info
.
keys
()),
set
([
'level'
,
'info'
]))
...
...
research/object_detection/utils/np_box_list_ops.py
View file @
2e539758
...
...
@@ -214,7 +214,7 @@ def non_max_suppression(boxlist,
is_index_valid
=
np
.
full
(
num_boxes
,
1
,
dtype
=
bool
)
selected_indices
=
[]
num_output
=
0
for
i
in
x
range
(
num_boxes
):
for
i
in
range
(
num_boxes
):
if
num_output
<
max_output_size
:
if
is_index_valid
[
i
]:
num_output
+=
1
...
...
research/object_detection/utils/np_box_mask_list_ops.py
View file @
2e539758
...
...
@@ -217,7 +217,7 @@ def non_max_suppression(box_mask_list,
is_index_valid
=
np
.
full
(
num_masks
,
1
,
dtype
=
bool
)
selected_indices
=
[]
num_output
=
0
for
i
in
x
range
(
num_masks
):
for
i
in
range
(
num_masks
):
if
num_output
<
max_output_size
:
if
is_index_valid
[
i
]:
num_output
+=
1
...
...
research/object_detection/utils/visualization_utils_test.py
View file @
2e539758
...
...
@@ -19,7 +19,7 @@ Testing with visualization in the following colab:
https://drive.google.com/a/google.com/file/d/0B5HnKS_hMsNARERpU3MtU3I5RFE/view?usp=sharing
"""
import
logging
import
os
import
numpy
as
np
...
...
@@ -145,7 +145,7 @@ class VisualizationUtilsTest(tf.test.TestCase):
for
i
in
range
(
images_with_boxes_np
.
shape
[
0
]):
img_name
=
'image_'
+
str
(
i
)
+
'.png'
output_file
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
img_name
)
print
'Writing output image %d to %s'
%
(
i
,
output_file
)
logging
.
info
(
'Writing output image %d to %s'
,
i
,
output_file
)
image_pil
=
Image
.
fromarray
(
images_with_boxes_np
[
i
,
...])
image_pil
.
save
(
output_file
)
...
...
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