예제 #1
0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import sys,os
import numpy as np
import lib
from lib import dicto, glob, getArgvDic, findints,pathjoin
from lib import show, loga, logl, imread, imsave
from lib import Evalu,diceEvalu
from lib import *
from configManager import (getImgGtNames, indexOf, readgt, readimg, 
                           setMod, togt, toimg, makeValEnv, doc)
from train import c, cf, args
setMod('val')

args.out = pathjoin(c.tmpdir,'val/png')
pr_out = pathjoin(c.tmpdir,'pr')
# =============================================================================
# config BEGIN
# =============================================================================
args.update(
        restore=-1,
        step=64,
        
        )
# =============================================================================
# config END
# =============================================================================

if args.restore == -1:
    pas = [p[len(args.prefix):] for p in glob(args.prefix+'*')]
예제 #2
0
파일: val.py 프로젝트: shsun-xq/TreeSegNet
from __future__ import unicode_literals

import sys, os
import numpy as np
import lib
from lib import dicto, glob, getArgvDic, findints, pathjoin
from lib import show, loga, logl, imread, imsave
from lib import Evalu, diceEvalu
from lib import *
from configManager import (getImgGtNames, indexOf, readgt, readimg, setMod,
                           togt, toimg, makeValEnv, doc)
from train import c, cf, args

setMod('val')
#setMod('test')
args.out = pathjoin(c.tmpdir, 'val/png')

# =============================================================================
# config BEGIN
# =============================================================================
args.update(
    #        restore=43,
    restore=28,
    step=None,
    #        step=.2,
)
# =============================================================================
# config END
# =============================================================================

if args.restore == -1:
예제 #3
0
파일: test.py 프로젝트: shsun-xq/TreeSegNet
import sys, os
import numpy as np
import lib
from lib import dicto, glob, getArgvDic, findints, pathjoin
from lib import show, loga, logl, imread, imsave
from lib import Evalu, diceEvalu
from lib import *
from configManager import (getImgGtNames, indexOf, readgt, readimg, setMod,
                           togt, toimg, makeValEnv, doc)
from train import c, cf, args

setMod('train')
setMod('test')

args.out = pathjoin(c.tmpdir, 'val/tif-4-22')

# =============================================================================
# config BEGIN
# =============================================================================
args.update(
    restore=-1,
    #        restore=34,
    #        step=None,
    step=.2,
)
# =============================================================================
# config END
# =============================================================================

if args.restore == -1:
예제 #4
0
jobDir = (os.path.split(dirname(filePath))[-1])
expDir = (os.path.split((filePath))[-1])

cf.project = cf.project or jobDir
cf.experment = cf.experment or expDir

cf.savename = '%s-%s-%s'%(cf.netdir,cf.experment,cf.project)

cf.toValGtPath = cf.toValGtPath or cf.toGtPath
#cf.valArgs = cf.valArgs or cf.trainArgs



c.update(cf)
c.cf = cf


c.weightsPrefix = fileJoinPath(__file__,pathjoin(c.tmpdir,'weights/%s-%s'%(c.netdir,c.experment)))
#show- map(readimg,c.names[:10])
if __name__ == '__main__':
    setMod('train')
    img = readimg(c.names[0])
    gt = readgt(c.names[0])
    show(img,gt)
    loga(gt)
    pass




예제 #5
0
#cf.testGlob = '/home/dl/datasOnWindows/carMaskData/test/*.jpg'
# =============================================================================
# config END
# =============================================================================

filePath = fileJoinPath(__file__)
jobDir = (os.path.split(dirname(filePath))[-1])
expDir = (os.path.split((filePath))[-1])

cf.project = cf.project or jobDir
cf.experment = cf.experment or expDir

cf.savename = '%s-%s-%s' % (cf.netdir, cf.experment, cf.project)

cf.toValGtPath = cf.toValGtPath or cf.toGtPath
#cf.valArgs = cf.valArgs or cf.trainArgs

c.update(cf)
c.cf = cf

c.weightsPrefix = fileJoinPath(
    __file__, pathjoin(c.tmpdir, 'weihgts/%s-%s' % (c.netdir, c.experment)))
#show- map(readimg,c.names[:10])
if __name__ == '__main__':
    setMod('train')
    img = readimg(c.names[0])
    gt = readgt(c.names[0])
    show(img, gt)
    loga(gt)
    pass
예제 #6
0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import sys, os
import numpy as np
import lib
from lib import dicto, glob, getArgvDic, findints, pathjoin
from lib import show, loga, logl, imread, imsave
from lib import Evalu, diceEvalu
from lib import *
from configManager import (getImgGtNames, indexOf, readgt, readimg, setMod,
                           togt, toimg, makeValEnv, doc)
from train import c, cf, args
setMod('val')

args.out = pathjoin(c.tmpdir, 'val/b4_e50')
prtxt_out = pathjoin(c.tmpdir, 'pr/b4_e50')

# =============================================================================
# config BEGIN
# =============================================================================
args.update(
    restore=-1,
    step=None,
)
# =============================================================================
# config END
# =============================================================================

if args.restore == -1:
    pas = [p[len(args.prefix):] for p in glob(args.prefix + '*')]