training with remasked sequence
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
from utils.convnext_utils import CNBlockConfig
|
||||
|
||||
config = dict()
|
||||
|
||||
config['gpu'] = '6'
|
||||
config['name'] = 'direct_8'
|
||||
config['notes'] = 'with normals input but only single garment sequence with msssim and l2 mesh loss only and without skinning and remasked'
|
||||
config['tags'] = ['torch', 'direct']
|
||||
config['script'] = 'scripts/direct_train.py'
|
||||
|
||||
config['pretrained_model'] = ''
|
||||
config['use_curvature'] = False
|
||||
config['use_normals'] = True
|
||||
config['use_skinning'] = False
|
||||
|
||||
# assert that only use curvature or normals
|
||||
assert not (config['use_curvature'] and config['use_normals'])
|
||||
|
||||
config['batch_size'] = 4
|
||||
config['train_dir'] = '/data-net/dataset/00761'
|
||||
config['valid_dir'] = '/data-net/dataset/00761'
|
||||
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||
config['train_frames'] = None
|
||||
config['valid_frames'] = None
|
||||
|
||||
config['resolution'] = 512
|
||||
config['is_skirt'] = False
|
||||
config['dataset_in_memory'] = True
|
||||
config['is_cape'] = False
|
||||
config['remove_global_orientation'] = True
|
||||
config['device'] = 'cuda'
|
||||
config['input_features'] = 9
|
||||
|
||||
config['smpl_res'] = 14475
|
||||
if config['is_cape']:
|
||||
config['smpl_res'] = 3638
|
||||
|
||||
config['latent_dim'] = 128
|
||||
|
||||
config['bottleneck_scale'] = 2
|
||||
|
||||
config['is_label'] = False
|
||||
config['kernel_size'] = 7
|
||||
config['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||
|
||||
block_setting = [
|
||||
CNBlockConfig(16, 32, 3),
|
||||
CNBlockConfig(32, 128, 3),
|
||||
CNBlockConfig(128, 256, 9),
|
||||
CNBlockConfig(256, config['bottleneck_size'], 9),
|
||||
CNBlockConfig(config['bottleneck_size'], None, 3),
|
||||
]
|
||||
|
||||
block_setting_reverse = [
|
||||
CNBlockConfig(config['bottleneck_size'], 256, 3),
|
||||
CNBlockConfig(256, 128, 9),
|
||||
CNBlockConfig(128, 32, 9),
|
||||
CNBlockConfig(32, 16, 3),
|
||||
CNBlockConfig(16, 3, 3),
|
||||
# CNBlockConfig(3, 3, 3),
|
||||
]
|
||||
|
||||
config['encoder_block_settings'] = block_setting
|
||||
config['decoder_block_settings'] = block_setting_reverse
|
||||
config['activation'] = 'tanh'
|
||||
|
||||
|
||||
config['lr'] = 0.0001
|
||||
config['reg_loss_coeff'] = 0.1
|
||||
|
||||
config['signature'] = { 'id',
|
||||
'frame_nr',
|
||||
'pose_shape',
|
||||
'uv_normals',
|
||||
'mesh_mask',
|
||||
'mesh_body_posed',
|
||||
'mesh_posed',
|
||||
'uv_static',
|
||||
'uv_mask',
|
||||
'uv_body_posed',
|
||||
}
|
||||
|
||||
if config['use_skinning']:
|
||||
config['signature'].add('uv_unposed')
|
||||
config['signature'].add('mesh_unposed')
|
||||
else:
|
||||
config['signature'].add('uv_posed')
|
||||
@@ -13,7 +13,7 @@ args = vars(parser.parse_args())
|
||||
config_module = importlib.import_module(args['config'])
|
||||
config = config_module.config
|
||||
if args['debug']:
|
||||
from configs.direct_7 import config
|
||||
from configs.direct_8 import config
|
||||
# from configs.ae_static_orig_2 import config
|
||||
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = config['gpu']
|
||||
@@ -219,13 +219,16 @@ def plot_everything(batch: dict, type: str):
|
||||
|
||||
garment_posed = [mesh_posed[i, mask[i], :] for i in range(body.shape[0])]
|
||||
collision = [np.concatenate((body[i], garment_posed[i]), axis=0) for i in range(len(garment_posed))]
|
||||
collision_faces = [np.concatenate((F, faces[i] + config['smpl_res']), axis=0) for i in range(len(garment_posed))]
|
||||
collision_color = [np.concatenate((np.ones_like(body[i], dtype=np.int32)*100, np.ones_like(garment_posed[i], dtype=np.int32)*230), axis=0) for i in range(len(garment_posed))]
|
||||
|
||||
garment_posed_fixed = [mesh_posed_fixed[i, mask[i], :] for i in range(body.shape[0])]
|
||||
collision_fixed = [np.concatenate((body[i], garment_posed_fixed[i]), axis=0) for i in range(len(garment_posed))]
|
||||
collision_gt = [np.concatenate((body[i], gt_posed[i]), axis=0) for i in range(len(garment_posed))]
|
||||
|
||||
faces_ = np.load('/data-net/dataset/00761/faces/00761.npy')
|
||||
faces = [faces_ for i in range(len(garment_posed))]
|
||||
collision_faces = [np.concatenate((F, faces[i] + config['smpl_res']), axis=0) for i in range(len(garment_posed))]
|
||||
|
||||
figs = { type + "/garment_" + str(i): plot_3d(gt[i], garment_unposed[i], faces[i], collision[i], collision_faces[i], collision_color[i]) for i in range(4) }
|
||||
figs_coll = { type + "/garment_" + str(i) + '_collision': plot_3d_collision(collision_gt[i], collision[i], collision_fixed[i], collision_faces[i], collision_color[i]) for i in range(4) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user