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
SparseConvNet
Commits
de6bf28e
Unverified
Commit
de6bf28e
authored
Sep 13, 2019
by
Ben Graham
Committed by
GitHub
Sep 13, 2019
Browse files
random seed init
parent
2082f213
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
examples/ScanNet/data.py
examples/ScanNet/data.py
+16
-4
No files found.
examples/ScanNet/data.py
View file @
de6bf28e
...
@@ -10,7 +10,7 @@ val_reps=1 # Number of test views, 1 or more
...
@@ -10,7 +10,7 @@ val_reps=1 # Number of test views, 1 or more
batch_size
=
32
batch_size
=
32
elastic_deformation
=
False
elastic_deformation
=
False
import
torch
,
numpy
as
np
,
glob
,
math
,
torch
.
utils
.
data
,
scipy
.
ndimage
,
multiprocessing
as
mp
import
torch
,
numpy
as
np
,
glob
,
math
,
torch
.
utils
.
data
,
scipy
.
ndimage
,
multiprocessing
as
mp
,
time
dimension
=
3
dimension
=
3
full_scale
=
4096
#Input field size
full_scale
=
4096
#Input field size
...
@@ -82,8 +82,14 @@ def trainMerge(tbl):
...
@@ -82,8 +82,14 @@ def trainMerge(tbl):
labels
=
torch
.
cat
(
labels
,
0
)
labels
=
torch
.
cat
(
labels
,
0
)
return
{
'x'
:
[
locs
,
feats
],
'y'
:
labels
.
long
(),
'id'
:
tbl
}
return
{
'x'
:
[
locs
,
feats
],
'y'
:
labels
.
long
(),
'id'
:
tbl
}
train_data_loader
=
torch
.
utils
.
data
.
DataLoader
(
train_data_loader
=
torch
.
utils
.
data
.
DataLoader
(
list
(
range
(
len
(
train
))),
batch_size
=
batch_size
,
collate_fn
=
trainMerge
,
num_workers
=
20
,
shuffle
=
True
)
list
(
range
(
len
(
train
))),
batch_size
=
batch_size
,
collate_fn
=
trainMerge
,
num_workers
=
20
,
shuffle
=
True
,
drop_last
=
True
,
worker_init_fn
=
lambda
x
:
np
.
random
.
seed
(
x
+
int
(
time
.
time
()))
)
valOffsets
=
[
0
]
valOffsets
=
[
0
]
valLabels
=
[]
valLabels
=
[]
...
@@ -125,4 +131,10 @@ def valMerge(tbl):
...
@@ -125,4 +131,10 @@ def valMerge(tbl):
point_ids
=
torch
.
cat
(
point_ids
,
0
)
point_ids
=
torch
.
cat
(
point_ids
,
0
)
return
{
'x'
:
[
locs
,
feats
],
'y'
:
labels
.
long
(),
'id'
:
tbl
,
'point_ids'
:
point_ids
}
return
{
'x'
:
[
locs
,
feats
],
'y'
:
labels
.
long
(),
'id'
:
tbl
,
'point_ids'
:
point_ids
}
val_data_loader
=
torch
.
utils
.
data
.
DataLoader
(
val_data_loader
=
torch
.
utils
.
data
.
DataLoader
(
list
(
range
(
len
(
val
))),
batch_size
=
batch_size
,
collate_fn
=
valMerge
,
num_workers
=
20
,
shuffle
=
True
)
list
(
range
(
len
(
val
))),
batch_size
=
batch_size
,
collate_fn
=
valMerge
,
num_workers
=
20
,
shuffle
=
True
,
worker_init_fn
=
lambda
x
:
np
.
random
.
seed
(
x
+
int
(
time
.
time
()))
)
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