Exemplo n.º 1
0
Arquivo: uws.py Projeto: elcodigok/uws
	def __init__(self):
		cmd.Cmd.__init__(self)
		self.prompt = CLI_PROMPT
		self.intro = "\n" + VERSION_STRING
		self.intro += "\n" + DESCRIPTION
		self.intro += "\n\t" + AUTHOR + " (" + ML + ")"
		self.intro += "\n\t" + SITE + "\n"
		self.ruler = '-'
		self.uws = Configure()
Exemplo n.º 2
0
import numpy as np

from config.configure import Configure

conf = Configure()

#== universal
conf.sampling_rate = 44100
conf.duration = 1
conf.hop_length = 347
conf.fmin = 20
conf.fmax = conf.sampling_rate // 2
conf.n_mels = 128
conf.n_fft = conf.n_mels * 20
conf.samples = conf.sampling_rate * conf.duration
conf.num_classes = 7

#== for recognizer
conf.rt_process_count = 1
conf.rt_oversamples = 10

#== for trainer
conf.batch_size = 32
conf.learning_rate = 0.0001
conf.epochs = 60
conf.verbose = 2
conf.dims = (conf.n_mels, 1 + int(np.floor(conf.samples/conf.hop_length)), 1)
conf.rt_chunk_samples = conf.sampling_rate // conf.rt_oversamples
conf.mels_onestep_samples = conf.rt_chunk_samples * conf.rt_process_count
conf.mels_convert_samples = conf.samples + conf.mels_onestep_samples
conf.labels = ['noise', 'finger', 'bell', 'gong', 'scissors', 'knock', 'laughter']
Exemplo n.º 3
0
from config.configure import Configure

conf = Configure()

conf.model_name = 'vgg16.h5'
conf.classes = ['no_breads', 'breads']
conf.no_breads_path = './dataset/data/pool/no_breads/*'
conf.breads_path = './dataset/data/pool/breads/*'
# conf.baked_breads_path = './dataset/data/pool/breads/*'

conf.lr = 1e-4
conf.momentum = 0.9
conf.batch_size = 20
conf.epochs = 20
conf.image_size = 224
Exemplo n.º 4
0
Arquivo: uws.py Projeto: elcodigok/uws
class CLI(cmd.Cmd):
  
	def __init__(self):
		cmd.Cmd.__init__(self)
		self.prompt = CLI_PROMPT
		self.intro = "\n" + VERSION_STRING
		self.intro += "\n" + DESCRIPTION
		self.intro += "\n\t" + AUTHOR + " (" + ML + ")"
		self.intro += "\n\t" + SITE + "\n"
		self.ruler = '-'
		self.uws = Configure()
	
	def do_info(self, line):
		print "All variable"
	
	def do_show(self, line):
		if line and line in SHOW_OPTIONS:
			greeting = 'hi, %s!' % line
		elif line:
			greeting = self.uws.getUrl()
		else:
			greeting = 'URL\t=>\t' + self.uws.getUrl()

		p = Parser()
		p.checkParameter(self.lastcmd.split())
		print greeting
	
	def complete_show(self, text, line, begix, endidx):
		if not text:
			completions = SHOW_OPTIONS[:]
		else:
			completions = [ f
							for f in SHOW_OPTIONS
							if f.startswith(text)
							]
		return completions
	
	def do_run(self, line):
		self.mailExp = re.compile(MAIL_REGEX)
		self.mailList = self.mailExp.findall(self.uws.getWeb())
		self.mailListDebug = list(set(self.mailList))
		print self.mailListDebug

	def help_run(self):
		print '\n'.join([ '\nUsage:', 
						   '\trun ',
						   '\nDescription:',
                           '\tExecute User Web Scan for value set.\n',
                           ])

	def do_quit(self, line):
		return True

	def do_exit(self, line):
		return True
	
	def do_set(self, person):
		if person and person in SET_OPTIONS:
			greeting = 'hi, %s!' % person
		elif person:
			greeting = "hello, " + person
		else:
			greeting = 'hello'

		p = Parser()
		print p.checkParameter(self.lastcmd.split())
		if (p.checkParameter(self.lastcmd.split()) == True):
			self.uws.setUrl(p.returnParameter(2))
		print p.countParameter(self.lastcmd.split())
		print greeting
	
	def complete_set(self, text, line, begix, endidx):
		if not text:
			completions = SET_OPTIONS[:]
		else:
			completions = [ f
							for f in SET_OPTIONS
							if f.startswith(text)
							]
		return completions

	def help_set(self):
		print '\n'.join(['\nUsage:', 
						'\tset url <URL site>', 
						'\tset search <email | google | twitter | facebook>',
						'\tset verbose <True | False>', 
						'\nDescription:',
						'\tConfigure url scan and mode verbose.\n'])
	
	def do_get(self, person):
		if person and person in SET_OPTIONS:
			greeting = 'hi, %s!' % person
		elif person:
			greeting = "hello, " + person
		else:
			greeting = 'hello'

		p = Parser()
		print p.checkParameter(self.lastcmd.split())
		print greeting
	
	def complete_get(self, text, line, begix, endidx):
		if not text:
			completions = SET_OPTIONS[:]
		else:
			completions = [ f
							for f in SET_OPTIONS
							if f.startswith(text)
							]
		return completions

	def help_get(self):
		print '\n'.join(['\nUsage:', 
						'\tget url', 
						'\tget verbose', 
						'\nDescription:',
						'\tConfigure url and mode verbose.\n'])