def main(args, model_path): print('args:', args.seq, args.json, args.savefig, args.display) np.random.seed(0) torch.manual_seed(0) # Generate sequence config img_list, init_bbox, gt, savefig_dir, display, result_path = gen_config( args) # Run tracker result, result_bb, fps, overlap = run_mdnet(img_list, init_bbox, gt=gt, savefig_dir=savefig_dir, display=display, model_path=model_path) # Save result res = {} res['res'] = result_bb.round().tolist() res['type'] = 'rect' res['fps'] = fps json.dump(res, open(result_path, 'w'), indent=2) return overlap, 'tracker002'
def confirmation_handler(update, context): data = update.callback_query.data user_id = data[1:] if data[0] == 'n': context.bot.send_message(chat_id=user_id, text='Sorry payment is invalid.') elif data[0] == 'y': if check_user_exist(user_id): if check_expired(user_id): context.bot.send_message( chat_id=user_id, text='Your account updated for next month.') update_user(user_id) else: user = get_tmp_user(user_id) # Generate file config file_name = gen_config() with open(file_name, 'r') as fd: context.bot.sendDocument(user_id, document=fd) add_user(user_id, user[2]) context.bot.send_message(chat_id=user_id, text=f'Hi! You are now registered.') context.job_queue.run_daily(alarm, datetime.time(13, 45, 00), context=user_id, name=str(user_id))
def init_info_and_rpaths(self, ext): self.ssl_config = gen_config.gen_config(self.build_temp, couchbase_core=couchbase_core) self.info.setbase(self.build_temp) self.info.cfg = self.cfg_type() self.compiler.add_include_dir(os.path.join(*self.info.base+["install","include"])) self.compiler.add_library_dir(os.path.join(*self.info.base+["install","lib",self.cfg_type()])) if sys.platform == 'darwin': warnings.warn('Adding /usr/local to lib search path for OS X') self.compiler.add_library_dir('/usr/local/lib') self.compiler.add_include_dir('/usr/local/include') self.add_rpaths(ext)
from gen_config import gen_config CONFIG = { "groups": { "wireplane": range(0, 10), }, "streams": ["example"], "metrics": { "rms": {}, "hit_occupancy": {} } } gen_config(CONFIG)
if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('-s', '--seq', default='', help='input seq') parser.add_argument('-j', '--json', default='', help='input json') parser.add_argument('-f', '--savefig', action='store_true') parser.add_argument('-d', '--display', action='store_true') args = parser.parse_args() assert args.seq != '' or args.json != '' np.random.seed(0) torch.manual_seed(0) # Generate sequence config img_list, init_bbox, gt, savefig_dir, display, result_path = gen_config( args) # Run tracker result, result_bb, fps = run_mdnet(img_list, init_bbox, gt=gt, savefig_dir=savefig_dir, display=display) # Save result res = {} res['res'] = result_bb.round().tolist() res['type'] = 'rect' res['fps'] = fps json.dump(res, open(result_path, 'w'), indent=2)