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
OpenDAS
OpenPCDet
Commits
88babd54
Commit
88babd54
authored
Jun 26, 2020
by
Gus-Guo
Browse files
avoid logger being pickled
parent
eaae7f47
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
pcdet/datasets/augmentor/data_augmentor.py
pcdet/datasets/augmentor/data_augmentor.py
+9
-2
pcdet/datasets/augmentor/database_sampler.py
pcdet/datasets/augmentor/database_sampler.py
+8
-0
pcdet/datasets/dataset.py
pcdet/datasets/dataset.py
+8
-0
No files found.
pcdet/datasets/augmentor/data_augmentor.py
View file @
88babd54
...
@@ -13,8 +13,8 @@ class DataAugmentor(object):
...
@@ -13,8 +13,8 @@ class DataAugmentor(object):
self
.
data_augmentor_queue
=
[]
self
.
data_augmentor_queue
=
[]
for
cur_cfg
in
augmentor_configs
:
for
cur_cfg
in
augmentor_configs
:
cur_augmentor
=
getattr
(
self
,
cur_cfg
.
NAME
)(
config
=
cur_cfg
)
cur_augmentor
=
getattr
(
self
,
cur_cfg
.
NAME
)(
config
=
cur_cfg
)
self
.
data_augmentor_queue
.
append
(
cur_augmentor
)
self
.
data_augmentor_queue
.
append
(
cur_augmentor
)
def
gt_sampling
(
self
,
config
=
None
):
def
gt_sampling
(
self
,
config
=
None
):
db_sampler
=
database_sampler
.
DataBaseSampler
(
db_sampler
=
database_sampler
.
DataBaseSampler
(
root_path
=
self
.
root_path
,
root_path
=
self
.
root_path
,
...
@@ -24,6 +24,13 @@ class DataAugmentor(object):
...
@@ -24,6 +24,13 @@ class DataAugmentor(object):
)
)
return
db_sampler
return
db_sampler
def
__getstate__
(
self
):
d
=
dict
(
self
.
__dict__
)
del
d
[
'logger'
]
return
d
def
__setstate__
(
self
,
d
):
self
.
__dict__
.
update
(
d
)
def
random_world_flip
(
self
,
data_dict
=
None
,
config
=
None
):
def
random_world_flip
(
self
,
data_dict
=
None
,
config
=
None
):
if
data_dict
is
None
:
if
data_dict
is
None
:
...
...
pcdet/datasets/augmentor/database_sampler.py
View file @
88babd54
...
@@ -37,6 +37,14 @@ class DataBaseSampler(object):
...
@@ -37,6 +37,14 @@ class DataBaseSampler(object):
'indices'
:
np
.
arange
(
len
(
self
.
db_infos
[
class_name
]))
'indices'
:
np
.
arange
(
len
(
self
.
db_infos
[
class_name
]))
}
}
def
__getstate__
(
self
):
d
=
dict
(
self
.
__dict__
)
del
d
[
'logger'
]
return
d
def
__setstate__
(
self
,
d
):
self
.
__dict__
.
update
(
d
)
def
filter_by_difficulty
(
self
,
db_infos
,
removed_difficulty
):
def
filter_by_difficulty
(
self
,
db_infos
,
removed_difficulty
):
new_db_infos
=
{}
new_db_infos
=
{}
for
key
,
dinfos
in
db_infos
.
items
():
for
key
,
dinfos
in
db_infos
.
items
():
...
...
pcdet/datasets/dataset.py
View file @
88babd54
...
@@ -39,6 +39,14 @@ class DatasetTemplate(torch_data.Dataset):
...
@@ -39,6 +39,14 @@ class DatasetTemplate(torch_data.Dataset):
def
mode
(
self
):
def
mode
(
self
):
return
'train'
if
self
.
training
else
'test'
return
'train'
if
self
.
training
else
'test'
def
__getstate__
(
self
):
d
=
dict
(
self
.
__dict__
)
del
d
[
'logger'
]
return
d
def
__setstate__
(
self
,
d
):
self
.
__dict__
.
update
(
d
)
def
__len__
(
self
):
def
__len__
(
self
):
raise
NotImplementedError
raise
NotImplementedError
...
...
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