text
stringlengths
1
93.6k
context = GetContext()
owner = Get(context, domain_name)
if not owner:
Notify("Domain is not yet registered")
return False
if not CheckWitness(owner):
Notify("Sender is not the owner, cannot transfer")
return False
if not len(to_address) != 34:
Notify("Invalid new owner address. Must be exactly 34 characters")
return False
Put(context, domain_name, to_address)
return True
def DeleteDomain(domain_name):
msg = concat("DeleteDomain: ", domain_name)
Notify(msg)
context = GetContext()
owner = Get(context, domain_name)
if not owner:
Notify("Domain is not yet registered")
return False
if not CheckWitness(owner):
Notify("Sender is not the owner, cannot transfer")
return False
Delete(context, domain_name)
return True
# <FILESEP>
import pickle
from data_loaders.motion_representation import *
from utils import dist_util
from utils.vis_util import *
from utils.render_util import *
import smplx
import pandas as pd
from tqdm import tqdm
import configargparse
import cv2
import PIL.Image as pil_img
import pyrender
arg_formatter = configargparse.ArgumentDefaultsHelpFormatter
cfg_parser = configargparse.YAMLConfigFileParser
description = 'RoHM code'
group = configargparse.ArgParser(formatter_class=arg_formatter,
config_file_parser_class=cfg_parser,
description=description,
prog='')
group.add_argument('--config', is_config_file=True, default='', help='config file path')
group.add_argument("--device", default=0, type=int, help="Device id to use.")
group.add_argument('--body_model_path', type=str, default='data/body_models/smplx_model', help='path to smplx model')
group.add_argument('--dataset', type=str, default='egobody', choices=['prox', 'egobody'])
group.add_argument('--dataset_root', type=str, default='/mnt/ssd/egobody_release', help='path to dataset')
group.add_argument('--saved_data_dir', type=str,
default='data/test_results_release/results_egobody_rgb/test_egobody_grad_True_iter_2_iter2trajnoisy_False_iter2posenoisy_False_earlystop_True_seed_0', #
help='path to saved test results')
group.add_argument('--recording_name', type=str, default='recording_20210907_S02_S01_01', help='all - evaluate on all subsequences; otherwise specify the recording name to evaluate/visualize')
group.add_argument('--visualize', default='False', type=lambda x: x.lower() in ['true', '1'])
group.add_argument('--vis_option', default='mesh', type=str, choices=['mesh', 'skeleton'])
group.add_argument("--vis_interval", default=1, type=int, help="visualize every N clips")
group.add_argument('--render', default='False', type=lambda x: x.lower() in ['true', '1'])
group.add_argument("--render_interval", default=100, type=int, help="render every N clips")
group.add_argument("--render_save_path", default='render_imgs/render_egobody_rgb', type=str, help='path to save render images')
args = group.parse_args()
dist_util.setup_dist(args.device)
smplx_neutral = smplx.create(model_path=args.body_model_path, model_type="smplx",
gender='neutral', flat_hand_mean=True, use_pca=False).to(dist_util.dev())
if __name__ == "__main__":
if args.visualize and args.render:
print('[ERROR] cannot visualize and render at the same time.')
exit()
if args.recording_name != 'all':
test_recording_name_list = [args.recording_name]
else:
if args.dataset == 'prox':
test_recording_name_list = \
['MPH1Library_00034_01', 'N0Sofa_00034_01', 'N0Sofa_00034_02', 'N0Sofa_00141_01',
'N0Sofa_00145_01', 'N3Library_00157_01', 'N3Library_00157_02', 'N3Library_03301_01',
'N3Library_03301_02', 'N3Library_03375_01', 'N3Library_03375_02', 'N3Library_03403_01',
'N3Library_03403_02', 'N3Office_00034_01', 'N3Office_00139_01', 'N3Office_00150_01',
'N3Office_00153_01', 'N3Office_00159_01', 'N3Office_03301_01']
elif args.dataset == 'egobody':
test_recording_name_list = \
['recording_20210907_S02_S01_01', 'recording_20210907_S03_S04_01', 'recording_20210929_S05_S16_01',
'recording_20210929_S05_S16_04', 'recording_20211004_S19_S06_01', 'recording_20211004_S19_S06_02',