Compare commits
67
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57b7aed4ba | ||
|
|
c41a577672 | ||
|
|
e48ae5a3df | ||
|
|
2d50eb40da | ||
|
|
639af22b48 | ||
|
|
37ad3a3f43 | ||
|
|
80f244b69b | ||
|
|
e87b258c8c | ||
|
|
4fca0f1c4f | ||
|
|
8dc6e0c71a | ||
|
|
5ab1cb5fed | ||
|
|
9a81b82621 | ||
|
|
84b5af96cc | ||
|
|
c42b32ac14 | ||
|
|
33782848f2 | ||
|
|
ffaf1a9a49 | ||
|
|
2a4077303d | ||
|
|
9e93c6f477 | ||
|
|
37dab8cf4e | ||
|
|
3e4a54d629 | ||
|
|
8fb4ceb5db | ||
|
|
da706c4197 | ||
|
|
891a8241b8 | ||
|
|
25c0a09296 | ||
|
|
592b8df0f0 | ||
|
|
2fc0177d5a | ||
|
|
44103c6caa | ||
|
|
77bd2c7b19 | ||
|
|
455b5d02e7 | ||
|
|
b387e9d64d | ||
|
|
ef73cd1a20 | ||
|
|
cd6d2bd1fb | ||
|
|
4367f64afd | ||
|
|
db8b77a3b8 | ||
|
|
528545a305 | ||
|
|
767d5efdf8 | ||
|
|
1ef65f92c6 | ||
|
|
74c72fd9e1 | ||
|
|
d66e6d5a77 | ||
|
|
05fc297808 | ||
|
|
cac04a1610 | ||
|
|
f9ac7fe3c3 | ||
|
|
d3ff1c05e1 | ||
|
|
25d9814b70 | ||
|
|
a831211c2d | ||
|
|
a2b5fb5e03 | ||
|
|
c29654735c | ||
|
|
8639992cd8 | ||
|
|
dbbcd5f14e | ||
|
|
4e369a4240 | ||
|
|
837a1449b8 | ||
|
|
ff9771a415 | ||
|
|
c7590519b3 | ||
|
|
27fb580971 | ||
|
|
9a7aaefb8f | ||
|
|
fec3d38a0a | ||
|
|
78d0277547 | ||
|
|
14ede865cf | ||
|
|
c679afebff | ||
|
|
385aea398b | ||
|
|
9147d6daa9 | ||
|
|
b103b09414 | ||
|
|
e3ca2129fd | ||
|
|
970bd5cd9d | ||
|
|
49ef5798a5 | ||
|
|
daf51b4dbe | ||
|
|
534fbfcde1 |
@@ -0,0 +1,192 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '0'
|
||||||
|
config['name'] = 'abl_torch_norm'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['iccv', 'abl_norm', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_offsets'] = True
|
||||||
|
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
|
||||||
|
ablation_count = [config['use_skinning'], config['remove_global_orientation'], config['use_normals'], config['use_extra_losses'], config['use_offsets']].count(False)
|
||||||
|
assert ablation_count == 1 or ablation_count == 0
|
||||||
|
|
||||||
|
config['avg_garment_path'] = 'custom_data/avg/train_no_shape_avg_uv.npy' #custom_data/train_no_shape_avg_uv.npy # train_no_shape_avg_uv train_no_shape_one_hot_avg_uv
|
||||||
|
if config['use_skinning']:
|
||||||
|
assert (config['use_offsets'] and config['avg_garment_path'] != '') or (not config['use_offsets'] and config['avg_garment_path'] == '')
|
||||||
|
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/train'
|
||||||
|
config['valid_dir'] = '/data-local/127/valid'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccv/static_torch_orig_2'
|
||||||
|
config['body_model'] = 'checkpoints/iccv/body_torch_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccv/torch/norm_torch_1'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
###############
|
||||||
|
config['lr'] = 0.0001# 0.0001
|
||||||
|
###############
|
||||||
|
config['starting_balancing_coeff'] = 0.0001
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
config['upscale_enhancer'] = ''
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
config['use_one_hot'] = False
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cvae'] = dict()
|
||||||
|
config['cvae']['device'] = config['device']
|
||||||
|
config['cvae']['is_label'] = False
|
||||||
|
config['cvae']['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
config['cvae']['kernel_size'] = 7
|
||||||
|
config['cvae']['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
config['cvae']['latent_dim'] = config['cvae']['bottleneck_size']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 256, 3),
|
||||||
|
CNBlockConfig(256, config['cvae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cvae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cvae']['bottleneck_size'] * 2, 256, 3),
|
||||||
|
CNBlockConfig(256, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cvae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cvae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = True
|
||||||
|
config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -2,7 +2,7 @@ from utils.convnext_utils import CNBlockConfig
|
|||||||
|
|
||||||
config = dict()
|
config = dict()
|
||||||
|
|
||||||
config['gpu'] = '4'
|
config['gpu'] = '0'
|
||||||
config['name'] = 'body_torch_cape_m'
|
config['name'] = 'body_torch_cape_m'
|
||||||
config['notes'] = ' '
|
config['notes'] = ' '
|
||||||
config['tags'] = ['torch', 'body']
|
config['tags'] = ['torch', 'body']
|
||||||
@@ -11,9 +11,9 @@ config['script'] = 'scripts/ae_body_train.py'
|
|||||||
config['pretrained_model'] = ''
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
config['batch_size'] = 4
|
config['batch_size'] = 4
|
||||||
config['train_dir'] = '/data-local/127/cape_processed/train/male'
|
config['train_dir'] = '/data-local/128/cape_processed/train/male'
|
||||||
config['valid_dir'] = '/data-local/127/cape_processed/test/male'
|
config['valid_dir'] = '/data-local/128/cape_processed/test/male'
|
||||||
config['test_dir'] = '/data-local/127/cape_processed/test/male'
|
config['test_dir'] = '/data-local/128/cape_processed/test/male'
|
||||||
config['train_frames'] = None
|
config['train_frames'] = None
|
||||||
config['valid_frames'] = None
|
config['valid_frames'] = None
|
||||||
|
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '0'
|
||||||
|
config['name'] = 'cvae_norm_1'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['iccv', 'cvae_norm', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_norm.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/train'
|
||||||
|
config['valid_dir'] = '/data-local/127/valid'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccv/static_torch_orig_2'
|
||||||
|
config['body_model'] = 'checkpoints/iccv/body_torch_1'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
###############
|
||||||
|
config['lr'] = 0.0001# 0.0001
|
||||||
|
###############
|
||||||
|
config['starting_balancing_coeff'] = 0.0001
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
'mesh_normals',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
config['upscale_enhancer'] = ''
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
config['use_one_hot'] = False
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cvae'] = dict()
|
||||||
|
config['cvae']['device'] = config['device']
|
||||||
|
config['cvae']['is_label'] = False
|
||||||
|
config['cvae']['input_features'] = 3+3+3
|
||||||
|
config['cvae']['kernel_size'] = 7
|
||||||
|
config['cvae']['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
config['cvae']['latent_dim'] = config['cvae']['bottleneck_size']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 256, 3),
|
||||||
|
CNBlockConfig(256, config['cvae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cvae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(176, 256, 3),
|
||||||
|
CNBlockConfig(256, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cvae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cvae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_curv ############################
|
||||||
|
config['cond_ae_curv'] = dict()
|
||||||
|
config['cond_ae_curv']['device'] = config['device']
|
||||||
|
config['cond_ae_curv']['is_label'] = True
|
||||||
|
config['cond_ae_curv']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_curv']['kernel_size'] = 7
|
||||||
|
config['cond_ae_curv']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_curv']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_curv']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_curv']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_curv']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_curv']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_curv']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -134,7 +134,7 @@ for res in config['pyramid']['resolutions']:
|
|||||||
block_setting_reverse = [
|
block_setting_reverse = [
|
||||||
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
CNBlockConfig(128, 128, 9),
|
CNBlockConfig(128, 128, 9),
|
||||||
CNBlockConfig(128, 65, 3),
|
CNBlockConfig(128, 64, 3),
|
||||||
CNBlockConfig(64, 3, 3),
|
CNBlockConfig(64, 3, 3),
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ for res in config['pyramid']['resolutions']:
|
|||||||
|
|
||||||
block_setting_reverse = [
|
block_setting_reverse = [
|
||||||
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
CNBlockConfig(128, 128, 9),
|
CNBlockConfig(128, 64, 9),
|
||||||
CNBlockConfig(64, 3, 9),
|
CNBlockConfig(64, 3, 9),
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ for res in config['pyramid']['resolutions']:
|
|||||||
block_setting_reverse = [
|
block_setting_reverse = [
|
||||||
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
CNBlockConfig(128, 128, 9),
|
CNBlockConfig(128, 128, 9),
|
||||||
CNBlockConfig(128, 65, 3),
|
CNBlockConfig(128, 64, 3),
|
||||||
CNBlockConfig(64, 3, 3),
|
CNBlockConfig(64, 3, 3),
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ for res in config['pyramid']['resolutions']:
|
|||||||
|
|
||||||
block_setting_reverse = [
|
block_setting_reverse = [
|
||||||
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
CNBlockConfig(128, 128, 9),
|
CNBlockConfig(128, 64, 9),
|
||||||
CNBlockConfig(64, 3, 9),
|
CNBlockConfig(64, 3, 9),
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ for res in config['pyramid']['resolutions']:
|
|||||||
block_setting_reverse = [
|
block_setting_reverse = [
|
||||||
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
CNBlockConfig(128, 128, 9),
|
CNBlockConfig(128, 128, 9),
|
||||||
CNBlockConfig(128, 65, 3),
|
CNBlockConfig(128, 64, 3),
|
||||||
CNBlockConfig(64, 3, 3),
|
CNBlockConfig(64, 3, 3),
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ for res in config['pyramid']['resolutions']:
|
|||||||
|
|
||||||
block_setting_reverse = [
|
block_setting_reverse = [
|
||||||
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
CNBlockConfig(128, 128, 9),
|
CNBlockConfig(128, 64, 9),
|
||||||
CNBlockConfig(64, 3, 9),
|
CNBlockConfig(64, 3, 9),
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
from utils.convnext_utils import CNBlockConfig
|
|
||||||
|
|
||||||
config = dict()
|
|
||||||
|
|
||||||
config['gpu'] = '5'
|
|
||||||
config['name'] = 'direct_1'
|
|
||||||
config['notes'] = ' '
|
|
||||||
config['tags'] = ['torch', 'direct']
|
|
||||||
config['script'] = 'scripts/direct_train.py'
|
|
||||||
|
|
||||||
config['pretrained_model'] = ''
|
|
||||||
config['use_curvature'] = False
|
|
||||||
|
|
||||||
config['batch_size'] = 4
|
|
||||||
config['train_dir'] = '/data-local/127/train'
|
|
||||||
config['valid_dir'] = '/data-local/127/valid'
|
|
||||||
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'] = False
|
|
||||||
config['is_cape'] = False
|
|
||||||
config['remove_global_orientation'] = True
|
|
||||||
config['device'] = 'cuda'
|
|
||||||
config['input_features'] = 6
|
|
||||||
|
|
||||||
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_body_posed',
|
|
||||||
'mesh_mask',
|
|
||||||
'mesh_body_posed',
|
|
||||||
'mesh_posed',
|
|
||||||
'uv_unposed',
|
|
||||||
'mesh_unposed',
|
|
||||||
'uv_static',
|
|
||||||
'uv_mask',
|
|
||||||
}
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
from utils.convnext_utils import CNBlockConfig
|
|
||||||
|
|
||||||
config = dict()
|
|
||||||
|
|
||||||
config['gpu'] = '0'
|
|
||||||
config['name'] = 'direct_2'
|
|
||||||
config['notes'] = 'with curvature input'
|
|
||||||
config['tags'] = ['torch', 'direct']
|
|
||||||
config['script'] = 'scripts/direct_train.py'
|
|
||||||
|
|
||||||
config['pretrained_model'] = ''
|
|
||||||
config['use_curvature'] = True
|
|
||||||
|
|
||||||
config['batch_size'] = 4
|
|
||||||
config['train_dir'] = '/data-local/127/train'
|
|
||||||
config['valid_dir'] = '/data-local/127/valid'
|
|
||||||
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'] = False
|
|
||||||
config['is_cape'] = False
|
|
||||||
config['remove_global_orientation'] = True
|
|
||||||
config['device'] = 'cuda'
|
|
||||||
config['input_features'] = 10
|
|
||||||
|
|
||||||
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_curvature',
|
|
||||||
'mesh_mask',
|
|
||||||
'mesh_body_posed',
|
|
||||||
'mesh_posed',
|
|
||||||
'uv_unposed',
|
|
||||||
'mesh_unposed',
|
|
||||||
'uv_static',
|
|
||||||
'uv_mask',
|
|
||||||
'uv_body_posed',
|
|
||||||
}
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
from utils.convnext_utils import CNBlockConfig
|
|
||||||
|
|
||||||
config = dict()
|
|
||||||
|
|
||||||
config['gpu'] = '0'
|
|
||||||
config['name'] = 'direct_3'
|
|
||||||
config['notes'] = 'with normals input'
|
|
||||||
config['tags'] = ['torch', 'direct']
|
|
||||||
config['script'] = 'scripts/direct_train.py'
|
|
||||||
|
|
||||||
config['pretrained_model'] = ''
|
|
||||||
config['use_curvature'] = False
|
|
||||||
config['use_normals'] = True
|
|
||||||
|
|
||||||
# assert that only use curvature or normals
|
|
||||||
assert not (config['use_curvature'] and config['use_normals'])
|
|
||||||
|
|
||||||
config['batch_size'] = 4
|
|
||||||
config['train_dir'] = '/data-local/127/train'
|
|
||||||
config['valid_dir'] = '/data-local/127/valid'
|
|
||||||
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'] = False
|
|
||||||
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_unposed',
|
|
||||||
'mesh_unposed',
|
|
||||||
'uv_static',
|
|
||||||
'uv_mask',
|
|
||||||
'uv_body_posed',
|
|
||||||
}
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
from utils.convnext_utils import CNBlockConfig
|
|
||||||
|
|
||||||
config = dict()
|
|
||||||
|
|
||||||
config['gpu'] = '5'
|
|
||||||
config['name'] = 'direct_5'
|
|
||||||
config['notes'] = 'with normals input but only single garment sequence'
|
|
||||||
config['tags'] = ['torch', 'direct']
|
|
||||||
config['script'] = 'scripts/direct_train.py'
|
|
||||||
|
|
||||||
config['pretrained_model'] = ''
|
|
||||||
config['use_curvature'] = False
|
|
||||||
config['use_normals'] = True
|
|
||||||
|
|
||||||
# assert that only use curvature or normals
|
|
||||||
assert not (config['use_curvature'] and config['use_normals'])
|
|
||||||
|
|
||||||
config['batch_size'] = 4
|
|
||||||
config['train_dir'] = '/data-local/127/train'
|
|
||||||
config['valid_dir'] = '/data-local/127/train'
|
|
||||||
config['test_dir'] = '/data-net/dataset/test_ready'
|
|
||||||
config['train_frames'] = 'frames_00761.txt'
|
|
||||||
config['valid_frames'] = 'frames_00761.txt'
|
|
||||||
|
|
||||||
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_unposed',
|
|
||||||
'mesh_unposed',
|
|
||||||
'uv_static',
|
|
||||||
'uv_mask',
|
|
||||||
'uv_body_posed',
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
from utils.convnext_utils import CNBlockConfig
|
|
||||||
|
|
||||||
config = dict()
|
|
||||||
|
|
||||||
config['gpu'] = '4'
|
|
||||||
config['name'] = 'direct_6'
|
|
||||||
config['notes'] = 'with normals input but only single garment sequence with msssim and l2 mesh loss only'
|
|
||||||
config['tags'] = ['torch', 'direct']
|
|
||||||
config['script'] = 'scripts/direct_train.py'
|
|
||||||
|
|
||||||
config['pretrained_model'] = ''
|
|
||||||
config['use_curvature'] = False
|
|
||||||
config['use_normals'] = True
|
|
||||||
config['use_skinning'] = True
|
|
||||||
|
|
||||||
# assert that only use curvature or normals
|
|
||||||
assert not (config['use_curvature'] and config['use_normals'])
|
|
||||||
|
|
||||||
config['batch_size'] = 4
|
|
||||||
config['train_dir'] = '/data-local/127/train'
|
|
||||||
config['valid_dir'] = '/data-local/127/train'
|
|
||||||
config['test_dir'] = '/data-net/dataset/test_ready'
|
|
||||||
config['train_frames'] = 'frames_00761.txt'
|
|
||||||
config['valid_frames'] = 'frames_00761.txt'
|
|
||||||
|
|
||||||
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_unposed',
|
|
||||||
'mesh_unposed',
|
|
||||||
'uv_static',
|
|
||||||
'uv_mask',
|
|
||||||
'uv_body_posed',
|
|
||||||
}
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
from utils.convnext_utils import CNBlockConfig
|
|
||||||
|
|
||||||
config = dict()
|
|
||||||
|
|
||||||
config['gpu'] = '0'
|
|
||||||
config['name'] = 'direct_9'
|
|
||||||
config['notes'] = 'with normals input whole dataset with msssim and l2 mesh loss and reg losses and without skinning'
|
|
||||||
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-local/127/train'
|
|
||||||
config['valid_dir'] = '/data-local/127/train'
|
|
||||||
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'] = False
|
|
||||||
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')
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
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')
|
|
||||||
@@ -0,0 +1,197 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '2'
|
||||||
|
config['name'] = 'abl_iccvw_all_2'
|
||||||
|
config['notes'] = 'fixed collision loss'
|
||||||
|
config['tags'] = ['iccv', 'abl_all', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = 'checkpoints/iccvw/abl_iccvw_all_1'
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_normals'] = True
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
|
||||||
|
ablation_count = [config['use_skinning'], config['use_normals'], config['use_extra_losses']].count(False)
|
||||||
|
assert ablation_count == 1 or ablation_count == 0
|
||||||
|
|
||||||
|
config['avg_garment_path'] = 'custom_data/avg/train_no_shape_avg_uv.npy' #custom_data/train_no_shape_avg_uv.npy # train_no_shape_avg_uv train_no_shape_one_hot_avg_uv
|
||||||
|
if config['use_skinning']:
|
||||||
|
assert (config['avg_garment_path'] != '')
|
||||||
|
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
###############
|
||||||
|
config['lr'] = 0.0001# 0.0001
|
||||||
|
###############
|
||||||
|
config['starting_balancing_coeff'] = 0.0001
|
||||||
|
config['balancing_activation_limit'] = 0.01
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
config['upscale_enhancer'] = ''
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
config['use_one_hot'] = False
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cvae'] = dict()
|
||||||
|
config['cvae']['device'] = config['device']
|
||||||
|
config['cvae']['is_label'] = False
|
||||||
|
config['cvae']['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
config['cvae']['kernel_size'] = 7
|
||||||
|
config['cvae']['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
config['cvae']['latent_dim'] = config['cvae']['bottleneck_size']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 256, 3),
|
||||||
|
CNBlockConfig(256, config['cvae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cvae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cvae']['bottleneck_size'] * 2, 256, 3),
|
||||||
|
CNBlockConfig(256, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cvae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cvae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,196 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '4'
|
||||||
|
config['name'] = 'abl_iccvw_all_3'
|
||||||
|
config['notes'] = 'fixed collision loss, train from zero'
|
||||||
|
config['tags'] = ['iccv', 'abl_all', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_normals'] = True
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
|
||||||
|
ablation_count = [config['use_skinning'], config['use_normals'], config['use_extra_losses']].count(False)
|
||||||
|
assert ablation_count == 1 or ablation_count == 0
|
||||||
|
|
||||||
|
config['avg_garment_path'] = 'custom_data/avg/train_no_shape_avg_uv.npy' #custom_data/train_no_shape_avg_uv.npy # train_no_shape_avg_uv train_no_shape_one_hot_avg_uv
|
||||||
|
if config['use_skinning']:
|
||||||
|
assert (config['avg_garment_path'] != '')
|
||||||
|
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
###############
|
||||||
|
config['lr'] = 0.0001# 0.0001
|
||||||
|
###############
|
||||||
|
config['starting_balancing_coeff'] = 0.0001
|
||||||
|
config['balancing_activation_limit'] = 0.01
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
config['upscale_enhancer'] = ''
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
config['use_one_hot'] = False
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cvae'] = dict()
|
||||||
|
config['cvae']['device'] = config['device']
|
||||||
|
config['cvae']['is_label'] = False
|
||||||
|
config['cvae']['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
config['cvae']['kernel_size'] = 7
|
||||||
|
config['cvae']['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
config['cvae']['latent_dim'] = config['cvae']['bottleneck_size']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 256, 3),
|
||||||
|
CNBlockConfig(256, config['cvae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cvae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cvae']['bottleneck_size'] * 2, 256, 3),
|
||||||
|
CNBlockConfig(256, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cvae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cvae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,196 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '4'
|
||||||
|
config['name'] = 'abl_iccvw_all_4'
|
||||||
|
config['notes'] = 'fixed collision loss, train from zero'
|
||||||
|
config['tags'] = ['iccv', 'abl_all', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = 'checkpoints/iccvw/abl_iccvw_all_3'
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_normals'] = True
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
|
||||||
|
ablation_count = [config['use_skinning'], config['use_normals'], config['use_extra_losses']].count(False)
|
||||||
|
assert ablation_count == 1 or ablation_count == 0
|
||||||
|
|
||||||
|
config['avg_garment_path'] = 'custom_data/avg/train_no_shape_avg_uv.npy' #custom_data/train_no_shape_avg_uv.npy # train_no_shape_avg_uv train_no_shape_one_hot_avg_uv
|
||||||
|
if config['use_skinning']:
|
||||||
|
assert (config['avg_garment_path'] != '')
|
||||||
|
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
###############
|
||||||
|
config['lr'] = 0.0001# 0.0001
|
||||||
|
###############
|
||||||
|
config['starting_balancing_coeff'] = 0.0001
|
||||||
|
config['balancing_activation_limit'] = 0.01
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
config['upscale_enhancer'] = ''
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
config['use_one_hot'] = False
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cvae'] = dict()
|
||||||
|
config['cvae']['device'] = config['device']
|
||||||
|
config['cvae']['is_label'] = False
|
||||||
|
config['cvae']['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
config['cvae']['kernel_size'] = 7
|
||||||
|
config['cvae']['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
config['cvae']['latent_dim'] = config['cvae']['bottleneck_size']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 256, 3),
|
||||||
|
CNBlockConfig(256, config['cvae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cvae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cvae']['bottleneck_size'] * 2, 256, 3),
|
||||||
|
CNBlockConfig(256, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cvae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cvae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,196 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '4'
|
||||||
|
config['name'] = 'abl_iccvw_all_5'
|
||||||
|
config['notes'] = 'fixed collision loss, train from zero, fixed latest checkpoint loading'
|
||||||
|
config['tags'] = ['iccv', 'abl_all', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = 'checkpoints/iccvw/abl_iccvw_all_3'
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_normals'] = True
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
|
||||||
|
ablation_count = [config['use_skinning'], config['use_normals'], config['use_extra_losses']].count(False)
|
||||||
|
assert ablation_count == 1 or ablation_count == 0
|
||||||
|
|
||||||
|
config['avg_garment_path'] = 'custom_data/avg/train_no_shape_avg_uv.npy' #custom_data/train_no_shape_avg_uv.npy # train_no_shape_avg_uv train_no_shape_one_hot_avg_uv
|
||||||
|
if config['use_skinning']:
|
||||||
|
assert (config['avg_garment_path'] != '')
|
||||||
|
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
###############
|
||||||
|
config['lr'] = 0.0001# 0.0001
|
||||||
|
###############
|
||||||
|
config['starting_balancing_coeff'] = 0.0001
|
||||||
|
config['balancing_activation_limit'] = 0.01
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
config['upscale_enhancer'] = ''
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
config['use_one_hot'] = False
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cvae'] = dict()
|
||||||
|
config['cvae']['device'] = config['device']
|
||||||
|
config['cvae']['is_label'] = False
|
||||||
|
config['cvae']['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
config['cvae']['kernel_size'] = 7
|
||||||
|
config['cvae']['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
config['cvae']['latent_dim'] = config['cvae']['bottleneck_size']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 256, 3),
|
||||||
|
CNBlockConfig(256, config['cvae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cvae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cvae']['bottleneck_size'] * 2, 256, 3),
|
||||||
|
CNBlockConfig(256, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cvae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cvae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,196 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '2'
|
||||||
|
config['name'] = 'abl_iccvw_all_skirt'
|
||||||
|
config['notes'] = 'fixed collision loss, train from zero'
|
||||||
|
config['tags'] = ['iccv', 'abl_all', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_normals'] = True
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
|
||||||
|
ablation_count = [config['use_skinning'], config['use_normals'], config['use_extra_losses']].count(False)
|
||||||
|
assert ablation_count == 1 or ablation_count == 0
|
||||||
|
|
||||||
|
config['avg_garment_path'] = 'custom_data/avg/train_skirt_no_shape_avg_uv.npy' #custom_data/train_no_shape_avg_uv.npy # train_no_shape_avg_uv train_no_shape_one_hot_avg_uv
|
||||||
|
if config['use_skinning']:
|
||||||
|
assert (config['avg_garment_path'] != '')
|
||||||
|
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = True
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_1_skirt'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1_skirt'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1_skirt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
###############
|
||||||
|
config['lr'] = 0.0001# 0.0001
|
||||||
|
###############
|
||||||
|
config['starting_balancing_coeff'] = 0.0001
|
||||||
|
config['balancing_activation_limit'] = 0.01
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
config['upscale_enhancer'] = ''
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
config['use_one_hot'] = False
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cvae'] = dict()
|
||||||
|
config['cvae']['device'] = config['device']
|
||||||
|
config['cvae']['is_label'] = False
|
||||||
|
config['cvae']['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
config['cvae']['kernel_size'] = 7
|
||||||
|
config['cvae']['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
config['cvae']['latent_dim'] = config['cvae']['bottleneck_size']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 256, 3),
|
||||||
|
CNBlockConfig(256, config['cvae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cvae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cvae']['bottleneck_size'] * 2, 256, 3),
|
||||||
|
CNBlockConfig(256, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cvae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cvae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '2'
|
||||||
|
config['name'] = 'body_iccvw_1'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'body']
|
||||||
|
config['script'] = 'scripts/ae_body_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_mask',
|
||||||
|
'mesh_body_posed',
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '5'
|
||||||
|
config['name'] = 'body_iccvw_1_10p'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'body']
|
||||||
|
config['script'] = 'scripts/ae_body_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt_10p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train_10p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_mask',
|
||||||
|
'mesh_body_posed',
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '5'
|
||||||
|
config['name'] = 'body_iccvw_1_25p'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'body']
|
||||||
|
config['script'] = 'scripts/ae_body_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt_25p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train_25p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_mask',
|
||||||
|
'mesh_body_posed',
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '5'
|
||||||
|
config['name'] = 'body_iccvw_1_50p'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'body']
|
||||||
|
config['script'] = 'scripts/ae_body_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt_50p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train_50p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_mask',
|
||||||
|
'mesh_body_posed',
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '1'
|
||||||
|
config['name'] = 'body_iccvw_1_skirt'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'body']
|
||||||
|
config['script'] = 'scripts/ae_body_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = True
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_mask',
|
||||||
|
'mesh_body_posed',
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '0'
|
||||||
|
config['name'] = 'body_iccvw_cape_f'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'body']
|
||||||
|
config['script'] = 'scripts/ae_body_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/128/cape_processed/train/female'
|
||||||
|
config['valid_dir'] = '/data-local/128/cape_processed/test/female'
|
||||||
|
config['test_dir'] = '/data-local/128/cape_processed/test/female'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_mask',
|
||||||
|
'mesh_body_posed',
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '0'
|
||||||
|
config['name'] = 'body_torch_cape_m'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'body']
|
||||||
|
config['script'] = 'scripts/ae_body_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/128/cape_processed/train/male'
|
||||||
|
config['valid_dir'] = '/data-local/128/cape_processed/test/male'
|
||||||
|
config['test_dir'] = '/data-local/128/cape_processed/test/male'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_mask',
|
||||||
|
'mesh_body_posed',
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '1'
|
||||||
|
config['name'] = 'norm_iccvw_1'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'norm']
|
||||||
|
config['script'] = 'scripts/ae_norm_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'uv_mask',
|
||||||
|
'uv_normals',
|
||||||
|
'mesh_mask',
|
||||||
|
'mesh_normals',
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '0'
|
||||||
|
config['name'] = 'norm_iccvw_1_10p'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'norm']
|
||||||
|
config['script'] = 'scripts/ae_norm_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt_10p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train_10p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'uv_mask',
|
||||||
|
'uv_normals',
|
||||||
|
'mesh_mask',
|
||||||
|
'mesh_normals',
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '0'
|
||||||
|
config['name'] = 'norm_iccvw_1_25p'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'norm']
|
||||||
|
config['script'] = 'scripts/ae_norm_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt_25p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train_25p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'uv_mask',
|
||||||
|
'uv_normals',
|
||||||
|
'mesh_mask',
|
||||||
|
'mesh_normals',
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '6'
|
||||||
|
config['name'] = 'norm_iccvw_1_50p'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'norm']
|
||||||
|
config['script'] = 'scripts/ae_norm_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt_50p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train_50p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'uv_mask',
|
||||||
|
'uv_normals',
|
||||||
|
'mesh_mask',
|
||||||
|
'mesh_normals',
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '4'
|
||||||
|
config['name'] = 'norm_iccvw_1_skirt'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'norm']
|
||||||
|
config['script'] = 'scripts/ae_norm_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = True
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'uv_mask',
|
||||||
|
'uv_normals',
|
||||||
|
'mesh_mask',
|
||||||
|
'mesh_normals',
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '6'
|
||||||
|
config['name'] = 'norm_iccvw_cape_f'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'norm']
|
||||||
|
config['script'] = 'scripts/ae_norm_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127_2/cape_processed/train/female'
|
||||||
|
config['valid_dir'] = '/data-local/127_2/cape_processed/test/female'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cape_processed/test/female'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'uv_mask',
|
||||||
|
'uv_normals',
|
||||||
|
'mesh_mask',
|
||||||
|
'mesh_normals',
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '6'
|
||||||
|
config['name'] = 'norm_iccvw_cape_m'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'norm']
|
||||||
|
config['script'] = 'scripts/ae_norm_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127_2/cape_processed/train/male'
|
||||||
|
config['valid_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'uv_mask',
|
||||||
|
'uv_normals',
|
||||||
|
'mesh_mask',
|
||||||
|
'mesh_normals',
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '3'
|
||||||
|
config['name'] = 'static_iccvw_4'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'static']
|
||||||
|
config['script'] = 'scripts/ae_static_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = 'checkpoints/iccvw/static_iccvw_3'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0005
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '6'
|
||||||
|
config['name'] = 'static_iccvw_4_10p'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'static']
|
||||||
|
config['script'] = 'scripts/ae_static_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt_10p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train_10p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0005
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '6'
|
||||||
|
config['name'] = 'static_iccvw_4_25p'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'static']
|
||||||
|
config['script'] = 'scripts/ae_static_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt_25p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train_25p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0005
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '6'
|
||||||
|
config['name'] = 'static_iccvw_4_50p'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'static']
|
||||||
|
config['script'] = 'scripts/ae_static_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt_50p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train_50p.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0005
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '3'
|
||||||
|
config['name'] = 'static_iccvw_1_skirt'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'static']
|
||||||
|
config['script'] = 'scripts/ae_static_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = True
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0005
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '5'
|
||||||
|
config['name'] = 'static_iccvw_5'
|
||||||
|
config['notes'] = 'lower learning rate'
|
||||||
|
config['tags'] = ['torch', 'static']
|
||||||
|
config['script'] = 'scripts/ae_static_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = 'checkpoints/iccvw/static_iccvw_3'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-net/dataset/test_ready'
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.00005
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '4'
|
||||||
|
config['name'] = 'static_iccvw_cape_f'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'static']
|
||||||
|
config['script'] = 'scripts/ae_static_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127_2/cape_processed/train/female'
|
||||||
|
config['valid_dir'] = '/data-local/127_2/cape_processed/test/female'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cape_processed/test/female'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0005
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '5'
|
||||||
|
config['name'] = 'static_iccvw_cape_m'
|
||||||
|
config['notes'] = ' '
|
||||||
|
config['tags'] = ['torch', 'static']
|
||||||
|
config['script'] = 'scripts/ae_static_train.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['train_dir'] = '/data-local/127_2/cape_processed/train/male'
|
||||||
|
config['valid_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['remove_global_orientation'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cond_ae'] = dict()
|
||||||
|
config['cond_ae']['device'] = config['device']
|
||||||
|
config['cond_ae']['is_label'] = False
|
||||||
|
config['cond_ae']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae']['kernel_size'] = 7
|
||||||
|
config['cond_ae']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
# CNBlockConfig(3, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
config['lr'] = 0.0005
|
||||||
|
config['cond_ae']['upscale_output'] = False
|
||||||
|
|
||||||
|
config['signature'] = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '4'
|
||||||
|
config['name'] = 'cvae_norm_1'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['iccv', 'cvae_norm', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_norm.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
|
||||||
|
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
###############
|
||||||
|
config['lr'] = 0.0001# 0.0001
|
||||||
|
###############
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.05
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
'mesh_normals',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
config['upscale_enhancer'] = ''
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
config['use_one_hot'] = False
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cvae'] = dict()
|
||||||
|
config['cvae']['device'] = config['device']
|
||||||
|
config['cvae']['is_label'] = False
|
||||||
|
config['cvae']['input_features'] = 3+3+3
|
||||||
|
config['cvae']['kernel_size'] = 7
|
||||||
|
config['cvae']['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
config['cvae']['latent_dim'] = config['cvae']['bottleneck_size']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 256, 3),
|
||||||
|
CNBlockConfig(256, config['cvae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cvae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(176, 256, 3),
|
||||||
|
CNBlockConfig(256, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cvae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cvae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '6'
|
||||||
|
config['name'] = 'cvae_norm_2'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['iccv', 'cvae_norm', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_norm.py'
|
||||||
|
|
||||||
|
config['pretrained_model'] = 'checkpoints/iccvw/cvae_norm_1'
|
||||||
|
|
||||||
|
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['resolution'] = 512
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['latent_dim'] = 128
|
||||||
|
|
||||||
|
###############
|
||||||
|
config['lr'] = 0.00003# 0.0001
|
||||||
|
###############
|
||||||
|
config['starting_balancing_coeff'] = 0.1
|
||||||
|
config['balancing_activation_limit'] = 0.1
|
||||||
|
config['ignore_saved_optimizer'] = True
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
'mesh_normals',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
config['upscale_enhancer'] = ''
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
config['use_one_hot'] = False
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['cvae'] = dict()
|
||||||
|
config['cvae']['device'] = config['device']
|
||||||
|
config['cvae']['is_label'] = False
|
||||||
|
config['cvae']['input_features'] = 3+3+3
|
||||||
|
config['cvae']['kernel_size'] = 7
|
||||||
|
config['cvae']['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
config['cvae']['latent_dim'] = config['cvae']['bottleneck_size']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 256, 3),
|
||||||
|
CNBlockConfig(256, config['cvae']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cvae']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(176, 256, 3),
|
||||||
|
CNBlockConfig(256, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cvae']['encoder_block_settings'] = block_setting
|
||||||
|
config['cvae']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '1'
|
||||||
|
config['name'] = 'pyr_iccvw_32'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [32]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = ''
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+7 if config['use_curvature'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+7 if config['use_curvature'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+7 if config['use_curvature'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+7 if config['use_curvature'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '3'
|
||||||
|
config['name'] = 'pyr_iccvw_64'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = ''
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '2'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_2'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '2'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_256'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128, 256]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_128'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = '225000'
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '2'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_256_512'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128, 256, 512]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_128_256'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = '125000'
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,297 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '5'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_256_512_cape_f'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128, 256, 512]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_128_256_cape_f'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = '125000'
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127_2/cape_processed/train/female'
|
||||||
|
config['valid_dir'] = '/data-local/127_2/cape_processed/test/female'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cape_processed/test/female'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_cape_f'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_cape_f'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_cape_f'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_cape_f'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_cape_f'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_cape_f'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,296 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '0'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_256_512_cape_m'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128, 256, 512]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_128_256_cape_m'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = '100000'
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127_2/cape_processed/train/male'
|
||||||
|
config['valid_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_cape_m'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_torch_cape_m'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_cape_m'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '3'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_256_512_skirt'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = True
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128, 256, 512]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_128_246_skirt'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = '225000'
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_1_skirt'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1_skirt'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1_skirt'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,297 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '1'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_256_cape_f'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128, 256]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_128_cape_f'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = '100000'
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127_2/cape_processed/train/female'
|
||||||
|
config['valid_dir'] = '/data-local/127_2/cape_processed/test/female'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cape_processed/test/female'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_cape_f'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_cape_f'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_cape_f'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_cape_f'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_cape_f'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_cape_f'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,296 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '0'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_256_cape_m'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128, 256]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_128_cape_m'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = '125000'
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127_2/cape_processed/train/male'
|
||||||
|
config['valid_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_cape_m'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_torch_cape_m'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_cape_m'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,288 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '6'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_256_norm'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = False
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128, 256]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_128_norm'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
raise NotImplementedError
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,306 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '5'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_256_reg'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = False # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128, 256]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_128_reg'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,309 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '4'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_256_skin'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = False # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128, 256]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_128_skin'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '3'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_246_skirt'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = True
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128, 256]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_128_skirt'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = '300000'
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_1_skirt'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1_skirt'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1_skirt'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,297 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '2'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_cape_f'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_cape_f'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127_2/cape_processed/train/female'
|
||||||
|
config['valid_dir'] = '/data-local/127_2/cape_processed/test/female'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cape_processed/test/female'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_cape_f'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_cape_f'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_cape_f'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_cape_f'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_cape_f'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_cape_f'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,297 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '2'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_cape_f_2'
|
||||||
|
config['notes'] = 'add a scaling to the new level'
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_cape_f'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127_2/cape_processed/train/female'
|
||||||
|
config['valid_dir'] = '/data-local/127_2/cape_processed/test/female'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cape_processed/test/female'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_cape_f'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_cape_f'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_cape_f'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_cape_f'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['scaling'] = 0.01
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_cape_f'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_cape_f'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,296 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '0'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_cape_m'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_cape_m'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127_2/cape_processed/train/male'
|
||||||
|
config['valid_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_cape_m'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_torch_cape_m'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_cape_m'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,297 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '3'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_cape_m_2'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_cape_m'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127_2/cape_processed/train/male'
|
||||||
|
config['valid_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_cape_m'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_torch_cape_m'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_cape_m'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['scaling'] = 0.01
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,288 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '5'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_norm'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = False
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_norm'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
raise NotImplementedError
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,306 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '1'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_reg'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = False # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_reg'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,306 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '4'
|
||||||
|
config['name'] = 'pyr_iccvw_64_reg_skirt_3'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = True
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = False # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = ''
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_1_skirt'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1_skirt'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1_skirt'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,309 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '5'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_skin'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = False # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_skin'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,309 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '0'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_skin_skirt'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = True
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = False # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_skin_skirt_3'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_1_skirt'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1_skirt'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1_skirt'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '4'
|
||||||
|
config['name'] = 'pyr_iccvw_64_128_skirt'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = True
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64, 128]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccvw/pyr_iccvw_64_skirt'
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_1_skirt'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1_skirt'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1_skirt'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '5'
|
||||||
|
config['name'] = 'pyr_iccvw_64_2'
|
||||||
|
config['notes'] = 'continue from previous'
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = 'checkpoints/iccvw/pyr_iccvw_64'
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = ''
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,297 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '2'
|
||||||
|
config['name'] = 'pyr_iccvw_64_cape_f'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = ''
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127_2/cape_processed/train/female'
|
||||||
|
config['valid_dir'] = '/data-local/127_2/cape_processed/test/female'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cape_processed/test/female'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_cape_f'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_cape_f'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_cape_f'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_cape_f'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_cape_f'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_cape_f'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,298 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '0'
|
||||||
|
config['name'] = 'pyr_iccvw_64_cape_m'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = ''
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127_2/cape_processed/train/male'
|
||||||
|
config['valid_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_cape_m'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_torch_cape_m'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_cape_m'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,295 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '5'
|
||||||
|
config['name'] = 'pyr_iccvw_64_cape_m_skin'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = True
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = False # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = ''
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127_2/cape_processed/train/male'
|
||||||
|
config['valid_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cape_processed/test/male'
|
||||||
|
config['train_frames'] = None
|
||||||
|
config['valid_frames'] = None
|
||||||
|
config['test_frames'] = None
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_cape_m'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_torch_cape_m'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_cape_m'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_cape_m'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,288 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '5'
|
||||||
|
config['name'] = 'pyr_iccvw_64_norm'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = False
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = ''
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
raise NotImplementedError
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,288 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '3'
|
||||||
|
config['name'] = 'pyr_iccvw_64_norm_skirt_2'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = True
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = False
|
||||||
|
|
||||||
|
config['pretrained_model'] = 'checkpoints/iccvw/pyr_iccvw_64_norm_skirt'
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = ''
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_1_skirt'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1_skirt'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1_skirt'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2 - 40*2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
raise NotImplementedError
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,306 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '1'
|
||||||
|
config['name'] = 'pyr_iccvw_64_reg'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = False # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = ''
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,306 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '4'
|
||||||
|
config['name'] = 'pyr_iccvw_64_reg_skirt_3'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = True
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = False # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = ''
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_1_skirt'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1_skirt'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1_skirt'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,309 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '0'
|
||||||
|
config['name'] = 'pyr_iccvw_64_skin'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = False
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = False # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = ''
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_4'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,309 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '0'
|
||||||
|
config['name'] = 'pyr_iccvw_64_skin_skirt_3'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = True
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = False # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = ''
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed')
|
||||||
|
config['signature'].add('mesh_unposed')
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed')
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
if config['use_skinning']:
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
else:
|
||||||
|
config['signature'].add('uv_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_1_skirt'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1_skirt'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1_skirt'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
from utils.convnext_utils import CNBlockConfig
|
||||||
|
|
||||||
|
config = dict()
|
||||||
|
|
||||||
|
config['gpu'] = '1'
|
||||||
|
config['name'] = 'pyr_iccvw_64_skirt'
|
||||||
|
config['notes'] = ''
|
||||||
|
config['tags'] = ['pyr', 'iccv', 'torch']
|
||||||
|
config['script'] = 'scripts/cvae_pyramid.py'
|
||||||
|
|
||||||
|
config['batch_size'] = 4
|
||||||
|
config['is_skirt'] = True
|
||||||
|
config['is_cape'] = False
|
||||||
|
config['device'] = 'cuda'
|
||||||
|
|
||||||
|
|
||||||
|
config['use_skinning'] = True # and deshaping
|
||||||
|
config['use_extra_losses'] = True # edge, collision, 3d mesh
|
||||||
|
config['use_norm_loss'] = True
|
||||||
|
config['use_normals'] = True
|
||||||
|
|
||||||
|
config['pretrained_model'] = ''
|
||||||
|
config['pretrained_model_iteration'] = ''
|
||||||
|
|
||||||
|
config['pyramid'] = dict()
|
||||||
|
config['pyramid']['resolutions'] = [64]
|
||||||
|
config['pyramid']['pretrained_pyramid'] = ''
|
||||||
|
config['pyramid']['pretrained_pyramid_iteration'] = ''
|
||||||
|
config['pyramid']['final_upscale_enhancer'] = ''
|
||||||
|
|
||||||
|
config['train_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['valid_dir'] = '/data-local/127/cloth3d_processed'
|
||||||
|
config['test_dir'] = '/data-local/127_2/cloth3d_processed_test'
|
||||||
|
|
||||||
|
if config['is_skirt']:
|
||||||
|
config['train_frames'] = 'frames_train_skirt.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid_skirt.txt'
|
||||||
|
config['test_frames'] = 'frames_test_skirt.txt'
|
||||||
|
else:
|
||||||
|
config['train_frames'] = 'frames_train.txt'
|
||||||
|
config['valid_frames'] = 'frames_valid.txt'
|
||||||
|
config['test_frames'] = 'frames_test.txt'
|
||||||
|
|
||||||
|
config['dataset_in_memory'] = False
|
||||||
|
config['resolution'] = None
|
||||||
|
|
||||||
|
config['smpl_res'] = 14475
|
||||||
|
if config['is_cape']:
|
||||||
|
config['smpl_res'] = 3638
|
||||||
|
|
||||||
|
config['lr'] = 0.0001
|
||||||
|
config['starting_balancing_coeff'] = 0.001
|
||||||
|
config['balancing_activation_limit'] = 0.012
|
||||||
|
config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision
|
||||||
|
config['avg_garment_path'] = ''
|
||||||
|
config['bottleneck_scale'] = 2
|
||||||
|
|
||||||
|
config['signature']: set = { 'id',
|
||||||
|
'frame_nr',
|
||||||
|
'pose_shape',
|
||||||
|
'uv_body_posed',
|
||||||
|
'mesh_body_posed',
|
||||||
|
'mesh_posed',
|
||||||
|
'mesh_unposed',
|
||||||
|
'uv_unposed',
|
||||||
|
'uv_normals',
|
||||||
|
'uv_static',
|
||||||
|
'mesh_mask',
|
||||||
|
'uv_mask',
|
||||||
|
}
|
||||||
|
|
||||||
|
config['pyramid']['is_label'] = False
|
||||||
|
# config['pyramid']['add_noise'] = False
|
||||||
|
# config['pyramid']['noise_amount'] = 0.0
|
||||||
|
|
||||||
|
config['pyramid']['loss_weights'] = [1,1,1,1,1]
|
||||||
|
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res != 512:
|
||||||
|
res_modifier = '_' + str(res)
|
||||||
|
config['signature'].add('uv_body_posed' + res_modifier)
|
||||||
|
config['signature'].add('uv_unposed' + res_modifier)
|
||||||
|
config['signature'].add('uv_normals' + res_modifier)
|
||||||
|
config['signature'].add('uv_static' + res_modifier)
|
||||||
|
config['signature'].add('uv_mask' + res_modifier)
|
||||||
|
|
||||||
|
|
||||||
|
config['static_model'] = 'checkpoints/iccvw/static_iccvw_1_skirt'
|
||||||
|
config['body_model'] = 'checkpoints/iccvw/body_iccvw_1_skirt'
|
||||||
|
config['normals_model'] = 'checkpoints/iccvw/norm_iccvw_1_skirt'
|
||||||
|
config['freeze_encoders'] = True
|
||||||
|
|
||||||
|
|
||||||
|
config['pyramid']['levels'] = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
if res == 512:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 512
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['kernel_size'] = 7
|
||||||
|
level['upscale_enhancer'] = ''
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 3),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 256:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 256
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_256_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 3),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||||
|
CNBlockConfig(128, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 3),
|
||||||
|
CNBlockConfig(64, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 128:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 128
|
||||||
|
level['kernel_size'] = 5
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_128_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 64:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 64
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_64_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(64, level['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 64, 9),
|
||||||
|
CNBlockConfig(64, 3, 9),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
elif res == 32:
|
||||||
|
level = dict()
|
||||||
|
level['resolution'] = 32
|
||||||
|
level['kernel_size'] = 3
|
||||||
|
level['upscale_enhancer'] = 'checkpoints/iccvw/iccv_32_skirt'
|
||||||
|
level['upscale_enhancer_freeze'] = True
|
||||||
|
level['bottleneck_size'] = 64 * config['bottleneck_scale']
|
||||||
|
level['input_features'] = 3+3+3+3 if config['use_normals'] else 3+3+3
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'], None, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(level['bottleneck_size'] * 2, 3, 16),
|
||||||
|
]
|
||||||
|
|
||||||
|
level['encoder_block_settings'] = block_setting
|
||||||
|
level['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['pyramid']['levels'].append(level)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_norm ############################
|
||||||
|
config['cond_ae_norm'] = dict()
|
||||||
|
config['cond_ae_norm']['device'] = config['device']
|
||||||
|
config['cond_ae_norm']['is_label'] = False
|
||||||
|
# config['cond_ae_norm']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_norm']['kernel_size'] = 7
|
||||||
|
config['cond_ae_norm']['bottleneck_size'] = 40 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_norm']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_norm']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_norm']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_norm']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_norm']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
|
||||||
|
####################### cond_ae_body ############################
|
||||||
|
config['cond_ae_body'] = dict()
|
||||||
|
config['cond_ae_body']['device'] = config['device']
|
||||||
|
config['cond_ae_body']['is_label'] = False
|
||||||
|
# config['cond_ae_body']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_body']['kernel_size'] = 7
|
||||||
|
config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, 128, 9),
|
||||||
|
CNBlockConfig(128, config['cond_ae_body']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_body']['bottleneck_size'], 128, 3),
|
||||||
|
CNBlockConfig(128, 64, 9),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_body']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_body']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_body']['activation'] = 'tanh'
|
||||||
|
|
||||||
|
####################### cond_ae_static ############################
|
||||||
|
config['cond_ae_static'] = dict()
|
||||||
|
config['cond_ae_static']['device'] = config['device']
|
||||||
|
config['cond_ae_static']['is_label'] = False
|
||||||
|
# config['cond_ae_static']['latent_dim'] = config['latent_dim']
|
||||||
|
config['cond_ae_static']['kernel_size'] = 7
|
||||||
|
config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale']
|
||||||
|
|
||||||
|
block_setting = [
|
||||||
|
CNBlockConfig(8, 16, 3),
|
||||||
|
CNBlockConfig(16, 32, 3),
|
||||||
|
CNBlockConfig(32, 64, 3),
|
||||||
|
CNBlockConfig(64, config['cond_ae_static']['bottleneck_size'], 9),
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], None, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
block_setting_reverse = [
|
||||||
|
CNBlockConfig(config['cond_ae_static']['bottleneck_size'], 64, 3),
|
||||||
|
CNBlockConfig(64, 32, 9),
|
||||||
|
CNBlockConfig(32, 16, 3),
|
||||||
|
CNBlockConfig(16, 8, 3),
|
||||||
|
CNBlockConfig(8, 3, 3),
|
||||||
|
]
|
||||||
|
|
||||||
|
config['cond_ae_static']['encoder_block_settings'] = block_setting
|
||||||
|
config['cond_ae_static']['decoder_block_settings'] = block_setting_reverse
|
||||||
|
config['cond_ae_static']['activation'] = 'tanh'
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+38
-170
@@ -9,9 +9,6 @@ from plotly.subplots import make_subplots
|
|||||||
from torchvision.transforms import Resize
|
from torchvision.transforms import Resize
|
||||||
from torchvision.transforms.functional import InterpolationMode
|
from torchvision.transforms.functional import InterpolationMode
|
||||||
|
|
||||||
# from tensorflow_graphics.geometry.convolution.graph_pooling import pool, unpool
|
|
||||||
# from tensorflow_graphics.geometry.convolution.graph_convolution import edge_convolution_template
|
|
||||||
|
|
||||||
|
|
||||||
def m2uv_array(m2uv, is_smpl_orig=False):
|
def m2uv_array(m2uv, is_smpl_orig=False):
|
||||||
result = np.zeros((14475 if not is_smpl_orig else 3638, 2), dtype=np.int32)
|
result = np.zeros((14475 if not is_smpl_orig else 3638, 2), dtype=np.int32)
|
||||||
@@ -38,33 +35,14 @@ class UV2Mesh(nn.Module):
|
|||||||
self.uv_pixels = self.uv_map_discreet[m2uv]
|
self.uv_pixels = self.uv_map_discreet[m2uv]
|
||||||
self.smpl_res = 14475 if not is_smpl_orig else 3638
|
self.smpl_res = 14475 if not is_smpl_orig else 3638
|
||||||
|
|
||||||
|
self.resizer = Resize(size=(512, 256), interpolation=InterpolationMode.BILINEAR)
|
||||||
|
|
||||||
|
|
||||||
def uv_to_mesh(self, uv):
|
def uv_to_mesh(self, uv):
|
||||||
if uv.shape[1] == 3 or uv.shape[1] == 7:
|
if uv.shape[1] == 3 or uv.shape[1] == 7:
|
||||||
uv = torch.permute(uv, [0,2,3,1])
|
uv = torch.permute(uv, [0,2,3,1])
|
||||||
if uv.shape[1] != 512:
|
if uv.shape[1] != 512:
|
||||||
raise NotImplementedError
|
uv = torch.permute(self.resizer(torch.permute(uv, [0,3,1,2])), [0,2,3,1])
|
||||||
uv = Resize(uv[:,:,None], size=(512, 256), interpolation=InterpolationMode.BILINEAR)
|
|
||||||
|
|
||||||
# batch_size = uv.shape[0]
|
|
||||||
|
|
||||||
# x1_ind = tf.concat((tf.tile(self.uv_pixels[:, 0, :][tf.newaxis, :, :], [batch_size, 1, 1]), tf.zeros((batch_size, self.smpl_res, 1), dtype=tf.int32)), axis=-1)
|
|
||||||
# y1_ind = tf.concat((tf.tile(self.uv_pixels[:, 0, :][tf.newaxis, :, :], [batch_size, 1, 1]), tf.ones((batch_size, self.smpl_res, 1), dtype=tf.int32)), axis=-1)
|
|
||||||
# z1_ind = tf.concat((tf.tile(self.uv_pixels[:, 0, :][tf.newaxis, :, :], [batch_size, 1, 1]), tf.ones((batch_size, self.smpl_res, 1), dtype=tf.int32) * 2), axis=-1)
|
|
||||||
# x2_ind = tf.concat((tf.tile(self.uv_pixels[:, 1, :][tf.newaxis, :, :], [batch_size, 1, 1]), tf.zeros((batch_size, self.smpl_res, 1), dtype=tf.int32)), axis=-1)
|
|
||||||
# y2_ind = tf.concat((tf.tile(self.uv_pixels[:, 1, :][tf.newaxis, :, :], [batch_size, 1, 1]), tf.ones((batch_size, self.smpl_res, 1), dtype=tf.int32)), axis=-1)
|
|
||||||
# z2_ind = tf.concat((tf.tile(self.uv_pixels[:, 1, :][tf.newaxis, :, :], [batch_size, 1, 1]), tf.ones((batch_size, self.smpl_res, 1), dtype=tf.int32) * 2), axis=-1)
|
|
||||||
|
|
||||||
|
|
||||||
# x1 = tf.gather_nd(uv, x1_ind, batch_dims=1)
|
|
||||||
# y1 = tf.gather_nd(uv, y1_ind, batch_dims=1)
|
|
||||||
# z1 = tf.gather_nd(uv, z1_ind, batch_dims=1)
|
|
||||||
# x2 = tf.gather_nd(uv, x2_ind, batch_dims=1)
|
|
||||||
# y2 = tf.gather_nd(uv, y2_ind, batch_dims=1)
|
|
||||||
# z2 = tf.gather_nd(uv, z2_ind, batch_dims=1)
|
|
||||||
|
|
||||||
# p1 = tf.stack((x1, y1, z1), axis=-1)
|
|
||||||
# p2 = tf.stack((x2, y2, z2), axis=-1)
|
|
||||||
|
|
||||||
mesh = torch.mean(uv[:, self.uv_pixels[:,:,0], self.uv_pixels[:,:,1]].float(), dim=2)
|
mesh = torch.mean(uv[:, self.uv_pixels[:,:,0], self.uv_pixels[:,:,1]].float(), dim=2)
|
||||||
return mesh
|
return mesh
|
||||||
@@ -75,35 +53,6 @@ class UV2Mesh(nn.Module):
|
|||||||
return x
|
return x
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class UV2MeshLabel():
|
|
||||||
def __init__(self, res=256, is_skirt=False, is_smpl_orig=False):
|
|
||||||
super(UV2MeshLabel, self).__init__()
|
|
||||||
self.res = res
|
|
||||||
uv_map = np.load('custom_utils/stretched_uv_map_' + ('skirt' if is_skirt else '3') + ('_orig' if is_smpl_orig else '') + '.npy')
|
|
||||||
self.uv_map_discreet = np.floor(uv_map * self.res).astype(np.int32)
|
|
||||||
m2uv = np.load('custom_utils/m2uv' + ('_skirt' if is_skirt else '') + ('_orig' if is_smpl_orig else '') + '.npy', allow_pickle=True).item()
|
|
||||||
m2uv = m2uv_array(m2uv, is_smpl_orig=is_smpl_orig)
|
|
||||||
self.uv_pixels = self.uv_map_discreet[m2uv]
|
|
||||||
|
|
||||||
# input = channels_first
|
|
||||||
# @tf.function
|
|
||||||
def uv_to_mesh(self, uv):
|
|
||||||
batch_size = uv.shape[0]
|
|
||||||
|
|
||||||
x1_ind = tf.tile(self.uv_pixels[:, 0, :][tf.newaxis, :, :], [batch_size, 1, 1])
|
|
||||||
x2_ind = tf.tile(self.uv_pixels[:, 1, :][tf.newaxis, :, :], [batch_size, 1, 1])
|
|
||||||
|
|
||||||
x1 = tf.gather_nd(uv, x1_ind, batch_dims=1)
|
|
||||||
x2 = tf.gather_nd(uv, x2_ind, batch_dims=1)
|
|
||||||
|
|
||||||
mesh = (x1 + x2) / 2
|
|
||||||
return mesh
|
|
||||||
|
|
||||||
def __call__(self, uv):
|
|
||||||
return self.uv_to_mesh(uv)
|
|
||||||
|
|
||||||
|
|
||||||
def _maskFaces(V, F, mask, return_unfixed=False):
|
def _maskFaces(V, F, mask, return_unfixed=False):
|
||||||
V_mask = mask
|
V_mask = mask
|
||||||
F_mask = np.take(V_mask, F.reshape(-1), axis=0)
|
F_mask = np.take(V_mask, F.reshape(-1), axis=0)
|
||||||
@@ -120,20 +69,6 @@ def _maskFaces(V, F, mask, return_unfixed=False):
|
|||||||
return V_new, F_new
|
return V_new, F_new
|
||||||
|
|
||||||
|
|
||||||
# def _maskFaces_tf(V, F, mask):
|
|
||||||
# V_mask = mask
|
|
||||||
# F_mask = tf.gather(V_mask, F.reshape(-1), axis=0)
|
|
||||||
# F_mask = F_mask.reshape((-1, 3)).sum(axis=1) == 3
|
|
||||||
# F_mask = tf.reduce_sum(tf.reshape(F_mask, (-1, 3)), axis=1) == 3
|
|
||||||
|
|
||||||
# V_ind = tf.zeros(V_mask.shape)
|
|
||||||
# V_ind[V_mask] = tf.range(V_mask.sum())
|
|
||||||
# F_new = tf.gather(V_ind, F[F_mask, :].reshape(-1), axis=0).reshape((-1, 3))
|
|
||||||
# V_new = V[V_mask, :]
|
|
||||||
|
|
||||||
# return V_new, F_new
|
|
||||||
|
|
||||||
|
|
||||||
def maskFacesBatch(V, F, mask):
|
def maskFacesBatch(V, F, mask):
|
||||||
Vs = []
|
Vs = []
|
||||||
Fs = []
|
Fs = []
|
||||||
@@ -273,25 +208,6 @@ def plot_3d_collision(gt, collision_1, collision_2, collision_faces, collision_c
|
|||||||
return fig
|
return fig
|
||||||
|
|
||||||
|
|
||||||
def batch_to_dict(batch, signature):
|
|
||||||
result = dict()
|
|
||||||
for i, key in enumerate(signature.keys()):
|
|
||||||
result[key] = batch[i]
|
|
||||||
return result
|
|
||||||
|
|
||||||
conditions = ['pose_shape', 'uv_static', 'uv_mask', 'uv_shaped_body']
|
|
||||||
def nest_conditions(batch):
|
|
||||||
batch['conditions'] = {d: batch.pop(d) for d in conditions}
|
|
||||||
return batch
|
|
||||||
|
|
||||||
|
|
||||||
def sparse_to_tensor(L):
|
|
||||||
idx = np.mat([L.row, L.col]).transpose().astype(np.float32)
|
|
||||||
data = L.data.astype(dtype=np.float32)
|
|
||||||
shape = L.shape
|
|
||||||
return tf.SparseTensor(idx, data, shape)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_summary_str(model):
|
def get_summary_str(model):
|
||||||
# from torchview import draw_graph
|
# from torchview import draw_graph
|
||||||
@@ -305,6 +221,7 @@ def get_summary_str(model):
|
|||||||
|
|
||||||
return [f'all_params: {total_params}, trainable: {trainable_params}']
|
return [f'all_params: {total_params}, trainable: {trainable_params}']
|
||||||
|
|
||||||
|
|
||||||
def get_summary_html(model):
|
def get_summary_html(model):
|
||||||
lines = get_summary_str(model)
|
lines = get_summary_str(model)
|
||||||
html = ''
|
html = ''
|
||||||
@@ -313,88 +230,6 @@ def get_summary_html(model):
|
|||||||
return html
|
return html
|
||||||
|
|
||||||
|
|
||||||
def repeat_laplacian(L, times):
|
|
||||||
idx = np.repeat(np.mat([L.row, L.col]), repeats=times, axis=1)
|
|
||||||
idx_offset = np.linspace(0, L.shape[0] * (times-1), times).astype(np.int32)
|
|
||||||
idx_offset = np.repeat(idx_offset, L.row.shape[0], axis=0)
|
|
||||||
idx += idx_offset[np.newaxis,:]
|
|
||||||
data = np.repeat(L.data, repeats=times, axis=0)
|
|
||||||
shape = (L.shape[0] * times, L.shape[1] * times)
|
|
||||||
return sp.sparse.coo_matrix((data, (np.squeeze(np.asarray(idx[0,:])), np.squeeze(np.asarray(idx[1,:])))), shape)
|
|
||||||
|
|
||||||
|
|
||||||
def merge_verts(Vs, batchDim):
|
|
||||||
V = tf.concat(tf.unstack(Vs, num=batchDim), axis=0)
|
|
||||||
return V
|
|
||||||
|
|
||||||
|
|
||||||
class GraphConvolution(nn.Module):
|
|
||||||
def __init__(self, shape, activation=None, name='gcn', L=None, batchSize=None, normalization=None):
|
|
||||||
super(GraphConvolution, self).__init__()
|
|
||||||
self.shape = shape
|
|
||||||
self.w = self.add_weight(name=name + '/weight', shape=(2, *shape), initializer=tf.initializers.glorot_normal, trainable=True)
|
|
||||||
self.b = self.add_weight(name=name + '/bias', shape=shape[-1], initializer=tf.initializers.zeros, trainable=True)
|
|
||||||
self.activation = activation or (lambda x: x)
|
|
||||||
self.normalization = normalization
|
|
||||||
self.batchSize = batchSize
|
|
||||||
self.indices = tf.cast(tf.linspace(0, self.batchSize * L.shape[1], self.batchSize+1), dtype=tf.int32)
|
|
||||||
self.L = repeat_laplacian(L, self.batchSize)
|
|
||||||
|
|
||||||
def gather(self):
|
|
||||||
return [self.w, self.b]
|
|
||||||
|
|
||||||
def _single(self, X):
|
|
||||||
X0 = tf.einsum('ab,bc->ac', X, self.w[0]) # Node
|
|
||||||
X1 = tf.einsum('ab,bc->ac', X, self.w[1]) # Neigh
|
|
||||||
# Neigh conv
|
|
||||||
X1 = edge_convolution_template(
|
|
||||||
X1, sparse_to_tensor(self.L), sizes=None,
|
|
||||||
edge_function=lambda x, y: y,
|
|
||||||
reduction='weighted',
|
|
||||||
edge_function_kwargs={}
|
|
||||||
)
|
|
||||||
X = X0 + X1 + self.b
|
|
||||||
return X
|
|
||||||
|
|
||||||
def call(self, X, training):
|
|
||||||
X = merge_verts(X, self.batchSize)
|
|
||||||
X = self._single(X)
|
|
||||||
X = tf.stack([X[self.indices[i-1]:self.indices[i]] for i in range(1, len(self.indices))])
|
|
||||||
X = self.activation(X)
|
|
||||||
if self.normalization:
|
|
||||||
X = self.normalization(X, training=training)
|
|
||||||
return X
|
|
||||||
|
|
||||||
|
|
||||||
def replace_arrays(string):
|
|
||||||
out = string[:1]
|
|
||||||
i = 0
|
|
||||||
while i < len(string) and string[i+1:].find('[') != -1:
|
|
||||||
start = string[i+1:].find('[')
|
|
||||||
end = string[i+1+start:].find(']')
|
|
||||||
out += string[i+1:i+1+start]
|
|
||||||
array = string[i+1+start:i+1+start+end+1].replace('\n', '')
|
|
||||||
out += array
|
|
||||||
i = i + 1 + start + end
|
|
||||||
|
|
||||||
out += string[i+1:]
|
|
||||||
|
|
||||||
return out
|
|
||||||
|
|
||||||
|
|
||||||
def group_inputs_for_levels(batch, config):
|
|
||||||
levels_input = []
|
|
||||||
for res in config['pyramid']['resolutions']:
|
|
||||||
res_modifier = '_' + str(res) if res != 512 else ''
|
|
||||||
if config['use_skinning']:
|
|
||||||
uv_orig = batch['uv_unposed' + res_modifier]
|
|
||||||
else:
|
|
||||||
uv_orig = batch['uv_posed' + res_modifier]
|
|
||||||
levels_input.append([uv_orig, batch['uv_static' + res_modifier], batch['uv_body_posed' + res_modifier], batch['uv_curvature' + res_modifier], batch['uv_mask' + res_modifier], batch['uv_mask']])
|
|
||||||
conds = [batch['uv_static'], batch['uv_body_posed'], batch['uv_curvature']]
|
|
||||||
return levels_input, conds
|
|
||||||
|
|
||||||
|
|
||||||
class Accumulator():
|
class Accumulator():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.dict = dict()
|
self.dict = dict()
|
||||||
@@ -434,4 +269,37 @@ def write_obj(file, vertices, faces, colors):
|
|||||||
file.write(line)
|
file.write(line)
|
||||||
for f in faces:
|
for f in faces:
|
||||||
line = 'f ' + ' '.join([str(_) for _ in f]) + '\n'
|
line = 'f ' + ' '.join([str(_) for _ in f]) + '\n'
|
||||||
file.write(line)
|
file.write(line)
|
||||||
|
|
||||||
|
|
||||||
|
def group_inputs_for_levels(batch, config):
|
||||||
|
levels_input = []
|
||||||
|
for res in config['pyramid']['resolutions']:
|
||||||
|
res_modifier = '_' + str(res) if res != 512 else ''
|
||||||
|
if config['use_skinning']:
|
||||||
|
uv_orig = batch['uv_unposed' + res_modifier]
|
||||||
|
else:
|
||||||
|
uv_orig = batch['uv_posed' + res_modifier]
|
||||||
|
levels_input.append([uv_orig, batch['uv_static' + res_modifier], batch['uv_body_posed' + res_modifier], batch['uv_normals' + res_modifier], batch['uv_mask' + res_modifier], batch['uv_mask']])
|
||||||
|
conds = [batch['uv_static'], batch['uv_body_posed'], batch['uv_normals']]
|
||||||
|
return levels_input, conds
|
||||||
|
|
||||||
|
|
||||||
|
def remove_long_edges(vertices, faces, limit=0.1):
|
||||||
|
# Compute edge lengths
|
||||||
|
edges = np.vstack((faces[:,[0,1]], faces[:,[1,2]], faces[:,[2,0]]))
|
||||||
|
edge_lengths = np.linalg.norm(vertices[edges[:,0]] - vertices[edges[:,1]], axis=1)
|
||||||
|
|
||||||
|
# Find edges longer than 0.1
|
||||||
|
long_edges = edges[edge_lengths > limit]
|
||||||
|
|
||||||
|
# Find vertices that are part of long edges
|
||||||
|
vertices_to_remove = np.unique(long_edges)
|
||||||
|
|
||||||
|
# Remove vertices and update faces
|
||||||
|
mask = np.ones(vertices.shape[0], dtype=bool)
|
||||||
|
mask[vertices_to_remove] = False
|
||||||
|
new_vertices = vertices[mask]
|
||||||
|
|
||||||
|
|
||||||
|
return new_vertices, mask
|
||||||
@@ -62,8 +62,8 @@ def get_frames(folder):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("-f", "--folder", help = "end of range", default='')
|
parser.add_argument("-f", "--folder", help = "end of range", default='/data-net/dataset/00761')
|
||||||
parser.add_argument("-f_obj", "--folder_object", help = "end of range", default='/')
|
parser.add_argument("-f_obj", "--folder_object", help = "end of range", default='/data-net/dataset/cloth3d/train')
|
||||||
parser.add_argument("-s", "--start", help = "start of range", default=0)
|
parser.add_argument("-s", "--start", help = "start of range", default=0)
|
||||||
parser.add_argument("-e", "--end", help = "end of range", default=10)
|
parser.add_argument("-e", "--end", help = "end of range", default=10)
|
||||||
parser.add_argument("-n", "--name", help = "end of range", default='lhunor')
|
parser.add_argument("-n", "--name", help = "end of range", default='lhunor')
|
||||||
|
|||||||
+12
-1
@@ -342,7 +342,6 @@ import sys
|
|||||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
|
||||||
|
|
||||||
import plotly.graph_objects as go
|
import plotly.graph_objects as go
|
||||||
from custom_utils.custom_utils import _maskFaces
|
|
||||||
|
|
||||||
def plot_3d(mesh, faces):
|
def plot_3d(mesh, faces):
|
||||||
fig = go.Figure()
|
fig = go.Figure()
|
||||||
@@ -370,7 +369,19 @@ def plot_3d(mesh, faces):
|
|||||||
return fig
|
return fig
|
||||||
|
|
||||||
|
|
||||||
|
def quads2tris(F):
|
||||||
|
out = []
|
||||||
|
for f in F:
|
||||||
|
if len(f) == 3: out += [f]
|
||||||
|
elif len(f) == 4: out += [[f[0],f[1],f[2]],
|
||||||
|
[f[0],f[2],f[3]]]
|
||||||
|
else: print("This should not happen...")
|
||||||
|
return np.array(out, np.int32)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
from custom_utils.custom_utils import _maskFaces
|
||||||
|
|
||||||
folder = '/home/workspace/data/dataset/cloth3d/train'
|
folder = '/home/workspace/data/dataset/cloth3d/train'
|
||||||
F = np.load("custom_utils/smpl_faces.npy")#.astype(np.int32)
|
F = np.load("custom_utils/smpl_faces.npy")#.astype(np.int32)
|
||||||
|
|||||||
+120
-143
@@ -12,7 +12,7 @@ import pickle
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import scipy as sp
|
import scipy as sp
|
||||||
import trimesh as tm
|
import trimesh as tm
|
||||||
import cmapy as cm
|
# import cmapy as cm
|
||||||
import tables as tb
|
import tables as tb
|
||||||
import scipy.io as sio
|
import scipy.io as sio
|
||||||
import scipy.interpolate as spi
|
import scipy.interpolate as spi
|
||||||
@@ -24,7 +24,7 @@ import plotly.graph_objects as go
|
|||||||
|
|
||||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
|
||||||
from data.cloth3d_io import read_garment_mask, read_garment_template, read_posed_garment_frame, loadInfo, read_posed_body_frame, read_posed_body, read_posed_garment, read_curvatures
|
from data.cloth3d_io import read_garment_mask, read_garment_template, read_posed_garment_frame, loadInfo, read_posed_body_frame, read_posed_body, read_posed_garment, read_curvatures
|
||||||
from data.utils import save_to_h5file
|
from data.cloth3d_io import readPC2
|
||||||
|
|
||||||
|
|
||||||
os.environ["CUDA_VISIBLE_DEVICES"] = "6"
|
os.environ["CUDA_VISIBLE_DEVICES"] = "6"
|
||||||
@@ -34,26 +34,26 @@ def convert_to_uv(res, m2uv, uv_map, verts, neighbours=10, mask=None, method='rb
|
|||||||
uv_values = np.zeros((uv_map.shape[0], 3))
|
uv_values = np.zeros((uv_map.shape[0], 3))
|
||||||
uv_values[m2uv[:, 0]] = verts
|
uv_values[m2uv[:, 0]] = verts
|
||||||
uv_values[m2uv[:, 1]] += verts
|
uv_values[m2uv[:, 1]] += verts
|
||||||
uv_values = uv_values[uv_map_mask, :] # add garment mask
|
uv_values = uv_values[uv_map_mask[type], :] # add garment mask
|
||||||
uv_values /= uv_counter[:, np.newaxis]
|
uv_values /= uv_counter[type][:, np.newaxis]
|
||||||
return_garment_uv_mask = False
|
return_garment_uv_mask = False
|
||||||
|
|
||||||
if mask is not None:
|
if mask is not None:
|
||||||
garment_mask = np.zeros((uv_map.shape[0]), dtype=bool)
|
garment_mask = np.zeros((uv_map.shape[0]), dtype=bool)
|
||||||
garment_mask[m2uv[:, 0]] = mask
|
garment_mask[m2uv[:, 0]] = mask
|
||||||
garment_mask[m2uv[:, 1]] += mask
|
garment_mask[m2uv[:, 1]] += mask
|
||||||
garment_mask = garment_mask[uv_map_mask] # add garment mask
|
garment_mask = garment_mask[uv_map_mask[type]] # add garment mask
|
||||||
else:
|
else:
|
||||||
garment_mask = np.sum(uv_values, axis=-1) != 0
|
garment_mask = np.sum(uv_values, axis=-1) != 0
|
||||||
|
|
||||||
# test
|
# test
|
||||||
verts_uv[uv_map_discreet_unique[:, 0], uv_map_discreet_unique[:, 1], :] = uv_values
|
verts_uv[uv_map_discreet_unique[type][:, 0], uv_map_discreet_unique[type][:, 1], :] = uv_values
|
||||||
# verts_uv_save = verts_uv.copy()
|
# verts_uv_save = verts_uv.copy()
|
||||||
|
|
||||||
# garment_mask = np.sum(uv_values, axis=-1) != 0
|
# garment_mask = np.sum(uv_values, axis=-1) != 0
|
||||||
unique_uv_values = uv_values[garment_mask, :]
|
unique_uv_values = uv_values[garment_mask, :]
|
||||||
uv_map_discreet_unique_unique = uv_map_discreet_unique[garment_mask, :]
|
uv_map_discreet_unique_unique = uv_map_discreet_unique[type][garment_mask, :]
|
||||||
rbf_dest_current = rbf_dest
|
rbf_dest_current = rbf_dest[type]
|
||||||
|
|
||||||
if garment_uv_mask is None and mask is not None:
|
if garment_uv_mask is None and mask is not None:
|
||||||
garment_uv_mask = np.zeros((res * 2, res))
|
garment_uv_mask = np.zeros((res * 2, res))
|
||||||
@@ -62,8 +62,8 @@ def convert_to_uv(res, m2uv, uv_map, verts, neighbours=10, mask=None, method='rb
|
|||||||
garment_uv_mask_border = garment_uv_mask.astype(bool)
|
garment_uv_mask_border = garment_uv_mask.astype(bool)
|
||||||
garment_uv_mask = cv2.dilate(garment_uv_mask, cv2.getStructuringElement(cv2.MORPH_RECT, (2 * 2 + 1, 2 * 2 + 1), (2, 2)), iterations=2).astype(bool)
|
garment_uv_mask = cv2.dilate(garment_uv_mask, cv2.getStructuringElement(cv2.MORPH_RECT, (2 * 2 + 1, 2 * 2 + 1), (2, 2)), iterations=2).astype(bool)
|
||||||
garment_uv_mask_border = ~garment_uv_mask_border & garment_uv_mask
|
garment_uv_mask_border = ~garment_uv_mask_border & garment_uv_mask
|
||||||
garment_uv_mask = garment_uv_mask * uv_mask[:,:,0]
|
garment_uv_mask = garment_uv_mask * uv_mask[type][:,:,0]
|
||||||
rbf_dest_current = rbf_dest * garment_uv_mask
|
rbf_dest_current = rbf_dest[type] * garment_uv_mask
|
||||||
return_garment_uv_mask = True
|
return_garment_uv_mask = True
|
||||||
|
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ def convert_to_uv(res, m2uv, uv_map, verts, neighbours=10, mask=None, method='rb
|
|||||||
# rbf_dest[:, [0,1]] = rbf_dest[:, [1, 0]]
|
# rbf_dest[:, [0,1]] = rbf_dest[:, [1, 0]]
|
||||||
|
|
||||||
result[rbf_dest_current[:, 0], rbf_dest_current[:, 1], :] = final
|
result[rbf_dest_current[:, 0], rbf_dest_current[:, 1], :] = final
|
||||||
result[uv_map_discreet_unique[:, 0], uv_map_discreet_unique[:, 1], :] = uv_values
|
result[uv_map_discreet_unique[type][:, 0], uv_map_discreet_unique[type][:, 1], :] = uv_values
|
||||||
if garment_uv_mask is not None:
|
if garment_uv_mask is not None:
|
||||||
result = result * garment_uv_mask[:,:,np.newaxis]
|
result = result * garment_uv_mask[:,:,np.newaxis]
|
||||||
|
|
||||||
@@ -102,26 +102,26 @@ def convert_to_uv_batch_body(res, m2uv, uv_map, verts, neighbours=15, mask=None,
|
|||||||
uv_values = np.zeros((batch, uv_map.shape[0], 3))
|
uv_values = np.zeros((batch, uv_map.shape[0], 3))
|
||||||
uv_values[:, m2uv[:, 0]] = verts
|
uv_values[:, m2uv[:, 0]] = verts
|
||||||
uv_values[:, m2uv[:, 1]] += verts
|
uv_values[:, m2uv[:, 1]] += verts
|
||||||
uv_values = uv_values[:, uv_map_mask, :]
|
uv_values = uv_values[:, uv_map_mask['non-skirt'], :]
|
||||||
uv_values /= uv_counter[np.newaxis, :, np.newaxis]
|
uv_values /= uv_counter['non-skirt'][np.newaxis, :, np.newaxis]
|
||||||
return_garment_uv_mask = False
|
return_garment_uv_mask = False
|
||||||
# test
|
# test
|
||||||
verts_uv[:, uv_map_discreet_unique[:, 0], uv_map_discreet_unique[:, 1], :] = uv_values
|
verts_uv[:, uv_map_discreet_unique['non-skirt'][:, 0], uv_map_discreet_unique['non-skirt'][:, 1], :] = uv_values
|
||||||
|
|
||||||
if mask is not None:
|
if mask is not None:
|
||||||
garment_mask = np.zeros((uv_map.shape[0]), dtype=bool)
|
garment_mask = np.zeros((uv_map.shape[0]), dtype=bool)
|
||||||
garment_mask[m2uv[:, 0]] = mask
|
garment_mask[m2uv[:, 0]] = mask
|
||||||
garment_mask[m2uv[:, 1]] += mask
|
garment_mask[m2uv[:, 1]] += mask
|
||||||
garment_mask = garment_mask[uv_map_mask] # add garment mask
|
garment_mask = garment_mask[uv_map_mask['non-skirt']] # add garment mask
|
||||||
else:
|
else:
|
||||||
garment_mask = np.sum(uv_values[0,:,:], axis=-1) != 0
|
garment_mask = np.sum(uv_values[0,:,:], axis=-1) != 0
|
||||||
|
|
||||||
unique_uv_values = uv_values[:, garment_mask, :]
|
unique_uv_values = uv_values[:, garment_mask, :]
|
||||||
uv_map_discreet_unique_unique = uv_map_discreet_unique[garment_mask, :]
|
uv_map_discreet_unique_unique = uv_map_discreet_unique['non-skirt'][garment_mask, :]
|
||||||
rbf_dest_current = rbf_dest
|
rbf_dest_current = rbf_dest['non-skirt']
|
||||||
|
|
||||||
# add back mesh vertices that are not part of the garment
|
# add back mesh vertices that are not part of the garment
|
||||||
uv_map_discreet_unique_unique_inv = uv_map_discreet_unique[np.invert(garment_mask), :]
|
uv_map_discreet_unique_unique_inv = uv_map_discreet_unique['non-skirt'][np.invert(garment_mask), :]
|
||||||
rbf_dest_fill = np.zeros((res * 2, res), dtype=bool)
|
rbf_dest_fill = np.zeros((res * 2, res), dtype=bool)
|
||||||
rbf_dest_fill[uv_map_discreet_unique_unique_inv[:, 0], uv_map_discreet_unique_unique_inv[:, 1]] = True
|
rbf_dest_fill[uv_map_discreet_unique_unique_inv[:, 0], uv_map_discreet_unique_unique_inv[:, 1]] = True
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ def convert_to_uv_batch_body(res, m2uv, uv_map, verts, neighbours=15, mask=None,
|
|||||||
return_garment_uv_mask = True
|
return_garment_uv_mask = True
|
||||||
|
|
||||||
if garment_uv_mask is not None:
|
if garment_uv_mask is not None:
|
||||||
rbf_dest_current = (rbf_dest + rbf_dest_fill) * garment_uv_mask + garment_uv_mask_border
|
rbf_dest_current = (rbf_dest['non-skirt'] + rbf_dest_fill) * garment_uv_mask + garment_uv_mask_border
|
||||||
|
|
||||||
rbf_dest_current = np.nonzero(rbf_dest_current)
|
rbf_dest_current = np.nonzero(rbf_dest_current)
|
||||||
rbf_dest_current = np.array(rbf_dest_current).T
|
rbf_dest_current = np.array(rbf_dest_current).T
|
||||||
@@ -172,18 +172,18 @@ def convert_to_uv_batch(res, m2uv, uv_map, verts, neighbours=15, mask=None, meth
|
|||||||
garment_mask = np.zeros((uv_map.shape[0]), dtype=bool)
|
garment_mask = np.zeros((uv_map.shape[0]), dtype=bool)
|
||||||
garment_mask[m2uv[:, 0]] = mask
|
garment_mask[m2uv[:, 0]] = mask
|
||||||
garment_mask[m2uv[:, 1]] += mask
|
garment_mask[m2uv[:, 1]] += mask
|
||||||
garment_mask = garment_mask[uv_map_mask] # add garment mask
|
garment_mask = garment_mask[uv_map_mask[type]] # add garment mask
|
||||||
|
|
||||||
rbf_dest_current = rbf_dest
|
rbf_dest_current = rbf_dest[type]
|
||||||
|
|
||||||
# add back mesh vertices that are not part of the garment
|
# add back mesh vertices that are not part of the garment
|
||||||
uv_map_discreet_unique_unique_inv = uv_map_discreet_unique[np.invert(garment_mask), :]
|
uv_map_discreet_unique_unique_inv = uv_map_discreet_unique[type][np.invert(garment_mask), :]
|
||||||
rbf_dest_fill = np.zeros((res * 2, res), dtype=bool)
|
rbf_dest_fill = np.zeros((res * 2, res), dtype=bool)
|
||||||
rbf_dest_fill[uv_map_discreet_unique_unique_inv[:, 0], uv_map_discreet_unique_unique_inv[:, 1]] = True
|
rbf_dest_fill[uv_map_discreet_unique_unique_inv[:, 0], uv_map_discreet_unique_unique_inv[:, 1]] = True
|
||||||
|
|
||||||
assert not (garment_uv_mask is None and mask is not None)
|
assert not (garment_uv_mask is None and mask is not None)
|
||||||
assert garment_uv_mask is not None
|
assert garment_uv_mask is not None
|
||||||
rbf_dest_current = (rbf_dest + rbf_dest_fill) * garment_uv_mask + garment_uv_mask_border
|
rbf_dest_current = (rbf_dest[type] + rbf_dest_fill) * garment_uv_mask + garment_uv_mask_border
|
||||||
|
|
||||||
rbf_dest_current = np.nonzero(rbf_dest_current)
|
rbf_dest_current = np.nonzero(rbf_dest_current)
|
||||||
rbf_dest_current = np.array(rbf_dest_current).T
|
rbf_dest_current = np.array(rbf_dest_current).T
|
||||||
@@ -196,11 +196,11 @@ def convert_to_uv_batch(res, m2uv, uv_map, verts, neighbours=15, mask=None, meth
|
|||||||
uv_values = np.zeros((uv_map.shape[0], 3))
|
uv_values = np.zeros((uv_map.shape[0], 3))
|
||||||
uv_values[m2uv[:, 0]] = verts[i]
|
uv_values[m2uv[:, 0]] = verts[i]
|
||||||
uv_values[m2uv[:, 1]] += verts[i]
|
uv_values[m2uv[:, 1]] += verts[i]
|
||||||
uv_values = uv_values[uv_map_mask, :]
|
uv_values = uv_values[uv_map_mask[type], :]
|
||||||
uv_values /= uv_counter[:, np.newaxis]
|
uv_values /= uv_counter[type][:, np.newaxis]
|
||||||
|
|
||||||
unique_uv_values = uv_values[garment_mask, :]
|
unique_uv_values = uv_values[garment_mask, :]
|
||||||
uv_map_discreet_unique_unique = uv_map_discreet_unique[garment_mask, :]
|
uv_map_discreet_unique_unique = uv_map_discreet_unique[type][garment_mask, :]
|
||||||
|
|
||||||
interpolator = spi.RBFInterpolator(y=uv_map_discreet_unique_unique, d=unique_uv_values[:,:], neighbors=neighbours, kernel='linear')
|
interpolator = spi.RBFInterpolator(y=uv_map_discreet_unique_unique, d=unique_uv_values[:,:], neighbors=neighbours, kernel='linear')
|
||||||
result = np.zeros((res * 2, res, 3), np.float32)
|
result = np.zeros((res * 2, res, 3), np.float32)
|
||||||
@@ -386,12 +386,12 @@ def test(verts, faces, values):
|
|||||||
|
|
||||||
|
|
||||||
def get_shapedirs():
|
def get_shapedirs():
|
||||||
to_keep = sio.loadmat(os.path.join('custom_utils/keep_remove.mat'))['keep'].reshape(-1)
|
to_keep = sio.loadmat(os.path.join('smpl/keep_remove.mat'))['keep'].reshape(-1)
|
||||||
shapedirs = []
|
shapedirs = []
|
||||||
with open(os.path.join('custom_utils/super_model_f.pkl'), 'rb') as f:
|
with open(os.path.join('smpl/super_model_f.pkl'), 'rb') as f:
|
||||||
female = pickle.load(f, encoding="latin1")
|
female = pickle.load(f, encoding="latin1")
|
||||||
shapedirs.append(female['shapedirs'][to_keep, :])
|
shapedirs.append(female['shapedirs'][to_keep, :])
|
||||||
with open(os.path.join('custom_utils/super_model_m.pkl'), 'rb') as f:
|
with open(os.path.join('smpl/super_model_m.pkl'), 'rb') as f:
|
||||||
male = pickle.load(f, encoding="latin1")
|
male = pickle.load(f, encoding="latin1")
|
||||||
shapedirs.append(male['shapedirs'][to_keep, :])
|
shapedirs.append(male['shapedirs'][to_keep, :])
|
||||||
return shapedirs
|
return shapedirs
|
||||||
@@ -399,162 +399,139 @@ def get_shapedirs():
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("-f", "--folder", help = "end of range", default='/home/workspace/data/dataset/cloth3d/train')
|
parser.add_argument("-f", "--folder", help = "end of range", default='/data-local/127/cloth3d_processed')
|
||||||
parser.add_argument("-s", "--start", help = "start of range", default=70500)
|
parser.add_argument("-s", "--start", help = "start of range", default=0, type=int)
|
||||||
parser.add_argument("-e", "--end", help = "end of range", default=90000)
|
parser.add_argument("-e", "--end", help = "end of range", default=100, type=int)
|
||||||
parser.add_argument("-n", "--name", help = "end of range", default='lhunor')
|
parser.add_argument("-n", "--name", help = "end of range", default='lhunor')
|
||||||
parser.add_argument("-sk", "--skirt", help = "end of range", default=0)
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
F = np.load("custom_utils/smpl_faces" + ("_skirt" if args.skirt == 1 else "") + ".npy")
|
F = {'non-skirt': np.load("smpl/smpl_faces.npy"), 'skirt': np.load("smpl/smpl_faces_skirt.npy")}
|
||||||
uv_map = np.load('custom_utils/stretched_uv_map_' + ("skirt" if args.skirt == 1 else "3") + '.npy')
|
uv_map = {'non-skirt': np.load('custom_utils/stretched_uv_map_3.npy'), 'skirt': np.load('custom_utils/stretched_uv_map_skirt.npy')}
|
||||||
m2uv = np.load('custom_utils/m2uv' + ("_skirt" if args.skirt == 1 else "") + '.npy', allow_pickle=True).item()
|
m2uv = {'non-skirt': np.load('custom_utils/m2uv.npy', allow_pickle=True).item(), 'skirt': np.load('custom_utils/m2uv_skirt.npy', allow_pickle=True).item()}
|
||||||
m2uv = m2uv_array(m2uv)
|
m2uv = {k: m2uv_array(v) for k, v in m2uv.items()}
|
||||||
uv_mask = np.load('custom_utils/mask_256x512' + ("_skirt" if args.skirt == 1 else "") + '.npy')
|
uv_mask = {'non-skirt': np.load('custom_utils/mask_256x512.npy'), 'skirt': np.load('custom_utils/mask_256x512_skirt.npy')}
|
||||||
curvature_label_type = '6_25 '
|
|
||||||
|
|
||||||
uv_res = 256
|
uv_res = 256
|
||||||
uv_mask = (cv2.resize(uv_mask * 255.0, (uv_res, uv_res * 2)) / 255).astype(bool)[:, :, np.newaxis]
|
uv_map_discreet = dict()
|
||||||
# uv_mask_dilate = cv2.erode(uv_mask.astype(np.float32), cv2.getStructuringElement(cv2.MORPH_CROSS, (2 * 2 + 1, 2 * 2 + 1), (2, 2)), iterations=1).astype(bool)[:, :, np.newaxis]
|
uv_map_discreet_unique = dict()
|
||||||
# uv_mask_border = uv_mask * np.invert(uv_mask_dilate)
|
uv_counter = dict()
|
||||||
uv_mask = cv2.dilate(uv_mask.astype(np.float32), cv2.getStructuringElement(cv2.MORPH_RECT, (2 * 2 + 1, 2 * 2 + 1), (2, 2)), iterations=2).astype(bool)[:, :, np.newaxis]
|
rbf_dest = dict()
|
||||||
|
uv_map_mask = dict()
|
||||||
|
for k,v in uv_mask.items():
|
||||||
|
uv_mask[k] = (cv2.resize(v * 255.0, (uv_res, uv_res * 2)) / 255).astype(bool)[:, :, np.newaxis]
|
||||||
|
# uv_mask_dilate = cv2.erode(uv_mask.astype(np.float32), cv2.getStructuringElement(cv2.MORPH_CROSS, (2 * 2 + 1, 2 * 2 + 1), (2, 2)), iterations=1).astype(bool)[:, :, np.newaxis]
|
||||||
|
# uv_mask_border = uv_mask * np.invert(uv_mask_dilate)
|
||||||
|
uv_mask[k] = cv2.dilate(v.astype(np.float32), cv2.getStructuringElement(cv2.MORPH_RECT, (2 * 2 + 1, 2 * 2 + 1), (2, 2)), iterations=2).astype(bool)[:, :, np.newaxis]
|
||||||
|
|
||||||
uv_map_discreet = np.floor(uv_map * uv_res).astype(np.int32)
|
uv_map_discreet[k] = np.floor(uv_map[k] * uv_res).astype(np.int32)
|
||||||
uv_map_mask = unique_uv_map_mask(uv_map_discreet)
|
uv_map_mask[k] = unique_uv_map_mask(uv_map_discreet[k])
|
||||||
|
|
||||||
uv_counter = np.zeros((uv_map.shape[0]))
|
uv_counter[k] = np.zeros((uv_map[k].shape[0]))
|
||||||
uv_counter[m2uv[:, 0]] = 1
|
uv_counter[k][m2uv[k][:, 0]] = 1
|
||||||
uv_counter[m2uv[:, 1]] += 1
|
uv_counter[k][m2uv[k][:, 1]] += 1
|
||||||
uv_counter = uv_counter[uv_map_mask]
|
uv_counter[k] = uv_counter[k][uv_map_mask[k]]
|
||||||
|
|
||||||
uv_map_discreet_unique = uv_map_discreet[uv_map_mask, :]
|
uv_map_discreet_unique[k] = uv_map_discreet[k][uv_map_mask[k], :]
|
||||||
|
|
||||||
rbf_dest = np.ones((uv_res * 2, uv_res))
|
rbf_dest[k] = np.ones((uv_res * 2, uv_res))
|
||||||
rbf_dest[uv_map_discreet_unique[:, 0], uv_map_discreet_unique[:, 1]] = 0
|
rbf_dest[k][uv_map_discreet_unique[k][:, 0], uv_map_discreet_unique[k][:, 1]] = 0
|
||||||
rbf_dest[np.invert(uv_mask[:,:,0])] = 0
|
rbf_dest[k][np.invert(uv_mask[k][:,:,0])] = 0
|
||||||
|
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
|
|
||||||
use_no_orient = False
|
|
||||||
no_shape = False
|
|
||||||
is_skirt = True if args.skirt == 1 else False
|
|
||||||
folder = args.folder
|
folder = args.folder
|
||||||
neighbourhood = 25
|
data_to_convert = ['mesh_posed', 'mesh_static', 'mesh_normals', 'body_posed', 'mesh_unposed'] # 'mesh_unposed',
|
||||||
frames_file = 'frames_all.txt'
|
|
||||||
data_to_convert = ['mesh_posed', 'mesh_static', 'mesh_curvature', 'body_posed'] # 'mesh_unposed',
|
|
||||||
|
|
||||||
print("skirt" if args.skirt == 1 else "not skirt")
|
ids = sorted(os.listdir(folder + '/mesh_body_posed_no_orient'))[args.start:args.end]
|
||||||
print(f'params: -f {args.folder} -s {args.start} -e {args.end} -n {args.name} -skirt {args.skirt}')
|
ids = [id.split('.')[0].split('_')[0] for id in ids]
|
||||||
|
|
||||||
skirt_modifier = '_skirt' if is_skirt else ''
|
|
||||||
orient_mod = '_no_orient' if use_no_orient else ''
|
|
||||||
shape_mod = '_no_shape' if no_shape else ''
|
|
||||||
|
|
||||||
frames = []
|
|
||||||
with open(os.path.join(folder, frames_file), 'r') as f:
|
|
||||||
lines = f.readlines()
|
|
||||||
lines = [line.strip() for line in lines]
|
|
||||||
frames = lines[int(args.start):int(args.end)]
|
|
||||||
ids = [frame.split()[0] for frame in frames]
|
|
||||||
ids = sorted(list(set(ids)))
|
|
||||||
|
|
||||||
shapedirs = get_shapedirs()
|
shapedirs = get_shapedirs()
|
||||||
|
|
||||||
root = '/'.join(folder.split('/')[:-1])
|
root = '/'.join(folder.split('/')[:-1])
|
||||||
type = folder.split('/')[-1]
|
type = folder.split('/')[-1]
|
||||||
# h5file_curv = tb.open_file(os.path.join(root, f'{type}_extras.h5'), mode='r')
|
|
||||||
# h5file = tb.open_file(os.path.join(root, f'{type}_extras_uv.h5'), mode='a')
|
|
||||||
|
|
||||||
extras_folder = os.path.join(root, f'{type}_extras')
|
os.makedirs(folder, exist_ok=True)
|
||||||
os.makedirs(extras_folder, exist_ok=True)
|
os.makedirs(os.path.join(folder, 'uv_posed_no_orient'), exist_ok=True)
|
||||||
os.makedirs(os.path.join(extras_folder, 'uv_posed' + orient_mod), exist_ok=True)
|
os.makedirs(os.path.join(folder, 'uv_static'), exist_ok=True)
|
||||||
os.makedirs(os.path.join(extras_folder, 'uv_static'), exist_ok=True)
|
os.makedirs(os.path.join(folder, 'uv_normals'), exist_ok=True)
|
||||||
os.makedirs(os.path.join(extras_folder, 'uv_curvature'), exist_ok=True)
|
os.makedirs(os.path.join(folder, 'uv_unposed_no_shape'), exist_ok=True)
|
||||||
os.makedirs(os.path.join(extras_folder, 'uv_unposed'), exist_ok=True)
|
os.makedirs(os.path.join(folder, 'uv_body_posed_no_orient'), exist_ok=True)
|
||||||
os.makedirs(os.path.join(extras_folder, 'uv_body_posed' + orient_mod), exist_ok=True)
|
os.makedirs(os.path.join(folder, 'uv_mask'), exist_ok=True)
|
||||||
os.makedirs(os.path.join(extras_folder, 'uv_mask'), exist_ok=True)
|
|
||||||
|
|
||||||
|
|
||||||
for id in tqdm.tqdm(ids):
|
for id in tqdm.tqdm(ids):
|
||||||
|
garments = glob.glob(os.path.join(folder, 'mesh_mask', f'{id}_*'))
|
||||||
|
garments = [garment.split('/')[-1].split('.')[0].split('_')[-1] for garment in garments]
|
||||||
|
|
||||||
|
# if os.path.exists(os.path.join(folder, 'uv_static', f'{id}_{garment}.npz')):
|
||||||
|
# continue
|
||||||
|
|
||||||
info = loadInfo(os.path.join(folder, id, 'info.mat'))
|
for k, garment in enumerate(garments):
|
||||||
garments = list(info['outfit'].keys())
|
# if not ('Dress' in garments or 'Skirt' in garments):
|
||||||
assert info['poses'].shape[1] <= 300
|
# if k != 1:
|
||||||
|
# files = glob.glob(os.path.join(folder, 'uv_body_posed_no_orient', f'{id}_*_{garment}.npz'))
|
||||||
# put all this in a function and call for all garments
|
# for file in files:
|
||||||
|
# shutil.move(file, '_'.join(file.split('_')[:-1]) + '.npz')
|
||||||
# also masking is not the same as just filling the empty values with neighbouring
|
|
||||||
# values, at least the plots are different
|
|
||||||
|
|
||||||
for garment in garments:
|
|
||||||
# garment = garments[0]
|
|
||||||
|
|
||||||
# if all the uv maps have been generated, skip this id
|
|
||||||
# if all([os.path.exists(os.path.join(extras_folder, 'uv_body_posed' + orient_mod, f'{id}_{i}_{garment}.npz')) for i in range(info['poses'].shape[1])]):
|
|
||||||
# continue
|
# continue
|
||||||
|
|
||||||
mask = read_garment_mask(folder, id, garment)
|
mask = np.load(os.path.join(folder, 'mesh_mask', f'{id}_{garment}.npy'))
|
||||||
|
x = readPC2(os.path.join(folder, 'mesh_posed_no_orient', f'{id}_{garment}.pc16'), True)['V']
|
||||||
if 'mesh_posed' in data_to_convert:
|
mesh_posed = np.zeros((x.shape[0], 14475, 3), dtype=np.float32)
|
||||||
# mesh_posed_frame = read_posed_garment_frame(folder, id, garment, 0, mask=mask, shape=info['shape'], pose=info['poses'][:,0], deorient=use_no_orient, unshape=no_shape)
|
mesh_posed[:,mask, :] = x
|
||||||
mesh_posed = read_posed_garment(folder, id, garment, mask=mask, shape=info['shape'], poses=info['poses'], deorient=use_no_orient, unshape=no_shape)
|
|
||||||
if 'mesh_unposed' in data_to_convert:
|
if 'mesh_unposed' in data_to_convert:
|
||||||
raise NotImplementedError()
|
mesh_unposed = np.zeros((x.shape[0], 14475, 3), dtype=np.float32)
|
||||||
mesh_unposed = read_unposed_garment(folder, id, garment, mask=mask, shape=info['shape'], unshape=no_shape)
|
mesh_unposed[:,mask, :] = readPC2(os.path.join(folder, 'mesh_unposed_no_shape' ,f'{id}_{garment}.pc16'), True)['V']
|
||||||
if 'mesh_static' in data_to_convert:
|
if 'mesh_static' in data_to_convert:
|
||||||
mesh_static = read_garment_template(folder, id, garment, mask)
|
mesh_static = np.zeros((14475, 3), dtype=np.float32)
|
||||||
if 'mesh_curvature' in data_to_convert:
|
mesh_static[mask, :] = np.load(os.path.join(folder, 'mesh_static', f'{id}_{garment}.npy'))
|
||||||
mesh_curvature = read_curvatures(folder + '_extras', id, garment, count=info['poses'].shape[1])
|
if 'mesh_normals' in data_to_convert:
|
||||||
if 'body_posed' in data_to_convert:
|
mesh_normals = np.zeros((x.shape[0], 14475, 3), dtype=np.float32)
|
||||||
body_posed = read_posed_body(folder, id, info['poses'], use_no_orient)
|
mesh_normals[:,mask, :] = readPC2(os.path.join(folder, 'mesh_normals', f'{id}_{garment}.pc16'), True)['V']
|
||||||
|
if 'body_posed' in data_to_convert and k != 1:
|
||||||
|
body_posed = readPC2(os.path.join(folder, 'mesh_body_posed_no_orient', f'{id}.pc16'), True)['V']
|
||||||
|
|
||||||
start = time.perf_counter()
|
start = time.perf_counter()
|
||||||
|
type = 'skirt' if garment == 'Dress' or garment == 'Skirt' else 'non-skirt'
|
||||||
|
|
||||||
uv_static, uv_mask_local, garment_uv_mask_border = convert_to_uv(uv_res, m2uv, uv_map, mesh_static, neighbours=3, mask=mask, method='rbf', garment_uv_mask=None)
|
uv_static, uv_mask_local, garment_uv_mask_border = convert_to_uv(uv_res, m2uv[type], uv_map[type], mesh_static, neighbours=3, mask=mask, method='rbf', garment_uv_mask=None)
|
||||||
uv_static = convert_to_uv_batch(uv_res, m2uv, uv_map, mesh_static[None, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=uv_mask_local, garment_uv_mask_border=garment_uv_mask_border)
|
uv_static = convert_to_uv_batch(uv_res, m2uv[type], uv_map[type], mesh_static[None, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=uv_mask_local, garment_uv_mask_border=garment_uv_mask_border)
|
||||||
uv_static = uv_static.astype(np.float32)
|
uv_static = uv_static[0].astype(np.float32)
|
||||||
|
|
||||||
if 'mesh_posed' in data_to_convert:
|
if 'mesh_posed' in data_to_convert:
|
||||||
uv_posed = convert_to_uv_batch(uv_res, m2uv, uv_map, mesh_posed[:, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=uv_mask_local, garment_uv_mask_border=garment_uv_mask_border)
|
uv_posed = convert_to_uv_batch(uv_res, m2uv[type], uv_map[type], mesh_posed[:, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=uv_mask_local, garment_uv_mask_border=garment_uv_mask_border)
|
||||||
if 'mesh_unposed' in data_to_convert:
|
if 'mesh_unposed' in data_to_convert:
|
||||||
raise NotImplementedError()
|
uv_unposed = convert_to_uv_batch(uv_res, m2uv[type], uv_map[type], mesh_unposed[:, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=uv_mask_local, garment_uv_mask_border=garment_uv_mask_border)
|
||||||
uv_unposed = convert_to_uv_batch(uv_res, m2uv, uv_map, mesh_unposed[:, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=uv_mask_local, garment_uv_mask_border=garment_uv_mask_border)
|
if 'mesh_normals' in data_to_convert:
|
||||||
if 'mesh_curvature' in data_to_convert:
|
uv_normals = convert_to_uv_batch(uv_res, m2uv[type], uv_map[type], mesh_normals[:, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=uv_mask_local, garment_uv_mask_border=garment_uv_mask_border)
|
||||||
uv_curvature = convert_to_uv_batch_label(uv_res, m2uv, uv_map, mesh_curvature[:, :], neighbours=3, mask=mask, method='nearest', garment_uv_mask=uv_mask_local, garment_uv_mask_border=garment_uv_mask_border)
|
if 'body_posed' in data_to_convert and k != 1:
|
||||||
if 'body_posed' in data_to_convert:
|
uv_body_posed = convert_to_uv_batch_body(uv_res, m2uv['non-skirt'], uv_map['non-skirt'], body_posed[:, :, :], neighbours=3, mask=None, method='rbf', garment_uv_mask=None, garment_uv_mask_border=garment_uv_mask_border)
|
||||||
uv_body_posed = convert_to_uv_batch_body(uv_res, m2uv, uv_map, body_posed[:, :, :], neighbours=3, mask=None, method='rbf', garment_uv_mask=None, garment_uv_mask_border=garment_uv_mask_border)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print(time.perf_counter() - start)
|
print(time.perf_counter() - start)
|
||||||
|
|
||||||
# mesh_static
|
# ex.imshow(uv_mask_local).show()
|
||||||
# save_to_h5file(h5file, id, 0, garment, uv_static, 'uv_static', 'float32')
|
# ex.imshow((uv_static+1)/2).show()
|
||||||
# save_to_h5file(h5file, id, 0, garment, uv_mask, 'uv_mask', 'float32')
|
# ex.imshow((uv_posed[0]+1)/2).show()
|
||||||
np.savez_compressed(os.path.join(extras_folder, 'uv_static', f'{id}_{garment}.npz'), uv_static=uv_static)
|
# ex.imshow((uv_unposed[0]+1)/2).show()
|
||||||
np.savez_compressed(os.path.join(extras_folder, 'uv_mask', f'{id}_{garment}.npz'), uv_mask=uv_mask_local)
|
# ex.imshow((uv_normals[0]+1.5)/3).show()
|
||||||
|
# ex.imshow((uv_body_posed[0]+1)/2).show()
|
||||||
|
|
||||||
|
# pass
|
||||||
|
np.savez_compressed(os.path.join(folder, 'uv_static', f'{id}_{garment}.npz'), uv_static=uv_static)
|
||||||
|
np.savez_compressed(os.path.join(folder, 'uv_mask', f'{id}_{garment}.npz'), uv_mask=uv_mask_local)
|
||||||
|
|
||||||
if 'mesh_posed' in data_to_convert:
|
if 'mesh_posed' in data_to_convert:
|
||||||
for i in range(len(uv_posed)):
|
for i in range(len(uv_posed)):
|
||||||
np.savez_compressed(os.path.join(extras_folder, 'uv_posed' + orient_mod, f'{id}_{i}_{garment}.npz'), uv_posed=uv_posed[i])
|
np.savez_compressed(os.path.join(folder, 'uv_posed_no_orient', f'{id}_{i}_{garment}.npz'), uv_posed=uv_posed[i])
|
||||||
# save_to_h5file(h5file, id, i, garment, uv_posed[i, :, :, :], 'uv_posed' + orient_mod + shape_mod, 'float32')
|
|
||||||
if 'mesh_unposed' in data_to_convert:
|
if 'mesh_unposed' in data_to_convert:
|
||||||
raise NotImplementedError()
|
for i in range(len(uv_unposed)):
|
||||||
for i in range(uv_unposed.shape[0]):
|
np.savez_compressed(os.path.join(folder, 'uv_unposed_no_shape', f'{id}_{i}_{garment}.npz'), uv_unposed=uv_unposed[i])
|
||||||
save_to_h5file(h5file, id, i, garment, uv_unposed[i, :, :, :], 'uv_unposed' + orient_mod + shape_mod, 'float32')
|
if 'mesh_normals' in data_to_convert:
|
||||||
if 'mesh_curvature' in data_to_convert:
|
for i in range(len(uv_normals)):
|
||||||
for i in range(len(uv_curvature)):
|
np.savez_compressed(os.path.join(folder, 'uv_normals', f'{id}_{i}_{garment}.npz'), uv_normals=uv_normals[i])
|
||||||
np.savez_compressed(os.path.join(extras_folder, 'uv_curvature', f'{id}_{i}_{garment}.npz'), uv_curvature=uv_curvature[i].astype(np.uint8))
|
if 'body_posed' in data_to_convert and k != 1:
|
||||||
# save_to_h5file(h5file, id, i, garment, uv_curvature[i, :, :, :], 'uv_curvature', 'uint8')
|
|
||||||
if 'body_posed' in data_to_convert:
|
|
||||||
for i in range(len(uv_body_posed)):
|
for i in range(len(uv_body_posed)):
|
||||||
np.savez_compressed(os.path.join(extras_folder, 'uv_body_posed' + orient_mod, f'{id}_{i}_{garment}.npz'), uv_body_posed=uv_body_posed[i])
|
np.savez_compressed(os.path.join(folder, 'uv_body_posed_no_orient', f'{id}_{i}.npz'), uv_body_posed=uv_body_posed[i])
|
||||||
# save_to_h5file(h5file, id, i, garment, uv_body_posed[i, :, :, :], 'uv_body_posed', 'float32')
|
|
||||||
|
|
||||||
pass
|
# pass
|
||||||
|
|
||||||
|
|
||||||
h5file_curv.close()
|
|
||||||
|
|||||||
@@ -0,0 +1,530 @@
|
|||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import glob
|
||||||
|
import tqdm
|
||||||
|
import math
|
||||||
|
import time
|
||||||
|
import random
|
||||||
|
import shutil
|
||||||
|
import collections
|
||||||
|
import argparse
|
||||||
|
import pickle
|
||||||
|
import numpy as np
|
||||||
|
import scipy as sp
|
||||||
|
import trimesh as tm
|
||||||
|
# import cmapy as cm
|
||||||
|
import tables as tb
|
||||||
|
import scipy.io as sio
|
||||||
|
import scipy.interpolate as spi
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
import scipy.stats as stat
|
||||||
|
import cv2
|
||||||
|
import plotly.express as ex
|
||||||
|
import plotly.graph_objects as go
|
||||||
|
|
||||||
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
|
||||||
|
from data.cloth3d_io import read_garment_mask, read_garment_template, read_posed_garment_frame, loadInfo, read_posed_body_frame, read_posed_body, read_posed_garment, read_curvatures
|
||||||
|
from data.cloth3d_io import readPC2
|
||||||
|
|
||||||
|
|
||||||
|
os.environ["CUDA_VISIBLE_DEVICES"] = "6"
|
||||||
|
|
||||||
|
def convert_to_uv(res, m2uv, uv_map, verts, neighbours=10, mask=None, method='rbf', garment_uv_mask=None):
|
||||||
|
verts_uv = np.zeros((res * 2, res, 3))
|
||||||
|
uv_values = np.zeros((uv_map.shape[0], 3))
|
||||||
|
uv_values[m2uv[:, 0]] = verts
|
||||||
|
uv_values[m2uv[:, 1]] += verts
|
||||||
|
uv_values = uv_values[uv_map_mask[type], :] # add garment mask
|
||||||
|
uv_values /= uv_counter[type][:, np.newaxis]
|
||||||
|
return_garment_uv_mask = False
|
||||||
|
|
||||||
|
if mask is not None:
|
||||||
|
garment_mask = np.zeros((uv_map.shape[0]), dtype=bool)
|
||||||
|
garment_mask[m2uv[:, 0]] = mask
|
||||||
|
garment_mask[m2uv[:, 1]] += mask
|
||||||
|
garment_mask = garment_mask[uv_map_mask[type]] # add garment mask
|
||||||
|
else:
|
||||||
|
garment_mask = np.sum(uv_values, axis=-1) != 0
|
||||||
|
|
||||||
|
# test
|
||||||
|
verts_uv[uv_map_discreet_unique[type][:, 0], uv_map_discreet_unique[type][:, 1], :] = uv_values
|
||||||
|
# verts_uv_save = verts_uv.copy()
|
||||||
|
|
||||||
|
# garment_mask = np.sum(uv_values, axis=-1) != 0
|
||||||
|
unique_uv_values = uv_values[garment_mask, :]
|
||||||
|
uv_map_discreet_unique_unique = uv_map_discreet_unique[type][garment_mask, :]
|
||||||
|
rbf_dest_current = rbf_dest[type]
|
||||||
|
|
||||||
|
if garment_uv_mask is None and mask is not None:
|
||||||
|
garment_uv_mask = np.zeros((res * 2, res))
|
||||||
|
garment_uv_mask[uv_map_discreet_unique_unique[:, 0], uv_map_discreet_unique_unique[:, 1]] = 255
|
||||||
|
garment_uv_mask = cv2.morphologyEx(garment_uv_mask, cv2.MORPH_CLOSE, cv2.getStructuringElement(cv2.MORPH_RECT, (4 * 2 + 1, 4 * 2 + 1), (4, 4)), iterations=4)
|
||||||
|
garment_uv_mask_border = garment_uv_mask.astype(bool)
|
||||||
|
garment_uv_mask = cv2.dilate(garment_uv_mask, cv2.getStructuringElement(cv2.MORPH_RECT, (2 * 2 + 1, 2 * 2 + 1), (2, 2)), iterations=2).astype(bool)
|
||||||
|
garment_uv_mask_border = ~garment_uv_mask_border & garment_uv_mask
|
||||||
|
garment_uv_mask = garment_uv_mask * uv_mask[type][:,:,0]
|
||||||
|
rbf_dest_current = rbf_dest[type] * garment_uv_mask
|
||||||
|
return_garment_uv_mask = True
|
||||||
|
|
||||||
|
|
||||||
|
rbf_dest_current = np.nonzero(rbf_dest_current)
|
||||||
|
rbf_dest_current = np.array(rbf_dest_current).T
|
||||||
|
|
||||||
|
# uv_verts_uniq = np.array(np.nonzero(np.sum(verts_uv, axis=-1))).T
|
||||||
|
if method == 'rbf':
|
||||||
|
interpolator = spi.RBFInterpolator(y=uv_map_discreet_unique_unique, d=unique_uv_values, neighbors=neighbours, kernel='linear')
|
||||||
|
elif method == 'nearest':
|
||||||
|
interpolator = spi.NearestNDInterpolator(x=uv_map_discreet_unique_unique, y=unique_uv_values)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
final = interpolator(rbf_dest_current)
|
||||||
|
|
||||||
|
result = np.zeros((res * 2, res, 3))
|
||||||
|
|
||||||
|
# not sure, shouldn't be needed
|
||||||
|
# rbf_dest[:, [0,1]] = rbf_dest[:, [1, 0]]
|
||||||
|
|
||||||
|
result[rbf_dest_current[:, 0], rbf_dest_current[:, 1], :] = final
|
||||||
|
result[uv_map_discreet_unique[type][:, 0], uv_map_discreet_unique[type][:, 1], :] = uv_values
|
||||||
|
if garment_uv_mask is not None:
|
||||||
|
result = result * garment_uv_mask[:,:,np.newaxis]
|
||||||
|
|
||||||
|
if return_garment_uv_mask:
|
||||||
|
return result, garment_uv_mask, garment_uv_mask_border
|
||||||
|
else:
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def convert_to_uv_batch_body(res, m2uv, uv_map, verts, neighbours=15, mask=None, method='rbf', garment_uv_mask=None, garment_uv_mask_border=None):
|
||||||
|
batch = verts.shape[0]
|
||||||
|
verts_uv = np.zeros((batch, res * 2, res, 3))
|
||||||
|
uv_values = np.zeros((batch, uv_map.shape[0], 3))
|
||||||
|
uv_values[:, m2uv[:, 0]] = verts
|
||||||
|
uv_values[:, m2uv[:, 1]] += verts
|
||||||
|
uv_values = uv_values[:, uv_map_mask['non-skirt'], :]
|
||||||
|
uv_values /= uv_counter['non-skirt'][np.newaxis, :, np.newaxis]
|
||||||
|
return_garment_uv_mask = False
|
||||||
|
# test
|
||||||
|
verts_uv[:, uv_map_discreet_unique['non-skirt'][:, 0], uv_map_discreet_unique['non-skirt'][:, 1], :] = uv_values
|
||||||
|
|
||||||
|
if mask is not None:
|
||||||
|
garment_mask = np.zeros((uv_map.shape[0]), dtype=bool)
|
||||||
|
garment_mask[m2uv[:, 0]] = mask
|
||||||
|
garment_mask[m2uv[:, 1]] += mask
|
||||||
|
garment_mask = garment_mask[uv_map_mask['non-skirt']] # add garment mask
|
||||||
|
else:
|
||||||
|
garment_mask = np.sum(uv_values[0,:,:], axis=-1) != 0
|
||||||
|
|
||||||
|
unique_uv_values = uv_values[:, garment_mask, :]
|
||||||
|
uv_map_discreet_unique_unique = uv_map_discreet_unique['non-skirt'][garment_mask, :]
|
||||||
|
rbf_dest_current = rbf_dest['non-skirt']
|
||||||
|
|
||||||
|
# add back mesh vertices that are not part of the garment
|
||||||
|
uv_map_discreet_unique_unique_inv = uv_map_discreet_unique['non-skirt'][np.invert(garment_mask), :]
|
||||||
|
rbf_dest_fill = np.zeros((res * 2, res), dtype=bool)
|
||||||
|
rbf_dest_fill[uv_map_discreet_unique_unique_inv[:, 0], uv_map_discreet_unique_unique_inv[:, 1]] = True
|
||||||
|
|
||||||
|
if garment_uv_mask is None and mask is not None:
|
||||||
|
garment_uv_mask = np.zeros((res * 2, res))
|
||||||
|
garment_uv_mask[uv_map_discreet_unique_unique[:, 0], uv_map_discreet_unique_unique[:, 1]] = 255
|
||||||
|
garment_uv_mask = cv2.morphologyEx(garment_uv_mask, cv2.MORPH_CLOSE, cv2.getStructuringElement(cv2.MORPH_RECT, (2 * 2 + 1, 2 * 2 + 1), (2, 2)), iterations=4)
|
||||||
|
garment_uv_mask = cv2.dilate(garment_uv_mask, cv2.getStructuringElement(cv2.MORPH_RECT, (2 * 2 + 1, 2 * 2 + 1), (2, 2)), iterations=2).astype(bool)
|
||||||
|
return_garment_uv_mask = True
|
||||||
|
|
||||||
|
if garment_uv_mask is not None:
|
||||||
|
rbf_dest_current = (rbf_dest['non-skirt'] + rbf_dest_fill) * garment_uv_mask + garment_uv_mask_border
|
||||||
|
|
||||||
|
rbf_dest_current = np.nonzero(rbf_dest_current)
|
||||||
|
rbf_dest_current = np.array(rbf_dest_current).T
|
||||||
|
|
||||||
|
final = []
|
||||||
|
for i in range(batch):
|
||||||
|
print('processing frame: ' + str(i))
|
||||||
|
if method == 'rbf':
|
||||||
|
interpolator = spi.RBFInterpolator(y=uv_map_discreet_unique_unique, d=unique_uv_values[i,:,:], neighbors=neighbours, kernel='linear')
|
||||||
|
elif method == 'nearest':
|
||||||
|
interpolator = spi.NearestNDInterpolator(x=uv_map_discreet_unique_unique, y=unique_uv_values[i,:,:])
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
result = np.zeros((res * 2, res, 3), np.float32)
|
||||||
|
result[rbf_dest_current[:, 0], rbf_dest_current[:, 1], :] = interpolator(rbf_dest_current)
|
||||||
|
result[uv_map_discreet_unique_unique[:, 0], uv_map_discreet_unique_unique[:, 1], :] = unique_uv_values[i,:,:]
|
||||||
|
|
||||||
|
if garment_uv_mask is not None:
|
||||||
|
result *= garment_uv_mask[:,:,np.newaxis]
|
||||||
|
|
||||||
|
final.append(result)
|
||||||
|
|
||||||
|
if return_garment_uv_mask:
|
||||||
|
return final, garment_uv_mask
|
||||||
|
else:
|
||||||
|
return final
|
||||||
|
|
||||||
|
|
||||||
|
def convert_to_uv_batch(res, m2uv, uv_map, verts, neighbours=15, mask=None, method='rbf', garment_uv_mask=None, garment_uv_mask_border=None, id=None):
|
||||||
|
batch = len(verts)
|
||||||
|
|
||||||
|
assert method == 'rbf'
|
||||||
|
|
||||||
|
assert mask is not None
|
||||||
|
garment_mask = np.zeros((uv_map.shape[0]), dtype=bool)
|
||||||
|
garment_mask[m2uv[:, 0]] = mask
|
||||||
|
garment_mask[m2uv[:, 1]] += mask
|
||||||
|
garment_mask = garment_mask[uv_map_mask[type]] # add garment mask
|
||||||
|
|
||||||
|
rbf_dest_current = rbf_dest[type]
|
||||||
|
|
||||||
|
# add back mesh vertices that are not part of the garment
|
||||||
|
uv_map_discreet_unique_unique_inv = uv_map_discreet_unique[type][np.invert(garment_mask), :]
|
||||||
|
rbf_dest_fill = np.zeros((res * 2, res), dtype=bool)
|
||||||
|
rbf_dest_fill[uv_map_discreet_unique_unique_inv[:, 0], uv_map_discreet_unique_unique_inv[:, 1]] = True
|
||||||
|
|
||||||
|
assert not (garment_uv_mask is None and mask is not None)
|
||||||
|
assert garment_uv_mask is not None
|
||||||
|
rbf_dest_current = (rbf_dest[type] + rbf_dest_fill) * garment_uv_mask + garment_uv_mask_border
|
||||||
|
|
||||||
|
rbf_dest_current = np.nonzero(rbf_dest_current)
|
||||||
|
rbf_dest_current = np.array(rbf_dest_current).T
|
||||||
|
|
||||||
|
out = []
|
||||||
|
|
||||||
|
for i in range(batch):
|
||||||
|
print('processing frame: ' + str(i))
|
||||||
|
|
||||||
|
uv_values = np.zeros((uv_map.shape[0], 3))
|
||||||
|
uv_values[m2uv[:, 0]] = verts[i]
|
||||||
|
uv_values[m2uv[:, 1]] += verts[i]
|
||||||
|
uv_values = uv_values[uv_map_mask[type], :]
|
||||||
|
uv_values /= uv_counter[type][:, np.newaxis]
|
||||||
|
|
||||||
|
unique_uv_values = uv_values[garment_mask, :]
|
||||||
|
uv_map_discreet_unique_unique = uv_map_discreet_unique[type][garment_mask, :]
|
||||||
|
|
||||||
|
interpolator = spi.RBFInterpolator(y=uv_map_discreet_unique_unique, d=unique_uv_values[:,:], neighbors=neighbours, kernel='linear')
|
||||||
|
result = np.zeros((res * 2, res, 3), np.float32)
|
||||||
|
result[rbf_dest_current[:, 0], rbf_dest_current[:, 1], :] = interpolator(rbf_dest_current)
|
||||||
|
result[uv_map_discreet_unique_unique[:, 0], uv_map_discreet_unique_unique[:, 1], :] = unique_uv_values[:,:]
|
||||||
|
|
||||||
|
if garment_uv_mask is not None:
|
||||||
|
result *= garment_uv_mask[:,:,np.newaxis]
|
||||||
|
|
||||||
|
out.append(result)
|
||||||
|
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def convert_to_uv_batch_label(res, m2uv, uv_map, values, neighbours=15, mask=None, method='rbf', garment_uv_mask=None, garment_uv_mask_border=None):
|
||||||
|
batch = values.shape[0]
|
||||||
|
values = (values + 1) * mask
|
||||||
|
values_uv = np.zeros((batch, res * 2, res))
|
||||||
|
missing = np.zeros((res * 2, res))
|
||||||
|
uv_values = np.zeros((batch, uv_map.shape[0]))
|
||||||
|
uv_values[:, m2uv[:, 0]] = values
|
||||||
|
uv_values[:, m2uv[:, 1]] = values
|
||||||
|
uv_values = uv_values[:, uv_map_mask]
|
||||||
|
return_garment_uv_mask = False
|
||||||
|
|
||||||
|
if mask is not None:
|
||||||
|
garment_mask = np.zeros((uv_map.shape[0]), dtype=bool)
|
||||||
|
garment_mask[m2uv[:, 0]] = mask
|
||||||
|
garment_mask[m2uv[:, 1]] += mask
|
||||||
|
garment_mask = garment_mask[uv_map_mask] # add garment mask
|
||||||
|
else:
|
||||||
|
raise Exception
|
||||||
|
|
||||||
|
|
||||||
|
# test
|
||||||
|
values_uv[:, uv_map_discreet_unique[:, 0], uv_map_discreet_unique[:, 1]] = uv_values
|
||||||
|
missing[uv_map_discreet_unique[:, 0], uv_map_discreet_unique[:, 1]] = (uv_values[0,:] == 0)
|
||||||
|
|
||||||
|
unique_uv_values = uv_values[:, garment_mask]
|
||||||
|
uv_map_discreet_unique_unique = uv_map_discreet_unique[garment_mask, :]
|
||||||
|
# rbf_dest_current = rbf_dest.astype(bool) + garment_uv_mask_border * uv_mask[:,:,0]
|
||||||
|
|
||||||
|
if garment_uv_mask is None and mask is not None:
|
||||||
|
garment_uv_mask = np.zeros((res * 2, res))
|
||||||
|
garment_uv_mask[uv_map_discreet_unique_unique[:, 0], uv_map_discreet_unique_unique[:, 1]] = 255
|
||||||
|
garment_uv_mask = cv2.morphologyEx(garment_uv_mask, cv2.MORPH_CLOSE, cv2.getStructuringElement(cv2.MORPH_RECT, (2 * 2 + 1, 2 * 2 + 1), (2, 2)), iterations=4)
|
||||||
|
garment_uv_mask = cv2.dilate(garment_uv_mask, cv2.getStructuringElement(cv2.MORPH_RECT, (2 * 2 + 1, 2 * 2 + 1), (2, 2)), iterations=2).astype(bool)
|
||||||
|
return_garment_uv_mask = True
|
||||||
|
|
||||||
|
rbf_dest_current = rbf_dest * garment_uv_mask + missing * garment_uv_mask
|
||||||
|
rbf_dest_current = np.nonzero(rbf_dest_current)
|
||||||
|
rbf_dest_current = np.array(rbf_dest_current).T
|
||||||
|
|
||||||
|
# uv_verts_uniq = np.array(np.nonzero(np.sum(verts_uv, axis=-1))).T
|
||||||
|
final = []
|
||||||
|
for i in range(batch):
|
||||||
|
print('processing frame: ' + str(i))
|
||||||
|
interpolator = spi.NearestNDInterpolator(x=uv_map_discreet_unique_unique, y=unique_uv_values[i,:])
|
||||||
|
final.append(interpolator(rbf_dest_current))
|
||||||
|
final = np.asarray(final)
|
||||||
|
|
||||||
|
result = np.zeros((batch, res * 2, res))
|
||||||
|
result[:, uv_map_discreet_unique[:, 0], uv_map_discreet_unique[:, 1]] = uv_values
|
||||||
|
result[:, rbf_dest_current[:, 0], rbf_dest_current[:, 1]] = final
|
||||||
|
if garment_uv_mask is not None:
|
||||||
|
result = result * garment_uv_mask[np.newaxis,:,:]
|
||||||
|
|
||||||
|
if return_garment_uv_mask:
|
||||||
|
return result, garment_uv_mask
|
||||||
|
else:
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def m2uv_array(m2uv):
|
||||||
|
if m2uv is None:
|
||||||
|
return None
|
||||||
|
result = np.zeros((3638, 2), dtype=np.int32)
|
||||||
|
for k, v in m2uv.items():
|
||||||
|
if len(v) == 2:
|
||||||
|
result[k] = list(v)
|
||||||
|
elif len(v) == 1:
|
||||||
|
x = v.pop()
|
||||||
|
result[k] = [x, x]
|
||||||
|
else:
|
||||||
|
assert False
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def uv_to_mesh(uv, m2uv):
|
||||||
|
res = uv.shape[0]
|
||||||
|
mesh = np.zeros((14475, 3))
|
||||||
|
uv_pixels = uv_map_discreet[m2uv]
|
||||||
|
# counter = np.ones((14475))
|
||||||
|
# counter[m2uv[:, 0] == m2uv[:, 1]] = 2
|
||||||
|
mesh = np.mean(uv[uv_pixels[:, :, 0], uv_pixels[:, :, 1], :], axis=1) # / counter[:, np.newaxis]
|
||||||
|
return mesh
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def verify_reconstruction(orig, reconstructed):
|
||||||
|
error = np.sqrt(np.sum((orig - reconstructed) ** 2, axis=-1))
|
||||||
|
colors = np.array([cm.color('jet', 1 - i) for i in error])
|
||||||
|
error_sum = np.sum(error)
|
||||||
|
|
||||||
|
|
||||||
|
verts_uv = np.zeros((uv_res * 2, uv_res, 3))
|
||||||
|
uv_values = np.zeros((uv_map.shape[0], 3))
|
||||||
|
uv_values[m2uv[:, 0]] = colors
|
||||||
|
uv_values[m2uv[:, 1]] += colors
|
||||||
|
uv_counter = np.zeros((uv_map.shape[0]))
|
||||||
|
uv_counter[m2uv[:, 0]] = 1
|
||||||
|
uv_counter[m2uv[:, 1]] += 1
|
||||||
|
uv_values /= uv_counter[:, np.newaxis]
|
||||||
|
verts_uv[uv_map_discreet[:, 0], uv_map_discreet[:, 1], :] = uv_values
|
||||||
|
fig = plt.figure(figsize=(15, 15))
|
||||||
|
ax = fig.add_subplot(111)
|
||||||
|
ax.scatter(uv_map[:, 0], uv_map[:, 1], s=5, c=uv_values/255)
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
fig = plt.figure(figsize=(15, 15))
|
||||||
|
ax = fig.add_subplot(121, projection='3d')
|
||||||
|
x = orig
|
||||||
|
ax.set_xlim3d(-1, 1)
|
||||||
|
ax.set_ylim3d(-1, 1)
|
||||||
|
ax.set_zlim3d(-1, 1)
|
||||||
|
ax.set_xlabel("X")
|
||||||
|
ax.set_ylabel("Y")
|
||||||
|
ax.set_zlabel("Z")
|
||||||
|
ax.scatter(x[:, 0], x[:, 1], x[:, 2], s=5)
|
||||||
|
|
||||||
|
ax = fig.add_subplot(122, projection='3d')
|
||||||
|
x = reconstructed#[error > 0.1, :]
|
||||||
|
ax.set_xlim3d(-1, 1)
|
||||||
|
ax.set_ylim3d(-1, 1)
|
||||||
|
ax.set_zlim3d(-1, 1)
|
||||||
|
ax.set_xlabel("X")
|
||||||
|
ax.set_ylabel("Y")
|
||||||
|
ax.set_zlabel("Z")
|
||||||
|
ax.scatter(x[:, 0], x[:, 1], x[:, 2], s=5, c=colors/255) #[error > 0.1, :]
|
||||||
|
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
# https://stackoverflow.com/questions/38187286/find-unique-pairs-in-list-of-pairs
|
||||||
|
def unique_pairs(a):
|
||||||
|
a.sort(axis=1)
|
||||||
|
b = np.ascontiguousarray(a).view(
|
||||||
|
np.dtype((np.void, a.dtype.itemsize * a.shape[1]))
|
||||||
|
)
|
||||||
|
_, inv, ct = np.unique(b, return_inverse=True, return_counts=True)
|
||||||
|
return ct[inv] == 1
|
||||||
|
|
||||||
|
|
||||||
|
def unique_uv_map_mask(uv_map_discreet):
|
||||||
|
mask = np.zeros((uv_map_discreet.shape[0]), dtype=bool)
|
||||||
|
temp = np.zeros((uv_res * 2, uv_res))
|
||||||
|
for p in uv_map_discreet:
|
||||||
|
temp[p[0], p[1]] += 1
|
||||||
|
# temp = temp == 1
|
||||||
|
for i, p in enumerate(uv_map_discreet):
|
||||||
|
if temp[p[0], p[1]] == 1:
|
||||||
|
mask[i] = True
|
||||||
|
elif temp[p[0], p[1]] == 2:
|
||||||
|
mask[i] = True
|
||||||
|
temp[p[0], p[1]] = 0
|
||||||
|
return mask
|
||||||
|
|
||||||
|
|
||||||
|
def test(verts, faces, values):
|
||||||
|
uv_values = np.zeros((uv_map.shape[0], 3))
|
||||||
|
uv_values[m2uv[:, 0]] = values
|
||||||
|
uv_values[m2uv[:, 1]] += values
|
||||||
|
uv_counter = np.zeros((uv_map.shape[0]))
|
||||||
|
uv_counter[m2uv[:, 0]] = 1
|
||||||
|
uv_counter[m2uv[:, 1]] += 1
|
||||||
|
uv_values /= uv_counter[:, np.newaxis]
|
||||||
|
x = uv_values
|
||||||
|
verts = np.concatenate((verts, np.zeros((15068, 1))), axis=-1)
|
||||||
|
im = ((x - x.min()) / (x.max() - x.min())) * 255
|
||||||
|
tm.Trimesh(verts, faces, vertex_colors=im.astype(np.int32)).show()
|
||||||
|
|
||||||
|
|
||||||
|
def get_shapedirs():
|
||||||
|
to_keep = sio.loadmat(os.path.join('smpl/keep_remove.mat'))['keep'].reshape(-1)
|
||||||
|
shapedirs = []
|
||||||
|
with open(os.path.join('smpl/super_model_f.pkl'), 'rb') as f:
|
||||||
|
female = pickle.load(f, encoding="latin1")
|
||||||
|
shapedirs.append(female['shapedirs'][to_keep, :])
|
||||||
|
with open(os.path.join('smpl/super_model_m.pkl'), 'rb') as f:
|
||||||
|
male = pickle.load(f, encoding="latin1")
|
||||||
|
shapedirs.append(male['shapedirs'][to_keep, :])
|
||||||
|
return shapedirs
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("-f", "--folder", help = "end of range", default='/data-local/127_2/cape_processed/test/female')
|
||||||
|
parser.add_argument("-s", "--start", help = "start of range", default=0, type=int)
|
||||||
|
parser.add_argument("-e", "--end", help = "end of range", default=100, type=int)
|
||||||
|
parser.add_argument("-n", "--name", help = "end of range", default='lhunor')
|
||||||
|
parser.add_argument("-d", "--debug", help = "end of range", default=False, action='store_true')
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
F = {'non-skirt': np.load("smpl/smpl_faces_orig.npy"), 'skirt': None}
|
||||||
|
uv_map = {'non-skirt': np.load('custom_utils/stretched_uv_map_3_orig.npy'), 'skirt': None}
|
||||||
|
m2uv = {'non-skirt': np.load('custom_utils/m2uv_orig.npy', allow_pickle=True).item(), 'skirt': None}
|
||||||
|
m2uv = {k: m2uv_array(v) for k, v in m2uv.items()}
|
||||||
|
uv_mask = {'non-skirt': np.load('custom_utils/mask_256x512.npy'), 'skirt': np.load('custom_utils/mask_256x512_skirt.npy')}
|
||||||
|
|
||||||
|
|
||||||
|
uv_res = 256
|
||||||
|
uv_map_discreet = dict()
|
||||||
|
uv_map_discreet_unique = dict()
|
||||||
|
uv_counter = dict()
|
||||||
|
rbf_dest = dict()
|
||||||
|
uv_map_mask = dict()
|
||||||
|
for k,v in uv_mask.items():
|
||||||
|
if k == 'skirt':
|
||||||
|
continue
|
||||||
|
uv_mask[k] = (cv2.resize(v * 255.0, (uv_res, uv_res * 2)) / 255).astype(bool)[:, :, np.newaxis]
|
||||||
|
# uv_mask_dilate = cv2.erode(uv_mask.astype(np.float32), cv2.getStructuringElement(cv2.MORPH_CROSS, (2 * 2 + 1, 2 * 2 + 1), (2, 2)), iterations=1).astype(bool)[:, :, np.newaxis]
|
||||||
|
# uv_mask_border = uv_mask * np.invert(uv_mask_dilate)
|
||||||
|
uv_mask[k] = cv2.dilate(v.astype(np.float32), cv2.getStructuringElement(cv2.MORPH_RECT, (2 * 2 + 1, 2 * 2 + 1), (2, 2)), iterations=2).astype(bool)[:, :, np.newaxis]
|
||||||
|
|
||||||
|
uv_map_discreet[k] = np.floor(uv_map[k] * uv_res).astype(np.int32)
|
||||||
|
uv_map_mask[k] = unique_uv_map_mask(uv_map_discreet[k])
|
||||||
|
|
||||||
|
uv_counter[k] = np.zeros((uv_map[k].shape[0]))
|
||||||
|
uv_counter[k][m2uv[k][:, 0]] = 1
|
||||||
|
uv_counter[k][m2uv[k][:, 1]] += 1
|
||||||
|
uv_counter[k] = uv_counter[k][uv_map_mask[k]]
|
||||||
|
|
||||||
|
uv_map_discreet_unique[k] = uv_map_discreet[k][uv_map_mask[k], :]
|
||||||
|
|
||||||
|
rbf_dest[k] = np.ones((uv_res * 2, uv_res))
|
||||||
|
rbf_dest[k][uv_map_discreet_unique[k][:, 0], uv_map_discreet_unique[k][:, 1]] = 0
|
||||||
|
rbf_dest[k][np.invert(uv_mask[k][:,:,0])] = 0
|
||||||
|
|
||||||
|
|
||||||
|
#########################################################################################
|
||||||
|
|
||||||
|
folder = args.folder
|
||||||
|
# data_to_convert = ['mesh_posed', 'mesh_static', 'mesh_normals', 'body_posed', 'mesh_unposed'] # 'mesh_unposed',
|
||||||
|
data_to_convert = ['mesh_static', 'mesh_normals'] # 'mesh_unposed',
|
||||||
|
|
||||||
|
frames = sorted(os.listdir(folder + '/mesh_posed_body_no_orient'))#[args.start:args.end]
|
||||||
|
frames = [[frame.split('.')[0], frame.split('.')[1]] for frame in frames]
|
||||||
|
ids = list(set([frame[0] for frame in frames]))
|
||||||
|
frames_by_id = {id: [frame[1] for frame in frames if frame[0] == id] for id in ids}
|
||||||
|
|
||||||
|
shapedirs = get_shapedirs()
|
||||||
|
|
||||||
|
root = '/'.join(folder.split('/')[:-1])
|
||||||
|
type = 'non-skirt'
|
||||||
|
|
||||||
|
os.makedirs(folder, exist_ok=True)
|
||||||
|
os.makedirs(os.path.join(folder, 'uv_posed_no_orient'), exist_ok=True)
|
||||||
|
os.makedirs(os.path.join(folder, 'uv_static'), exist_ok=True)
|
||||||
|
os.makedirs(os.path.join(folder, 'uv_normals'), exist_ok=True)
|
||||||
|
os.makedirs(os.path.join(folder, 'uv_unposed_no_shape'), exist_ok=True)
|
||||||
|
os.makedirs(os.path.join(folder, 'uv_body_posed_no_orient'), exist_ok=True)
|
||||||
|
os.makedirs(os.path.join(folder, 'uv_mask'), exist_ok=True)
|
||||||
|
|
||||||
|
mask = np.ones((3638), dtype=bool)
|
||||||
|
|
||||||
|
for id in tqdm.tqdm(ids):
|
||||||
|
|
||||||
|
|
||||||
|
# x = readPC2(os.path.join(folder, 'mesh_posed_no_orient', f'{id}_{garment}.pc16'), True)['V']
|
||||||
|
# mesh_posed = np.zeros((x.shape[0], 14475, 3), dtype=np.float32)
|
||||||
|
# mesh_posed[:,mask, :] = x
|
||||||
|
if 'mesh_unposed' in data_to_convert:
|
||||||
|
mesh_unposed = np.zeros((x.shape[0], 14475, 3), dtype=np.float32)
|
||||||
|
mesh_unposed[:,mask, :] = readPC2(os.path.join(folder, 'mesh_unposed_no_shape' ,f'{id}_{garment}.pc16'), True)['V']
|
||||||
|
if 'mesh_static' in data_to_convert:
|
||||||
|
mesh_static = np.load(os.path.join(folder, 'mesh_static', f'{id}.npz'))['mesh_static']
|
||||||
|
if 'mesh_normals' in data_to_convert:
|
||||||
|
mesh_normals = np.stack([np.load(os.path.join(folder, 'mesh_normals', f'{id}.{int(i):06d}.npz'))['mesh_normals'] for i in frames_by_id[id]], axis=0)
|
||||||
|
if 'body_posed' in data_to_convert and k != 1:
|
||||||
|
body_posed = readPC2(os.path.join(folder, 'mesh_body_posed_no_orient', f'{id}.pc16'), True)['V']
|
||||||
|
|
||||||
|
start = time.perf_counter()
|
||||||
|
|
||||||
|
uv_static, uv_mask_local, garment_uv_mask_border = convert_to_uv(uv_res, m2uv[type], uv_map[type], mesh_static, neighbours=3, mask=mask, method='rbf', garment_uv_mask=None)
|
||||||
|
uv_static = convert_to_uv_batch(uv_res, m2uv[type], uv_map[type], mesh_static[None, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=uv_mask_local, garment_uv_mask_border=garment_uv_mask_border)
|
||||||
|
uv_static = uv_static[0].astype(np.float32)
|
||||||
|
|
||||||
|
if 'mesh_posed' in data_to_convert:
|
||||||
|
uv_posed = convert_to_uv_batch(uv_res, m2uv[type], uv_map[type], mesh_posed[:, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=uv_mask_local, garment_uv_mask_border=garment_uv_mask_border)
|
||||||
|
if 'mesh_unposed' in data_to_convert:
|
||||||
|
uv_unposed = convert_to_uv_batch(uv_res, m2uv[type], uv_map[type], mesh_unposed[:, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=uv_mask_local, garment_uv_mask_border=garment_uv_mask_border)
|
||||||
|
if 'mesh_normals' in data_to_convert:
|
||||||
|
uv_normals = convert_to_uv_batch(uv_res, m2uv[type], uv_map[type], mesh_normals[:, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=uv_mask_local, garment_uv_mask_border=garment_uv_mask_border)
|
||||||
|
if 'body_posed' in data_to_convert and k != 1:
|
||||||
|
uv_body_posed = convert_to_uv_batch_body(uv_res, m2uv['non-skirt'], uv_map['non-skirt'], body_posed[:, :, :], neighbours=3, mask=None, method='rbf', garment_uv_mask=None, garment_uv_mask_border=garment_uv_mask_border)
|
||||||
|
|
||||||
|
print(time.perf_counter() - start)
|
||||||
|
|
||||||
|
# ex.imshow(uv_mask_local).show()
|
||||||
|
# ex.imshow((uv_static+1)/2).show()
|
||||||
|
# ex.imshow((uv_posed[0]+1)/2).show()
|
||||||
|
# ex.imshow((uv_unposed[0]+1)/2).show()
|
||||||
|
# ex.imshow((uv_normals[0]+1.5)/3).show()
|
||||||
|
# ex.imshow((uv_body_posed[0]+1)/2).show()
|
||||||
|
|
||||||
|
# pass
|
||||||
|
# np.savez_compressed(os.path.join(folder, 'uv_static', f'{id}_{garment}.npz'), uv_static=uv_static)
|
||||||
|
# np.savez_compressed(os.path.join(folder, 'uv_mask', f'{id}_{garment}.npz'), uv_mask=uv_mask_local)
|
||||||
|
|
||||||
|
if 'mesh_posed' in data_to_convert:
|
||||||
|
for i in range(len(uv_posed)):
|
||||||
|
np.savez_compressed(os.path.join(folder, 'uv_posed_no_orient', f'{id}_{i}_{garment}.npz'), uv_posed=uv_posed[i])
|
||||||
|
if 'mesh_unposed' in data_to_convert:
|
||||||
|
for i in range(len(uv_unposed)):
|
||||||
|
np.savez_compressed(os.path.join(folder, 'uv_unposed_no_shape', f'{id}_{i}_{garment}.npz'), uv_unposed=uv_unposed[i])
|
||||||
|
if 'mesh_normals' in data_to_convert:
|
||||||
|
for i, frame_nr in enumerate(frames_by_id[id]):
|
||||||
|
np.savez_compressed(os.path.join(folder, 'uv_normals', f'{id}.{frame_nr}.npz'), uv_normals=uv_normals[i])
|
||||||
|
if 'body_posed' in data_to_convert and k != 1:
|
||||||
|
for i in range(len(uv_body_posed)):
|
||||||
|
np.savez_compressed(os.path.join(folder, 'uv_body_posed_no_orient', f'{id}_{i}.npz'), uv_body_posed=uv_body_posed[i])
|
||||||
|
|
||||||
|
# pass
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user