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
7bf5581a
Commit
7bf5581a
authored
Jan 09, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MaskRCNN] fix the use of `thread_name_prefix` in Python3.5 (fix #1039)
parent
f585913b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
examples/FasterRCNN/eval.py
examples/FasterRCNN/eval.py
+3
-1
examples/ImageNetModels/imagenet_utils.py
examples/ImageNetModels/imagenet_utils.py
+1
-1
No files found.
examples/FasterRCNN/eval.py
View file @
7bf5581a
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
# File: eval.py
# File: eval.py
import
itertools
import
itertools
import
sys
import
os
import
os
import
json
import
json
import
numpy
as
np
import
numpy
as
np
...
@@ -160,7 +161,8 @@ def multithread_predict_dataflow(dataflows, model_funcs):
...
@@ -160,7 +161,8 @@ def multithread_predict_dataflow(dataflows, model_funcs):
assert
len
(
dataflows
)
==
num_worker
assert
len
(
dataflows
)
==
num_worker
if
num_worker
==
1
:
if
num_worker
==
1
:
return
predict_dataflow
(
dataflows
[
0
],
model_funcs
[
0
])
return
predict_dataflow
(
dataflows
[
0
],
model_funcs
[
0
])
with
ThreadPoolExecutor
(
max_workers
=
num_worker
,
thread_name_prefix
=
'EvalWorker'
)
as
executor
,
\
kwargs
=
{
'thread_name_prefix'
:
'EvalWorker'
}
if
sys
.
version_info
.
minor
>=
6
else
{}
with
ThreadPoolExecutor
(
max_workers
=
num_worker
,
**
kwargs
)
as
executor
,
\
tqdm
.
tqdm
(
total
=
sum
([
df
.
size
()
for
df
in
dataflows
]))
as
pbar
:
tqdm
.
tqdm
(
total
=
sum
([
df
.
size
()
for
df
in
dataflows
]))
as
pbar
:
futures
=
[]
futures
=
[]
for
dataflow
,
pred
in
zip
(
dataflows
,
model_funcs
):
for
dataflow
,
pred
in
zip
(
dataflows
,
model_funcs
):
...
...
examples/ImageNetModels/imagenet_utils.py
View file @
7bf5581a
...
@@ -37,7 +37,7 @@ def fbresnet_augmentor(isTrain):
...
@@ -37,7 +37,7 @@ def fbresnet_augmentor(isTrain):
# Removing lighting leads to a tiny drop in accuracy.
# Removing lighting leads to a tiny drop in accuracy.
imgaug
.
RandomOrderAug
(
imgaug
.
RandomOrderAug
(
[
imgaug
.
BrightnessScale
((
0.6
,
1.4
),
clip
=
False
),
[
imgaug
.
BrightnessScale
((
0.6
,
1.4
),
clip
=
False
),
imgaug
.
Contrast
((
0.6
,
1.4
),
clip
=
False
),
imgaug
.
Contrast
((
0.6
,
1.4
),
rgb
=
False
,
clip
=
False
),
imgaug
.
Saturation
(
0.4
,
rgb
=
False
),
imgaug
.
Saturation
(
0.4
,
rgb
=
False
),
# rgb-bgr conversion for the constants copied from fb.resnet.torch
# rgb-bgr conversion for the constants copied from fb.resnet.torch
imgaug
.
Lighting
(
0.1
,
imgaug
.
Lighting
(
0.1
,
...
...
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