コード例 #1
0
ファイル: util.py プロジェクト: neil-jones-work/gop
def setupBaseline(N_S,N_T,max_iou=0.85,SEED_PROPOSAL=False):
	from gop import proposals
	prop_settings = proposals.ProposalSettings()
	prop_settings.max_iou = max_iou
	del prop_settings.unaries[:]
	
	prop_settings.unaries.append( proposals.UnarySettings( N_S, N_T, proposals.seedUnary(), [0,15] ) )
	if SEED_PROPOSAL: # Seed proposals
		prop_settings.unaries.append( proposals.UnarySettings( N_S, 1, proposals.seedUnary(), [], 0, 0 ) )
	# Background only proposals
	prop_settings.unaries.append( proposals.UnarySettings( 0, N_T, proposals.seedUnary(), list(range(16)), 0.1, 1  ) )
	return prop_settings
コード例 #2
0
ファイル: util.py プロジェクト: neil-jones-work/gop
def setupLearned(N_S,N_T,max_iou=0.85,N_MASKS=3,SEED_PROPOSAL=False):	
	from gop import proposals
	prop_settings = proposals.ProposalSettings()
	prop_settings.max_iou = max_iou
	# Load the seeds
	seed = proposals.LearnedSeed()
	seed.load( '../data/seed_final.dat' )
	prop_settings.foreground_seeds = seed
	
	# Load the masks
	del prop_settings.unaries[:]
	for i in range(N_MASKS):
		fg = proposals.binaryLearnedUnary( "../data/masks_final_%d_fg.dat"%i )
		bg = proposals.binaryLearnedUnary( "../data/masks_final_%d_bg.dat"%i )
		prop_settings.unaries.append( proposals.UnarySettings( N_S, N_T, fg, bg ) )
	if SEED_PROPOSAL: # Seed proposals
		prop_settings.unaries.append( proposals.UnarySettings( N_S, 1, proposals.seedUnary(), [], 0, 0 ) )
	# Background only proposals
	prop_settings.unaries.append( proposals.UnarySettings( 0, N_T, proposals.seedUnary(), list(range(16)), 0.1, 1  ) )
	return prop_settings