more refactoring
Browse files
livermask/utils/utils.py
CHANGED
|
@@ -19,13 +19,11 @@ def get_vessel_model(output):
|
|
| 19 |
def load_vessel_model(path, cpu):
|
| 20 |
unet = UNet3D(num_of_label=2)
|
| 21 |
chainer.serializers.load_npz(path, unet)
|
| 22 |
-
|
| 23 |
if not cpu:
|
| 24 |
chainer.cuda.get_device_from_id(0).use()
|
| 25 |
unet.to_gpu()
|
| 26 |
|
| 27 |
xp = unet.xp
|
| 28 |
-
|
| 29 |
return unet, xp
|
| 30 |
|
| 31 |
|
|
|
|
| 19 |
def load_vessel_model(path, cpu):
|
| 20 |
unet = UNet3D(num_of_label=2)
|
| 21 |
chainer.serializers.load_npz(path, unet)
|
|
|
|
| 22 |
if not cpu:
|
| 23 |
chainer.cuda.get_device_from_id(0).use()
|
| 24 |
unet.to_gpu()
|
| 25 |
|
| 26 |
xp = unet.xp
|
|
|
|
| 27 |
return unet, xp
|
| 28 |
|
| 29 |
|
livermask/utils/yaml_utils.py
CHANGED
|
@@ -1,11 +1,8 @@
|
|
| 1 |
-
#coding:utf-8
|
| 2 |
import shutil
|
| 3 |
import sys, os, time
|
| 4 |
import yaml
|
| 5 |
|
| 6 |
|
| 7 |
-
#sys.path.append(os.path.dirname(__file__))
|
| 8 |
-
|
| 9 |
# Copy from tgans repo.
|
| 10 |
class Config(object):
|
| 11 |
'''
|
|
|
|
|
|
|
| 1 |
import shutil
|
| 2 |
import sys, os, time
|
| 3 |
import yaml
|
| 4 |
|
| 5 |
|
|
|
|
|
|
|
| 6 |
# Copy from tgans repo.
|
| 7 |
class Config(object):
|
| 8 |
'''
|