def my_background_task( path1, name ): #this is the celery task this will execute the tasks in the background try: logger.info('starting function %s' % (name)) v = afinr_crop_custom1.single_affine(path1, name) negative.start(name, v + 1) train.start_1(name) logger.info("completed %s" % (name)) except Exception, e: print 'exceptiom', str(e)
def start(): positive = '../DataBase/Positive' pos_gist = os.path.join(positive, str('Gist')) gist_list = os.listdir(pos_gist) hog_list = os.listdir(os.path.join(positive, str('Hog'))) for x in gist_list: class_name = (x.split('.'))[0] negative.start(class_name, 20) print 'NEGATIVE ADDED FOR CLASS,', class_name print 'NEGATIVE ADDITION DONE' for x in gist_list: class_name = (x.split('.'))[0] train.start_1(class_name) print 'CLASSIFIER UPDATED FOR CLASS,', class_name print 'CLASSIFIER UPDATED'
def my_background_task(path1, name): #this is the celery task this will execute the tasks in the background try: logger.info('starting function %s'%(name)) #print 'starting with',name v = afinr_crop_custom1.single_affine(path1,name) logger.info('v %s'%(name)) negative.start(name,v+1) logger.info('23v %s'%(name)) panns_save.start_1(name) train.start_1(name) update_idcsv(name) #print 'completed with',name logger.info("completed %s"%(name)) except Exception,e: print 'exceptiom',str(e)