Compare commits
70
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 | ||
|
|
a1470cfd6e | ||
|
|
bc51f4dd94 | ||
|
|
1ac55a55e7 |
@@ -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['gpu'] = '4'
|
||||
config['gpu'] = '0'
|
||||
config['name'] = 'body_torch_cape_m'
|
||||
config['notes'] = ' '
|
||||
config['tags'] = ['torch', 'body']
|
||||
@@ -11,9 +11,9 @@ config['script'] = 'scripts/ae_body_train.py'
|
||||
config['pretrained_model'] = ''
|
||||
|
||||
config['batch_size'] = 4
|
||||
config['train_dir'] = '/data-local/127/cape_processed/train/male'
|
||||
config['valid_dir'] = '/data-local/127/cape_processed/test/male'
|
||||
config['test_dir'] = '/data-local/127/cape_processed/test/male'
|
||||
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
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
from utils.convnext_utils import CNBlockConfig
|
||||
|
||||
config = dict()
|
||||
|
||||
config['gpu'] = '0'
|
||||
config['name'] = 'norm_torch_2'
|
||||
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/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['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,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 = [
|
||||
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||
CNBlockConfig(128, 128, 9),
|
||||
CNBlockConfig(128, 65, 3),
|
||||
CNBlockConfig(128, 64, 3),
|
||||
CNBlockConfig(64, 3, 3),
|
||||
]
|
||||
|
||||
@@ -158,7 +158,7 @@ for res in config['pyramid']['resolutions']:
|
||||
|
||||
block_setting_reverse = [
|
||||
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||
CNBlockConfig(128, 128, 9),
|
||||
CNBlockConfig(128, 64, 9),
|
||||
CNBlockConfig(64, 3, 9),
|
||||
]
|
||||
|
||||
@@ -134,7 +134,7 @@ for res in config['pyramid']['resolutions']:
|
||||
block_setting_reverse = [
|
||||
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||
CNBlockConfig(128, 128, 9),
|
||||
CNBlockConfig(128, 65, 3),
|
||||
CNBlockConfig(128, 64, 3),
|
||||
CNBlockConfig(64, 3, 3),
|
||||
]
|
||||
|
||||
@@ -158,7 +158,7 @@ for res in config['pyramid']['resolutions']:
|
||||
|
||||
block_setting_reverse = [
|
||||
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||
CNBlockConfig(128, 128, 9),
|
||||
CNBlockConfig(128, 64, 9),
|
||||
CNBlockConfig(64, 3, 9),
|
||||
]
|
||||
|
||||
@@ -134,7 +134,7 @@ for res in config['pyramid']['resolutions']:
|
||||
block_setting_reverse = [
|
||||
CNBlockConfig(level['bottleneck_size'] * 2, 128, 3),
|
||||
CNBlockConfig(128, 128, 9),
|
||||
CNBlockConfig(128, 65, 3),
|
||||
CNBlockConfig(128, 64, 3),
|
||||
CNBlockConfig(64, 3, 3),
|
||||
]
|
||||
|
||||
@@ -158,7 +158,7 @@ for res in config['pyramid']['resolutions']:
|
||||
|
||||
block_setting_reverse = [
|
||||
CNBlockConfig(level['bottleneck_size'] * 2, 128, 9),
|
||||
CNBlockConfig(128, 128, 9),
|
||||
CNBlockConfig(128, 64, 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,78 +0,0 @@
|
||||
from utils.convnext_utils import CNBlockConfig
|
||||
|
||||
config = dict()
|
||||
|
||||
config['gpu'] = '4'
|
||||
config['name'] = 'direct_3'
|
||||
config['notes'] = 'with curvature input and skip connection'
|
||||
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*2, 128, 9),
|
||||
CNBlockConfig(128*2, 32, 9),
|
||||
CNBlockConfig(32*2, 16, 3),
|
||||
CNBlockConfig(16*2, 8, 3),
|
||||
CNBlockConfig(8, 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',
|
||||
}
|
||||
@@ -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.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):
|
||||
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.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):
|
||||
if uv.shape[1] == 3 or uv.shape[1] == 7:
|
||||
uv = torch.permute(uv, [0,2,3,1])
|
||||
if uv.shape[1] != 512:
|
||||
raise NotImplementedError
|
||||
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)
|
||||
uv = torch.permute(self.resizer(torch.permute(uv, [0,3,1,2])), [0,2,3,1])
|
||||
|
||||
mesh = torch.mean(uv[:, self.uv_pixels[:,:,0], self.uv_pixels[:,:,1]].float(), dim=2)
|
||||
return mesh
|
||||
@@ -75,35 +53,6 @@ class UV2Mesh(nn.Module):
|
||||
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):
|
||||
V_mask = mask
|
||||
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
|
||||
|
||||
|
||||
# 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):
|
||||
Vs = []
|
||||
Fs = []
|
||||
@@ -273,25 +208,6 @@ def plot_3d_collision(gt, collision_1, collision_2, collision_faces, collision_c
|
||||
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):
|
||||
# from torchview import draw_graph
|
||||
@@ -305,6 +221,7 @@ def get_summary_str(model):
|
||||
|
||||
return [f'all_params: {total_params}, trainable: {trainable_params}']
|
||||
|
||||
|
||||
def get_summary_html(model):
|
||||
lines = get_summary_str(model)
|
||||
html = ''
|
||||
@@ -313,88 +230,6 @@ def get_summary_html(model):
|
||||
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():
|
||||
def __init__(self):
|
||||
self.dict = dict()
|
||||
@@ -434,4 +269,37 @@ def write_obj(file, vertices, faces, colors):
|
||||
file.write(line)
|
||||
for f in faces:
|
||||
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
|
||||
@@ -0,0 +1,112 @@
|
||||
import os
|
||||
import sys
|
||||
import numpy as np
|
||||
import trimesh as tm
|
||||
import scipy.io as sio
|
||||
import plotly.graph_objects as go
|
||||
import plotly.express as px
|
||||
from tqdm import tqdm
|
||||
import torch
|
||||
from scipy.spatial.transform import Rotation as R
|
||||
import argparse
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
|
||||
|
||||
from data.cloth3d_io import readOBJ, readPC2
|
||||
from data.utils import Frame
|
||||
from smpl.smpl_torch import SMPL
|
||||
|
||||
|
||||
def calculate_normals(vertices, mesh_file, poses):
|
||||
_, faces, _, _ = readOBJ(mesh_file)
|
||||
rodr = smpl.rodrigues(torch.tensor(poses.T.reshape(-1, 1, 3), dtype=torch.float32)).numpy().reshape(vertices.shape[0], -1, 3, 3)
|
||||
|
||||
normals = []
|
||||
for i in range(vertices.shape[0]):
|
||||
r = R.from_matrix(rodr[i, 0, :, :])
|
||||
# assert r.as_matrix() == rodr[frame, 0, :, :]
|
||||
out = r.apply(vertices[i], inverse=True)
|
||||
|
||||
# create a plotly mesh plot of out and vertices [i]
|
||||
# fig = go.Figure(data=[
|
||||
# go.Mesh3d(
|
||||
# x=out[:, 0], y=out[:, 2], z=out[:, 1],
|
||||
# # i, j and k give the vertices of triangles
|
||||
# i=faces[:, 0], j=faces[:, 1], k=faces[:, 2],
|
||||
# name='y',
|
||||
# showscale=False
|
||||
# ),
|
||||
# go.Mesh3d(
|
||||
# x=vertices[i][:, 0], y=vertices[i][:, 1], z=vertices[i][:, 2],
|
||||
# # i, j and k give the vertices of triangles
|
||||
# i=faces[:, 0], j=faces[:, 1], k=faces[:, 2],
|
||||
# name='x',
|
||||
# showscale=False
|
||||
# )
|
||||
# ])
|
||||
# fig.show()
|
||||
|
||||
mesh = tm.Trimesh(vertices=out, faces=faces, process=False, validate=False)
|
||||
normals.append(mesh.vertex_normals)
|
||||
return np.stack(normals)
|
||||
|
||||
|
||||
def get_frames(folder):
|
||||
uv_static_folder = os.path.join(folder, 'pose_shape')
|
||||
frames = sorted(os.listdir(uv_static_folder))
|
||||
|
||||
frames = [frame.split('.')[0] for frame in frames] # .split('_')[0]
|
||||
frames = [Frame(frame.split('_')[0], frame.split('_')[1]) for frame in frames]
|
||||
return frames
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
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='/data-net/dataset/cloth3d/train')
|
||||
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("-n", "--name", help = "end of range", default='lhunor')
|
||||
args = parser.parse_args()
|
||||
|
||||
obj_folder = args.folder_object # '/data-net/dataset/cloth3d/train'
|
||||
folder = args.folder #'/data-local/127/train'
|
||||
|
||||
os.makedirs(os.path.join(folder, 'mesh_normals'), exist_ok=True)
|
||||
frames = get_frames(folder)
|
||||
smpl = SMPL('cpu', 'smpl')
|
||||
|
||||
ids = {frame.id for frame in frames}
|
||||
ids = sorted(list(ids))[int(args.start):int(args.end)]
|
||||
|
||||
for id in tqdm(ids):
|
||||
# find obj files in the folder
|
||||
garment_obj_folder = os.path.join(obj_folder, id[:5])
|
||||
garments = [file.split('.')[0] for file in os.listdir(garment_obj_folder) if file.endswith('.obj')]
|
||||
|
||||
if len(id) == 5:
|
||||
garment = garments[0]
|
||||
elif len(id) == 6:
|
||||
garment = garments[1]
|
||||
else:
|
||||
raise ValueError('Invalid frame id')
|
||||
|
||||
mesh_file = os.path.join(garment_obj_folder, f'{garment}.obj')
|
||||
vertices =readPC2(os.path.join(garment_obj_folder, f'{garment}.pc16'), True)['V']
|
||||
poses = sio.loadmat(os.path.join(garment_obj_folder, f'info.mat'))['poses']
|
||||
normals = calculate_normals(vertices, mesh_file, poses)
|
||||
|
||||
map = sio.loadmat(os.path.join(garment_obj_folder, f'{garment}_map.mat'))['map'][0]
|
||||
mask = np.load(os.path.join(folder, 'mesh_mask', f'{id}.npy'))
|
||||
|
||||
mesh_normals = normals[:,map,:]
|
||||
mesh_normals = mesh_normals * mask[None,:, None]
|
||||
|
||||
for i in range(vertices.shape[0]):
|
||||
# np.savez(os.path.join(folder, 'mesh_normals', f'{id}_{i}.npz'), mesh_normals=mesh_normals)
|
||||
np.savez_compressed(os.path.join(folder, 'mesh_normals', f'{id}_{i}.npz'), mesh_normals=mesh_normals[i])
|
||||
|
||||
# pass
|
||||
|
||||
# print(frame.id, frame.frame_nr)
|
||||
|
||||
+12
-1
@@ -342,7 +342,6 @@ import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
|
||||
|
||||
import plotly.graph_objects as go
|
||||
from custom_utils.custom_utils import _maskFaces
|
||||
|
||||
def plot_3d(mesh, faces):
|
||||
fig = go.Figure()
|
||||
@@ -370,7 +369,19 @@ def plot_3d(mesh, faces):
|
||||
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__':
|
||||
from custom_utils.custom_utils import _maskFaces
|
||||
|
||||
folder = '/home/workspace/data/dataset/cloth3d/train'
|
||||
F = np.load("custom_utils/smpl_faces.npy")#.astype(np.int32)
|
||||
|
||||
+120
-143
@@ -12,7 +12,7 @@ import pickle
|
||||
import numpy as np
|
||||
import scipy as sp
|
||||
import trimesh as tm
|
||||
import cmapy as cm
|
||||
# import cmapy as cm
|
||||
import tables as tb
|
||||
import scipy.io as sio
|
||||
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__)) + '/..')
|
||||
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"
|
||||
@@ -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[m2uv[:, 0]] = verts
|
||||
uv_values[m2uv[:, 1]] += verts
|
||||
uv_values = uv_values[uv_map_mask, :] # add garment mask
|
||||
uv_values /= uv_counter[:, np.newaxis]
|
||||
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] # add garment 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[:, 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()
|
||||
|
||||
# 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[garment_mask, :]
|
||||
rbf_dest_current = rbf_dest
|
||||
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))
|
||||
@@ -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 = 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[:,:,0]
|
||||
rbf_dest_current = rbf_dest * 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
|
||||
|
||||
|
||||
@@ -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]]
|
||||
|
||||
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:
|
||||
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[:, m2uv[:, 0]] = verts
|
||||
uv_values[:, m2uv[:, 1]] += verts
|
||||
uv_values = uv_values[:, uv_map_mask, :]
|
||||
uv_values /= uv_counter[np.newaxis, :, np.newaxis]
|
||||
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[:, 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:
|
||||
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
|
||||
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[garment_mask, :]
|
||||
rbf_dest_current = rbf_dest
|
||||
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[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[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
|
||||
|
||||
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.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[m2uv[:, 0]] = 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
|
||||
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[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 + 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.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[m2uv[:, 0]] = verts[i]
|
||||
uv_values[m2uv[:, 1]] += verts[i]
|
||||
uv_values = uv_values[uv_map_mask, :]
|
||||
uv_values /= uv_counter[:, np.newaxis]
|
||||
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[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)
|
||||
@@ -386,12 +386,12 @@ def test(verts, faces, values):
|
||||
|
||||
|
||||
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 = []
|
||||
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")
|
||||
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")
|
||||
shapedirs.append(male['shapedirs'][to_keep, :])
|
||||
return shapedirs
|
||||
@@ -399,162 +399,139 @@ def get_shapedirs():
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-f", "--folder", help = "end of range", default='/home/workspace/data/dataset/cloth3d/train')
|
||||
parser.add_argument("-s", "--start", help = "start of range", default=70500)
|
||||
parser.add_argument("-e", "--end", help = "end of range", default=90000)
|
||||
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=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("-sk", "--skirt", help = "end of range", default=0)
|
||||
args = parser.parse_args()
|
||||
|
||||
F = np.load("custom_utils/smpl_faces" + ("_skirt" if args.skirt == 1 else "") + ".npy")
|
||||
uv_map = np.load('custom_utils/stretched_uv_map_' + ("skirt" if args.skirt == 1 else "3") + '.npy')
|
||||
m2uv = np.load('custom_utils/m2uv' + ("_skirt" if args.skirt == 1 else "") + '.npy', allow_pickle=True).item()
|
||||
m2uv = m2uv_array(m2uv)
|
||||
uv_mask = np.load('custom_utils/mask_256x512' + ("_skirt" if args.skirt == 1 else "") + '.npy')
|
||||
curvature_label_type = '6_25 '
|
||||
F = {'non-skirt': np.load("smpl/smpl_faces.npy"), 'skirt': np.load("smpl/smpl_faces_skirt.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 = {'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 = {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_mask = (cv2.resize(uv_mask * 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 = 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]
|
||||
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():
|
||||
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_mask = unique_uv_map_mask(uv_map_discreet)
|
||||
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 = np.zeros((uv_map.shape[0]))
|
||||
uv_counter[m2uv[:, 0]] = 1
|
||||
uv_counter[m2uv[:, 1]] += 1
|
||||
uv_counter = uv_counter[uv_map_mask]
|
||||
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 = 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[uv_map_discreet_unique[:, 0], uv_map_discreet_unique[:, 1]] = 0
|
||||
rbf_dest[np.invert(uv_mask[:,:,0])] = 0
|
||||
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
|
||||
|
||||
|
||||
#########################################################################################
|
||||
|
||||
use_no_orient = False
|
||||
no_shape = False
|
||||
is_skirt = True if args.skirt == 1 else False
|
||||
folder = args.folder
|
||||
neighbourhood = 25
|
||||
frames_file = 'frames_all.txt'
|
||||
data_to_convert = ['mesh_posed', 'mesh_static', 'mesh_curvature', 'body_posed'] # 'mesh_unposed',
|
||||
data_to_convert = ['mesh_posed', 'mesh_static', 'mesh_normals', 'body_posed', 'mesh_unposed'] # 'mesh_unposed',
|
||||
|
||||
print("skirt" if args.skirt == 1 else "not skirt")
|
||||
print(f'params: -f {args.folder} -s {args.start} -e {args.end} -n {args.name} -skirt {args.skirt}')
|
||||
|
||||
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)))
|
||||
ids = sorted(os.listdir(folder + '/mesh_body_posed_no_orient'))[args.start:args.end]
|
||||
ids = [id.split('.')[0].split('_')[0] for id in ids]
|
||||
|
||||
shapedirs = get_shapedirs()
|
||||
|
||||
root = '/'.join(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(extras_folder, exist_ok=True)
|
||||
os.makedirs(os.path.join(extras_folder, 'uv_posed' + orient_mod), exist_ok=True)
|
||||
os.makedirs(os.path.join(extras_folder, 'uv_static'), exist_ok=True)
|
||||
os.makedirs(os.path.join(extras_folder, 'uv_curvature'), exist_ok=True)
|
||||
os.makedirs(os.path.join(extras_folder, 'uv_unposed'), exist_ok=True)
|
||||
os.makedirs(os.path.join(extras_folder, 'uv_body_posed' + orient_mod), exist_ok=True)
|
||||
os.makedirs(os.path.join(extras_folder, 'uv_mask'), exist_ok=True)
|
||||
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)
|
||||
|
||||
|
||||
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'))
|
||||
garments = list(info['outfit'].keys())
|
||||
assert info['poses'].shape[1] <= 300
|
||||
|
||||
# put all this in a function and call for all garments
|
||||
|
||||
# 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])]):
|
||||
for k, garment in enumerate(garments):
|
||||
# if not ('Dress' in garments or 'Skirt' in garments):
|
||||
# if k != 1:
|
||||
# files = glob.glob(os.path.join(folder, 'uv_body_posed_no_orient', f'{id}_*_{garment}.npz'))
|
||||
# for file in files:
|
||||
# shutil.move(file, '_'.join(file.split('_')[:-1]) + '.npz')
|
||||
# continue
|
||||
|
||||
mask = read_garment_mask(folder, id, garment)
|
||||
|
||||
if 'mesh_posed' in data_to_convert:
|
||||
# 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 = read_posed_garment(folder, id, garment, mask=mask, shape=info['shape'], poses=info['poses'], deorient=use_no_orient, unshape=no_shape)
|
||||
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']
|
||||
mesh_posed = np.zeros((x.shape[0], 14475, 3), dtype=np.float32)
|
||||
mesh_posed[:,mask, :] = x
|
||||
if 'mesh_unposed' in data_to_convert:
|
||||
raise NotImplementedError()
|
||||
mesh_unposed = read_unposed_garment(folder, id, garment, mask=mask, shape=info['shape'], unshape=no_shape)
|
||||
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 = read_garment_template(folder, id, garment, mask)
|
||||
if 'mesh_curvature' in data_to_convert:
|
||||
mesh_curvature = read_curvatures(folder + '_extras', id, garment, count=info['poses'].shape[1])
|
||||
if 'body_posed' in data_to_convert:
|
||||
body_posed = read_posed_body(folder, id, info['poses'], use_no_orient)
|
||||
|
||||
mesh_static = np.zeros((14475, 3), dtype=np.float32)
|
||||
mesh_static[mask, :] = np.load(os.path.join(folder, 'mesh_static', f'{id}_{garment}.npy'))
|
||||
if 'mesh_normals' in data_to_convert:
|
||||
mesh_normals = np.zeros((x.shape[0], 14475, 3), dtype=np.float32)
|
||||
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()
|
||||
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 = 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 = uv_static.astype(np.float32)
|
||||
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, 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:
|
||||
raise NotImplementedError()
|
||||
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_curvature' in data_to_convert:
|
||||
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:
|
||||
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)
|
||||
|
||||
|
||||
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)
|
||||
|
||||
# mesh_static
|
||||
# save_to_h5file(h5file, id, 0, garment, uv_static, 'uv_static', 'float32')
|
||||
# save_to_h5file(h5file, id, 0, garment, uv_mask, 'uv_mask', 'float32')
|
||||
np.savez_compressed(os.path.join(extras_folder, 'uv_static', f'{id}_{garment}.npz'), uv_static=uv_static)
|
||||
np.savez_compressed(os.path.join(extras_folder, 'uv_mask', f'{id}_{garment}.npz'), uv_mask=uv_mask_local)
|
||||
# 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(extras_folder, 'uv_posed' + orient_mod, 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')
|
||||
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:
|
||||
raise NotImplementedError()
|
||||
for i in range(uv_unposed.shape[0]):
|
||||
save_to_h5file(h5file, id, i, garment, uv_unposed[i, :, :, :], 'uv_unposed' + orient_mod + shape_mod, 'float32')
|
||||
if 'mesh_curvature' in data_to_convert:
|
||||
for i in range(len(uv_curvature)):
|
||||
np.savez_compressed(os.path.join(extras_folder, 'uv_curvature', f'{id}_{i}_{garment}.npz'), uv_curvature=uv_curvature[i].astype(np.uint8))
|
||||
# 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_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 in range(len(uv_normals)):
|
||||
np.savez_compressed(os.path.join(folder, 'uv_normals', f'{id}_{i}_{garment}.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(extras_folder, 'uv_body_posed' + orient_mod, f'{id}_{i}_{garment}.npz'), uv_body_posed=uv_body_posed[i])
|
||||
# save_to_h5file(h5file, id, i, garment, uv_body_posed[i, :, :, :], 'uv_body_posed', 'float32')
|
||||
np.savez_compressed(os.path.join(folder, 'uv_body_posed_no_orient', f'{id}_{i}.npz'), uv_body_posed=uv_body_posed[i])
|
||||
|
||||
pass
|
||||
|
||||
|
||||
h5file_curv.close()
|
||||
# pass
|
||||
|
||||
@@ -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
|
||||
+195
-72
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
# os.environ["CUDA_VISIBLE_DEVICES"] = '6'
|
||||
# os.environ["CUDA_VISIBLE_DEVICES"] = '0,1,2,3'
|
||||
|
||||
import math
|
||||
import time
|
||||
@@ -14,13 +14,14 @@ import scipy.io as sio
|
||||
import plotly.express as ex
|
||||
import torchvision
|
||||
|
||||
from torch.utils.data import Dataset
|
||||
from torchvision.transforms import Resize
|
||||
from torchvision.transforms.functional import InterpolationMode
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
|
||||
|
||||
from data.utils import Frame
|
||||
from data.cloth3d_io import readPC2, readPC2Frame
|
||||
from data.dataset_cape import DatasetCape
|
||||
|
||||
|
||||
def read_frames(folder, shuffle=True, is_cape=False, testing=False, frames_file=None):
|
||||
@@ -60,7 +61,6 @@ class StaticCache():
|
||||
self.folder = folder
|
||||
assert set(resolutions).issubset(set([32, 64, 128, 256, 512]))
|
||||
self.resolutions = resolutions
|
||||
self.filled = ''
|
||||
self.is_cape = is_cape
|
||||
self.device = device
|
||||
|
||||
@@ -74,50 +74,73 @@ class StaticCache():
|
||||
self.uv_masks[res] = down.cpu().numpy()
|
||||
|
||||
|
||||
def read(self, id):
|
||||
def read(self, id, garment):
|
||||
data = dict()
|
||||
|
||||
mesh_mask = np.load(os.path.join(self.folder, 'mesh_mask', f'{id}_{garment}.npy')); mesh_mask = mesh_mask.astype(bool)
|
||||
data['mesh_mask'] = mesh_mask
|
||||
|
||||
mesh_fix = np.load(os.path.join(self.folder, 'mesh_fixed', f'{id}_{garment}.npz'))
|
||||
data['mesh_fix'] = dict()
|
||||
data['mesh_fix']['mesh_mask'] = torch.from_numpy(mesh_fix['mask'])
|
||||
# data['mesh_fix']['mask_convert'] = torch.from_numpy(mesh_fix['mas_convert'])
|
||||
# data['mesh_fix']['faces'] = torch.from_numpy(mesh_fix['faces'])
|
||||
|
||||
for res in self.resolutions:
|
||||
res_string = ''
|
||||
if res != 512:
|
||||
res_string = '_' + str(res)
|
||||
|
||||
if 'uv_static' + res_string in self.signature:
|
||||
uv_static = np.load(os.path.join(self.folder, 'uv_static' + self.filled + res_string, id + '.npz')); uv_static = uv_static['uv_static' + self.filled]; data['uv_static' + res_string] = uv_static
|
||||
uv_static = np.load(os.path.join(self.folder, f'uv_static{res_string}', f'{id}_{garment}.npz')); uv_static = uv_static['uv_static']; data['uv_static' + res_string] = uv_static
|
||||
if 'uv_mask' + res_string in self.signature:
|
||||
if self.is_cape:
|
||||
data['uv_mask' + res_string] = self.uv_masks[res]
|
||||
else:
|
||||
uv_mask = np.load(os.path.join(self.folder, 'uv_mask' + res_string, id + '.npz')); uv_mask=uv_mask['uv_mask']; uv_mask = uv_mask.astype(np.float32); data['uv_mask' + res_string] = uv_mask
|
||||
uv_mask = np.load(os.path.join(self.folder, f'uv_mask{res_string}', f'{id}_{garment}.npz')); uv_mask=uv_mask['uv_mask']; uv_mask = uv_mask.astype(np.float32); data['uv_mask' + res_string] = uv_mask
|
||||
|
||||
if 'mesh_static' in self.signature:
|
||||
mesh_static = np.load(os.path.join(self.folder, 'mesh_static', id + '.npz')); mesh_static = mesh_static['mesh_static']; data['mesh_static'] = mesh_static.astype(np.float32)
|
||||
if 'mesh_mask' in self.signature:
|
||||
if self.is_cape:
|
||||
data['mesh_mask'] = np.ones((3638), np.float32)
|
||||
else:
|
||||
mesh_mask = np.load(os.path.join(self.folder, 'mesh_mask', id + '.npy')); mesh_mask = mesh_mask.astype(np.float32); data['mesh_mask'] = mesh_mask
|
||||
mesh_static = np.load(os.path.join(self.folder, 'mesh_static', f'{id}_{garment}.npy'))
|
||||
data['mesh_static'] = np.zeros((14475, 3), dtype=np.float32)
|
||||
data['mesh_static'][mesh_mask] = mesh_static.astype(np.float32)
|
||||
|
||||
# if 'uv_shaped_body' in self.signature:
|
||||
# uv_shaped_body = np.load(os.path.join(self.folder, 'uv_shaped_body', id + '.npz')); uv_shaped_body = uv_shaped_body['uv_shaped_body']; data['uv_shaped_body'] = uv_shaped_body
|
||||
|
||||
return data
|
||||
|
||||
|
||||
def __getitem__(self, id) -> dict:
|
||||
if id not in self.store:
|
||||
item = self.read(id)
|
||||
stored_data = { key: torch.from_numpy(value).to('cpu') for key, value in item.items()}
|
||||
def __getitem__(self, frame: Frame) -> dict:
|
||||
if (frame.id, frame.garment) not in self.store:
|
||||
item = self.read(frame.id, frame.garment)
|
||||
stored_data = { key: torch.from_numpy(value).to('cpu') for key, value in item.items() if type(value) == np.ndarray}
|
||||
stored_data['mesh_fix'] = item['mesh_fix']
|
||||
for key, value in stored_data.items():
|
||||
if key.startswith('uv_') and value.shape[-1] == 3:
|
||||
stored_data[key] = torch.permute(value, [2,0,1])
|
||||
self.store[id] = stored_data
|
||||
self.store[(frame.id, frame.garment)] = stored_data
|
||||
|
||||
data = { key: value.to(self.device) for key, value in self.store[id].items()}
|
||||
data = { key: value.to(self.device) for key, value in self.store[(frame.id, frame.garment)].items() if type(value) == torch.Tensor }
|
||||
data['mesh_fix'] = { key: value.to(self.device) for key, value in self.store[(frame.id, frame.garment)]['mesh_fix'].items() }
|
||||
return data
|
||||
|
||||
|
||||
class Dataset(Dataset):
|
||||
def __init__(self, folder, signature, resolutions=[512], frames_file='frames_all.txt', device='cuda', use_cache=False, is_cape=False):
|
||||
|
||||
def read_frames_file(frames_file, shuffle=False):
|
||||
frames = []
|
||||
with open(frames_file, 'r') as f:
|
||||
lines = f.readlines()
|
||||
lines = [line.strip() for line in lines]
|
||||
frames = [Frame(line.split()[0], int(line.split()[1]), line.split()[2]) for line in lines]
|
||||
|
||||
if shuffle:
|
||||
random.shuffle(frames)
|
||||
|
||||
return frames
|
||||
|
||||
|
||||
class DatasetCloth3D(torch.utils.data.Dataset):
|
||||
def __init__(self, folder, signature, resolutions=[512], frames_file='', device='cuda', use_cache=False, is_cape=False):
|
||||
self.folder = folder
|
||||
self.device = device
|
||||
self.is_cape = is_cape
|
||||
@@ -125,13 +148,20 @@ class Dataset(Dataset):
|
||||
self.resolutions = resolutions
|
||||
|
||||
self.transforms = tv.transforms.ToTensor()
|
||||
self.frames = read_frames(folder, frames_file=frames_file, is_cape=is_cape, shuffle=True)
|
||||
self.frames = read_frames_file(os.path.join(folder, frames_file), shuffle=False)
|
||||
|
||||
self.body_faces = np.load('smpl/smpl_faces.npy')
|
||||
self.static_cache = StaticCache(folder, signature, is_cape=is_cape, resolutions=resolutions, device=device)
|
||||
|
||||
self.cache = dict() if use_cache else None
|
||||
|
||||
ids = set([frame.id for frame in self.frames])
|
||||
self.pose_cache = dict()
|
||||
for id in ids:
|
||||
self.pose_cache[id] = np.load(os.path.join(self.folder, 'pose', f'{id}.npy'))
|
||||
self.shape_cache = dict()
|
||||
for id in ids:
|
||||
self.shape_cache[id] = np.load(os.path.join(self.folder, 'shape', f'{id}.npy'))
|
||||
|
||||
|
||||
def __len__(self):
|
||||
return len(self.frames)
|
||||
@@ -142,69 +172,59 @@ class Dataset(Dataset):
|
||||
if self.cache is not None:
|
||||
if frame in self.cache.keys():
|
||||
data = { key: (value.to(self.device) if type(value) == torch.Tensor else value) for key, value in self.cache[frame].items()}
|
||||
data = { **data, **self.static_cache[frame.id] }
|
||||
data = { **data, **self.static_cache[frame] }
|
||||
return data
|
||||
|
||||
separator = '_'
|
||||
if self.is_cape:
|
||||
separator = '.'
|
||||
|
||||
uv_posed_body_no_orient_folder_name = 'uv_posed_body_no_orient_2'
|
||||
if self.is_cape:
|
||||
uv_posed_body_no_orient_folder_name = 'uv_posed_body_no_orient'
|
||||
|
||||
item = dict()
|
||||
mesh_mask = self.static_cache[frame]['mesh_mask'].cpu().numpy().astype(bool)
|
||||
|
||||
item['id'] = frame.id
|
||||
item['frame_nr'] = frame.frame_nr
|
||||
item['garment'] = frame.garment
|
||||
|
||||
if 'id' in self.signature:
|
||||
item['id'] = frame.id
|
||||
if 'frame_nr' in self.signature:
|
||||
item['frame_nr'] = frame.frame_nr
|
||||
if 'pose_shape' in self.signature:
|
||||
pose_shape = np.load(os.path.join(self.folder, 'pose_shape', frame.id + separator + frame.frame_nr + '.npy')).astype(np.float32)
|
||||
pose_shape[:3] = 0
|
||||
item['pose_shape'] = pose_shape
|
||||
pose = self.pose_cache[frame.id][frame.frame_nr]
|
||||
pose[:3] = 0
|
||||
item['pose_shape'] = np.concatenate((pose, self.shape_cache[frame.id]), axis=0)
|
||||
if 'mesh_body_posed' in self.signature:
|
||||
mesh_posed_body_no_orient = np.load(os.path.join(self.folder, 'mesh_posed_body_no_orient', frame.id + separator + frame.frame_nr + '.npz')); mesh_posed_body_no_orient = mesh_posed_body_no_orient['mesh_posed_body_no_orient']
|
||||
item['mesh_body_posed'] = mesh_posed_body_no_orient
|
||||
mesh_body_posed_no_orient = readPC2Frame(os.path.join(self.folder, 'mesh_body_posed_no_orient', f'{frame.id}.pc16'), frame.frame_nr, True)
|
||||
item['mesh_body_posed'] = mesh_body_posed_no_orient
|
||||
if 'mesh_posed' in self.signature:
|
||||
mesh_posed = np.load(os.path.join(self.folder, 'mesh_posed_no_orient', frame.id + separator + frame.frame_nr + '.npz')); mesh_posed = mesh_posed['mesh_posed_no_orient'].astype(np.float32)
|
||||
item['mesh_posed'] = mesh_posed
|
||||
mesh_posed = readPC2Frame(os.path.join(self.folder, 'mesh_posed_no_orient', f'{frame.id}_{frame.garment}.pc16'), frame.frame_nr, True)
|
||||
item['mesh_posed'] = np.zeros((14475, 3), dtype=np.float32)
|
||||
item['mesh_posed'][mesh_mask] = mesh_posed
|
||||
if 'mesh_unposed' in self.signature:
|
||||
mesh_unposed_no_shape = np.load(os.path.join(self.folder, 'mesh_unposed_no_shape', frame.id + separator + frame.frame_nr + '.npz')); mesh_unposed_no_shape = mesh_unposed_no_shape['mesh_unposed_no_shape']
|
||||
item['mesh_unposed'] = mesh_unposed_no_shape
|
||||
if 'mesh_curvature' in self.signature:
|
||||
mesh_curvature = np.load(os.path.join(self.folder, 'mesh_curvature', frame.id + separator + frame.frame_nr + '.npz')); mesh_curvature = mesh_curvature['mesh_curvature']
|
||||
item['mesh_curvature'] = mesh_curvature.astype(np.int32)
|
||||
mesh_unposed_no_shape = readPC2Frame(os.path.join(self.folder, 'mesh_unposed_no_shape', f'{frame.id}_{frame.garment}.pc16'), frame.frame_nr, True)
|
||||
item['mesh_unposed'] = np.zeros((14475, 3), dtype=np.float32)
|
||||
item['mesh_unposed'][mesh_mask] = mesh_unposed_no_shape
|
||||
if 'mesh_normals' in self.signature:
|
||||
mesh_normals = readPC2Frame(os.path.join(self.folder, 'mesh_normals', f'{frame.id}_{frame.garment}.pc16'), frame.frame_nr, True)
|
||||
item['mesh_normals'] = np.zeros((14475, 3), dtype=np.float32)
|
||||
item['mesh_normals'][mesh_mask] = mesh_normals
|
||||
|
||||
for res in self.resolutions:
|
||||
res_string = ''
|
||||
if res != 512:
|
||||
res_string = '_' + str(res)
|
||||
|
||||
if 'uv_curvature' + res_string in self.signature:
|
||||
uv_curvature = np.load(os.path.join(self.folder, 'uv_curvature' + res_string, frame.id + separator + frame.frame_nr + '.npz'));
|
||||
if res_string != '':
|
||||
uv_curvature = uv_curvature['uv_curvature']
|
||||
else:
|
||||
uv_curvature = uv_curvature['curvature_uv']
|
||||
uv_curvature = torch.nn.functional.one_hot(torch.tensor(uv_curvature, device=self.device, dtype=torch.long), 7).float().to(self.device)
|
||||
item['uv_curvature' + res_string] = uv_curvature
|
||||
if 'uv_normals' + res_string in self.signature:
|
||||
uv_normals = np.load(os.path.join(self.folder, 'uv_normals' + res_string, f'{frame.id}_{frame.frame_nr}_{frame.garment}.npz')); uv_normals = uv_normals['uv_normals']
|
||||
item['uv_normals' + res_string] = uv_normals
|
||||
|
||||
if 'uv_unposed' + res_string in self.signature:
|
||||
uv_unposed_no_shape = np.load(os.path.join(self.folder, 'uv_unposed_no_shape' + res_string, frame.id + separator + frame.frame_nr + '.npz')); uv_unposed_no_shape = uv_unposed_no_shape['uv_unposed_no_shape']
|
||||
uv_unposed_no_shape = np.load(os.path.join(self.folder, 'uv_unposed_no_shape' + res_string, f'{frame.id}_{frame.frame_nr}_{frame.garment}.npz')); uv_unposed_no_shape = uv_unposed_no_shape['uv_unposed']
|
||||
item['uv_unposed' + res_string] = uv_unposed_no_shape
|
||||
|
||||
if 'uv_body_posed' + res_string in self.signature:
|
||||
uv_posed_body_no_orient = np.load(os.path.join(self.folder, uv_posed_body_no_orient_folder_name + res_string, frame.id + separator + frame.frame_nr + '.npz'))
|
||||
uv_posed_body_no_orient = uv_posed_body_no_orient['uv_posed_body_no_orient']
|
||||
item['uv_body_posed' + res_string] = uv_posed_body_no_orient
|
||||
uv_body_posed_no_orient = np.load(os.path.join(self.folder, 'uv_body_posed_no_orient' + res_string[1:], f'{frame.id}_{frame.frame_nr}.npz')); uv_body_posed_no_orient = uv_body_posed_no_orient['uv_body_posed']
|
||||
item['uv_body_posed' + res_string] = uv_body_posed_no_orient
|
||||
|
||||
if 'uv_posed' + res_string in self.signature:
|
||||
uv_posed = np.load(os.path.join(self.folder, 'uv_posed_no_orient' + res_string, frame.id + separator + frame.frame_nr + '.npz')); uv_posed = uv_posed['uv_posed_no_orient']
|
||||
uv_posed = np.load(os.path.join(self.folder, 'uv_posed_no_orient' + res_string, f'{frame.id}_{frame.frame_nr}_{frame.garment}.npz')); uv_posed = uv_posed['uv_posed']
|
||||
item['uv_posed' + res_string] = uv_posed
|
||||
|
||||
|
||||
data = { key: (torch.from_numpy(value) if not (type(value) == str or type(value) == torch.Tensor) else value) for key, value in item.items()}
|
||||
data = { key: (torch.from_numpy(value) if not (type(value) == str or type(value) == torch.Tensor or type(value) == int) else value) for key, value in item.items()}
|
||||
|
||||
for key, value in data.items():
|
||||
if key.startswith('uv_') and (value.shape[-1] == 3 or value.shape[-1] == 7):
|
||||
@@ -214,39 +234,142 @@ class Dataset(Dataset):
|
||||
self.cache[frame] = data
|
||||
|
||||
data = { key: (value.to(self.device) if type(value) == torch.Tensor else value) for key, value in data.items()}
|
||||
data = { **data, **self.static_cache[frame.id] }
|
||||
data = { **data, **self.static_cache[frame] }
|
||||
return data
|
||||
|
||||
def Dataset(folder, signature, resolutions=[512], frames_file='', device='cuda', use_cache=False, is_cape=False):
|
||||
if not is_cape:
|
||||
return DatasetCloth3D(folder, signature, resolutions=resolutions, frames_file=frames_file, device=device, use_cache=use_cache, is_cape=False)
|
||||
else:
|
||||
return DatasetCape(folder, signature, resolutions=resolutions, frames_file=frames_file, device=device, use_cache=use_cache, is_cape=True)
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from torch.utils.data import DataLoader
|
||||
|
||||
import plotly.graph_objects as go
|
||||
import plotly.express as ex
|
||||
from plotly.subplots import make_subplots
|
||||
from custom_utils.custom_utils import _maskFaces
|
||||
from losses.losses import collision_loss, normal_loss
|
||||
from smpl.smpl_torch import SMPL
|
||||
from torch.profiler import profile, record_function, ProfilerActivity
|
||||
|
||||
F = np.load('smpl/smpl_faces.npy')
|
||||
F_skirt = np.load('smpl/smpl_faces_skirt.npy')
|
||||
|
||||
device = "cuda" if torch.cuda.is_available() else "cpu"
|
||||
|
||||
signature = { 'id',
|
||||
'frame_nr',
|
||||
'pose_shape',
|
||||
signature = { 'pose_shape',
|
||||
'uv_posed',
|
||||
'uv_body_posed',
|
||||
'mesh_body_posed',
|
||||
'mesh_posed',
|
||||
'mesh_unposed',
|
||||
'uv_unposed',
|
||||
'uv_curvature',
|
||||
'mesh_curvature',
|
||||
'uv_normals',
|
||||
'mesh_normals',
|
||||
'uv_static',
|
||||
'mesh_static',
|
||||
'mesh_mask',
|
||||
'uv_mask',
|
||||
'uv_shaped_body',
|
||||
}
|
||||
|
||||
dataset = Dataset('/data-local/127/train', signature, resolutions=[512], device=device, frames_file='frames_jumpsuit.txt')
|
||||
dataset = Dataset('/data-local/127/cloth3d_processed', signature, resolutions=[512], device=device, frames_file='frames_train.txt')
|
||||
train_dataloader = DataLoader(dataset, batch_size=4, drop_last=True, shuffle=False)
|
||||
smpl = SMPL(orig_smpl=False, path='smpl', device='cuda')
|
||||
|
||||
# create a profiler object
|
||||
profiler = torch.profiler.profile(
|
||||
activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA],
|
||||
schedule=torch.profiler.schedule(wait=2, warmup=1, active=3, repeat=2),
|
||||
on_trace_ready=torch.profiler.tensorboard_trace_handler("log_dir"),
|
||||
with_stack=True,
|
||||
profile_memory=True,
|
||||
)
|
||||
|
||||
|
||||
step = 0
|
||||
for batch in train_dataloader:
|
||||
batch
|
||||
pass
|
||||
print(batch['id'][0])
|
||||
with profiler:
|
||||
m = smpl(batch['pose_shape'][:, :72], batch['pose_shape'][:, 72:], batch['mesh_unposed'])[0]
|
||||
profiler.step()
|
||||
step += 1
|
||||
if step > 25:
|
||||
break
|
||||
|
||||
profiler.stop()
|
||||
print(profiler.key_averages().table(sort_by="cpu_time_total", row_limit=25))
|
||||
print(profiler.key_averages().table(sort_by="cuda_time_total", row_limit=25))
|
||||
print(profiler.key_averages(group_by_stack_n=5).table(sort_by='self_cpu_time_total', row_limit=10))
|
||||
|
||||
|
||||
# b = 0
|
||||
# mesh_mask = batch['mesh_mask'][b].cpu().numpy()
|
||||
# faces = F_skirt if batch['garment'][b] in ['Skirt', 'Dress'] else F
|
||||
# _, faces = _maskFaces(np.zeros((14475, 3)), faces, mesh_mask)
|
||||
|
||||
# c = collision_loss(batch['mesh_posed'], batch['mesh_body_posed'], batch['mesh_mask'])
|
||||
# fig = go.Figure(data=[go.Mesh3d(x=batch['mesh_posed'].cpu().numpy()[0,mesh_mask,0], y=batch['mesh_posed'].cpu().numpy()[0,mesh_mask,1], z=batch['mesh_posed'].cpu().numpy()[0,mesh_mask,2], i=faces[:,0], j=faces[:,1], k=faces[:,2], color='lightpink', opacity=1),
|
||||
# go.Mesh3d(x=batch['mesh_body_posed'].cpu().numpy()[0,:,0], y=batch['mesh_body_posed'].cpu().numpy()[0,:,1], z=batch['mesh_body_posed'].cpu().numpy()[0,:,2], i=F[:,0], j=F[:,1], k=F[:,2], color='lightblue', opacity=1),
|
||||
# ])
|
||||
# fig.update_layout(scene_aspectmode='cube')
|
||||
# fig.update_layout(scene=dict(xaxis=dict(range=[-1,1]), yaxis=dict(range=[-1,1]), zaxis=dict(range=[-1,1])))
|
||||
# fig.show()
|
||||
|
||||
|
||||
|
||||
|
||||
# mesh_static = batch['mesh_static'][b].cpu().numpy()[mesh_mask]
|
||||
# mesh_posed = batch['mesh_posed'][b].cpu().numpy()[mesh_mask]
|
||||
# mesh_unposed = batch['mesh_unposed'][b].cpu().numpy()[mesh_mask]
|
||||
# mesh_body_posed = batch['mesh_body_posed'][b].cpu().numpy()
|
||||
|
||||
# fig = make_subplots(rows=2, cols=2,
|
||||
# specs=[[{'type': 'mesh3d'}, {'type': 'mesh3d'}],
|
||||
# [{'type': 'mesh3d'}, {'type': 'mesh3d'}]])
|
||||
|
||||
# fig.add_trace(go.Mesh3d(x=mesh_static[:,0], y=mesh_static[:,2], z=mesh_static[:,1], i=faces[:,0], j=faces[:,1], k=faces[:,2], opacity=1), row=1, col=1)
|
||||
# fig.add_trace(go.Mesh3d(x=mesh_posed[:,0], y=mesh_posed[:,2], z=mesh_posed[:,1], i=faces[:,0], j=faces[:,1], k=faces[:,2], opacity=1), row=1, col=2)
|
||||
# fig.add_trace(go.Mesh3d(x=mesh_unposed[:,0], y=mesh_unposed[:,2], z=mesh_unposed[:,1], i=faces[:,0], j=faces[:,1], k=faces[:,2], opacity=1), row=2, col=1)
|
||||
# fig.add_trace(go.Mesh3d(x=mesh_body_posed[:,0], y=mesh_body_posed[:,2], z=mesh_body_posed[:,1], i=F[:,0], j=F[:,1], k=F[:,2], opacity=1), row=2, col=2)
|
||||
|
||||
# fig.update_layout(scene=dict(xaxis=dict(range=[-1, 1], autorange=False),
|
||||
# yaxis=dict(range=[-1, 1], autorange=False),
|
||||
# zaxis=dict(range=[-1, 1], autorange=False),
|
||||
# aspectmode='cube'),
|
||||
# scene2=dict(xaxis=dict(range=[-1, 1], autorange=False),
|
||||
# yaxis=dict(range=[-1, 1], autorange=False),
|
||||
# zaxis=dict(range=[-1, 1], autorange=False),
|
||||
# aspectmode='cube'),
|
||||
# scene3=dict(xaxis=dict(range=[-1, 1], autorange=False),
|
||||
# yaxis=dict(range=[-1, 1], autorange=False),
|
||||
# zaxis=dict(range=[-1, 1], autorange=False),
|
||||
# aspectmode='cube'),
|
||||
# scene4=dict(xaxis=dict(range=[-1, 1], autorange=False),
|
||||
# yaxis=dict(range=[-1, 1], autorange=False),
|
||||
# zaxis=dict(range=[-1, 1], autorange=False),
|
||||
# aspectmode='cube'))
|
||||
|
||||
# fig.show()
|
||||
|
||||
|
||||
# uv_mask = batch['uv_mask'][b].cpu().numpy()
|
||||
# uv_mask = np.repeat(uv_mask[np.newaxis, :, :], 3, axis=0)
|
||||
# uv_static = (batch['uv_static'][b].cpu().numpy() + 1) / 2
|
||||
# uv_posed = (batch['uv_posed'][b].cpu().numpy() + 1) / 2
|
||||
# uv_unposed = (batch['uv_unposed'][b].cpu().numpy() + 1) / 2
|
||||
# uv_body_posed = (batch['uv_body_posed'][b].cpu().numpy() + 1) / 2
|
||||
# uv_normals = (batch['uv_normals'][b].cpu().numpy() + 1.5) / 3
|
||||
|
||||
# img = np.concatenate([uv_mask, uv_static, uv_posed, uv_unposed, uv_body_posed, uv_normals], axis=2)
|
||||
# img = np.transpose(img, (1, 2, 0))
|
||||
# ex.imshow(img).show()
|
||||
|
||||
# pass
|
||||
|
||||
pass
|
||||
|
||||
@@ -274,7 +397,7 @@ if __name__ == '__main__':
|
||||
# for i, batch in enumerate(dataset):
|
||||
# print(i)
|
||||
# batch = static_dataset.expand_batch(batch_to_dict(batch, signature_dynamic))
|
||||
# ex.imshow(batch['uv_curvature'][0].numpy().argmax(-1) / 6.0).show()
|
||||
# ex.imshow(batch['uv_normals'][0].numpy().argmax(-1) / 6.0).show()
|
||||
# sum_uv += batch['uv_unposed'].numpy().sum(axis=0)
|
||||
# sum_mask += batch['uv_mask'].numpy().sum(axis=0)
|
||||
|
||||
|
||||
@@ -0,0 +1,303 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
# os.environ["CUDA_VISIBLE_DEVICES"] = '6'
|
||||
|
||||
import math
|
||||
import time
|
||||
import torch
|
||||
import random
|
||||
import pytorch3d
|
||||
import torchvision as tv
|
||||
import numpy as np
|
||||
import scipy.io as sio
|
||||
import plotly.express as ex
|
||||
import torchvision
|
||||
|
||||
from torchvision.transforms import Resize
|
||||
from torchvision.transforms.functional import InterpolationMode
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
|
||||
|
||||
from data.utils import Frame
|
||||
|
||||
|
||||
def read_frames(folder, shuffle=True, is_cape=False, testing=False, frames_file=None):
|
||||
if frames_file is None:
|
||||
uv_static_folder = os.path.join(folder, 'pose_shape')
|
||||
frames = sorted(os.listdir(uv_static_folder))
|
||||
|
||||
if is_cape:
|
||||
frames = ['.'.join(frame.split('.')[:-1]) for frame in frames] # .split('_')[0]
|
||||
frames = [Frame(frame.split('.')[0], frame.split('.')[1], 'cape') for frame in frames]
|
||||
else:
|
||||
frames = [frame.split('.')[0] for frame in frames] # .split('_')[0]
|
||||
frames = [Frame(frame.split('_')[0], frame.split('_')[1]) for frame in frames]
|
||||
|
||||
# if testing:
|
||||
# frames = sorted(os.listdir(os.path.join(folder, 'mesh_static') ))
|
||||
# frames = [frame.split('.')[0] + '_4' for frame in frames]
|
||||
|
||||
|
||||
if frames_file is not None:
|
||||
frames = []
|
||||
with open(os.path.join(folder, frames_file), 'r') as f:
|
||||
lines = f.readlines()
|
||||
lines = [line.strip() for line in lines]
|
||||
frames = [Frame(line.split('_')[0], line.split('_')[1]) for line in lines]
|
||||
|
||||
if shuffle:
|
||||
random.shuffle(frames)
|
||||
|
||||
return frames
|
||||
|
||||
|
||||
class StaticCache():
|
||||
def __init__(self, folder, signature, resolutions=[512], is_cape=False, device='cuda') -> None:
|
||||
self.store = dict()
|
||||
self.signature = signature
|
||||
self.folder = folder
|
||||
assert set(resolutions).issubset(set([32, 64, 128, 256, 512]))
|
||||
self.resolutions = resolutions
|
||||
self.filled = ''
|
||||
self.is_cape = is_cape
|
||||
self.device = device
|
||||
|
||||
if is_cape:
|
||||
self.uv_masks = dict()
|
||||
uv_mask = torch.tensor(np.load('custom_data/garment_uv_mask_full.npy').astype(np.int32), device=device)
|
||||
self.uv_masks[512] = uv_mask.to(torch.float32).cpu().numpy()
|
||||
for res in [32, 64, 128, 256]:
|
||||
down = Resize(size=(res, int(res/2)), interpolation=InterpolationMode.NEAREST_EXACT)(uv_mask[None,:,:])
|
||||
down = torch.squeeze(down).to(torch.float32)
|
||||
self.uv_masks[res] = down.cpu().numpy()
|
||||
|
||||
|
||||
def read(self, id):
|
||||
data = dict()
|
||||
|
||||
for res in self.resolutions:
|
||||
res_string = ''
|
||||
if res != 512:
|
||||
res_string = '_' + str(res)
|
||||
|
||||
if 'uv_static' + res_string in self.signature:
|
||||
uv_static = np.load(os.path.join(self.folder, 'uv_static' + self.filled + res_string, id + '.npz')); uv_static = uv_static['uv_static' + self.filled]; data['uv_static' + res_string] = uv_static.astype(np.float32)
|
||||
if 'uv_mask' + res_string in self.signature:
|
||||
if self.is_cape:
|
||||
data['uv_mask' + res_string] = self.uv_masks[res]
|
||||
else:
|
||||
uv_mask = np.load(os.path.join(self.folder, 'uv_mask' + res_string, id + '.npz')); uv_mask=uv_mask['uv_mask']; uv_mask = uv_mask.astype(np.float32); data['uv_mask' + res_string] = uv_mask
|
||||
|
||||
if 'mesh_static' in self.signature:
|
||||
mesh_static = np.load(os.path.join(self.folder, 'mesh_static', id + '.npz')); mesh_static = mesh_static['mesh_static']; data['mesh_static'] = mesh_static.astype(np.float32)
|
||||
if self.is_cape:
|
||||
data['mesh_mask'] = np.ones((3638), np.float32)
|
||||
else:
|
||||
mesh_mask = np.load(os.path.join(self.folder, 'mesh_mask', id + '.npy')); mesh_mask = mesh_mask.astype(np.float32); data['mesh_mask'] = mesh_mask
|
||||
# if 'uv_shaped_body' in self.signature:
|
||||
# uv_shaped_body = np.load(os.path.join(self.folder, 'uv_shaped_body', id + '.npz')); uv_shaped_body = uv_shaped_body['uv_shaped_body']; data['uv_shaped_body'] = uv_shaped_body
|
||||
|
||||
return data
|
||||
|
||||
|
||||
def __getitem__(self, id) -> dict:
|
||||
if id not in self.store:
|
||||
item = self.read(id)
|
||||
stored_data = { key: torch.from_numpy(value).to('cpu') for key, value in item.items()}
|
||||
for key, value in stored_data.items():
|
||||
if key.startswith('uv_') and value.shape[-1] == 3:
|
||||
stored_data[key] = torch.permute(value, [2,0,1])
|
||||
self.store[id] = stored_data
|
||||
|
||||
data = { key: value.to(self.device) for key, value in self.store[id].items()}
|
||||
return data
|
||||
|
||||
|
||||
class DatasetCape(torch.utils.data.Dataset):
|
||||
def __init__(self, folder, signature, resolutions=[512], frames_file='frames_all.txt', device='cuda', use_cache=False, is_cape=False):
|
||||
self.folder = folder
|
||||
self.device = device
|
||||
self.is_cape = is_cape
|
||||
self.signature = signature
|
||||
self.resolutions = resolutions
|
||||
|
||||
self.transforms = tv.transforms.ToTensor()
|
||||
self.frames = read_frames(folder, frames_file=frames_file, is_cape=is_cape, shuffle=True)
|
||||
|
||||
self.body_faces = np.load('smpl/smpl_faces.npy')
|
||||
self.static_cache = StaticCache(folder, signature, is_cape=is_cape, resolutions=resolutions, device=device)
|
||||
|
||||
self.cache = dict() if use_cache else None
|
||||
|
||||
|
||||
def __len__(self):
|
||||
return len(self.frames)
|
||||
|
||||
|
||||
def __getitem__(self, idx):
|
||||
frame : Frame = self.frames[idx]
|
||||
if self.cache is not None:
|
||||
if frame in self.cache.keys():
|
||||
data = { key: (value.to(self.device) if type(value) == torch.Tensor else value) for key, value in self.cache[frame].items()}
|
||||
data = { **data, **self.static_cache[frame.id] }
|
||||
return data
|
||||
|
||||
separator = '_'
|
||||
if self.is_cape:
|
||||
separator = '.'
|
||||
|
||||
uv_posed_body_no_orient_folder_name = 'uv_posed_body_no_orient_2'
|
||||
if self.is_cape:
|
||||
uv_posed_body_no_orient_folder_name = 'uv_posed_body_no_orient'
|
||||
|
||||
item = dict()
|
||||
|
||||
if 'id' in self.signature:
|
||||
item['id'] = frame.id
|
||||
if 'frame_nr' in self.signature:
|
||||
item['frame_nr'] = frame.frame_nr
|
||||
item['garment'] = 'cape'
|
||||
if 'pose_shape' in self.signature:
|
||||
pose_shape = np.load(os.path.join(self.folder, 'pose_shape', frame.id + separator + frame.frame_nr + '.npy')).astype(np.float32)
|
||||
pose_shape[:3] = 0
|
||||
item['pose_shape'] = pose_shape
|
||||
if 'mesh_body_posed' in self.signature:
|
||||
mesh_posed_body_no_orient = np.load(os.path.join(self.folder, 'mesh_posed_body_no_orient', frame.id + separator + frame.frame_nr + '.npz')); mesh_posed_body_no_orient = mesh_posed_body_no_orient['mesh_posed_body_no_orient']
|
||||
item['mesh_body_posed'] = mesh_posed_body_no_orient
|
||||
if 'mesh_posed' in self.signature:
|
||||
mesh_posed = np.load(os.path.join(self.folder, 'mesh_posed_no_orient', frame.id + separator + frame.frame_nr + '.npz')); mesh_posed = mesh_posed['mesh_posed_no_orient'].astype(np.float32)
|
||||
item['mesh_posed'] = mesh_posed
|
||||
if 'mesh_unposed' in self.signature:
|
||||
mesh_unposed_no_shape = np.load(os.path.join(self.folder, 'mesh_unposed_no_shape', frame.id + separator + frame.frame_nr + '.npz')); mesh_unposed_no_shape = mesh_unposed_no_shape['mesh_unposed_no_shape']
|
||||
item['mesh_unposed'] = mesh_unposed_no_shape
|
||||
if 'mesh_curvature' in self.signature:
|
||||
mesh_curvature = np.load(os.path.join(self.folder, 'mesh_curvature', frame.id + separator + frame.frame_nr + '.npz')); mesh_curvature = mesh_curvature['mesh_curvature']
|
||||
item['mesh_curvature'] = mesh_curvature.astype(np.int32)
|
||||
if 'mesh_normals' in self.signature:
|
||||
mesh_normals = np.load(os.path.join(self.folder, 'mesh_normals', frame.id + separator + frame.frame_nr + '.npz')); mesh_normals = mesh_normals['mesh_normals']
|
||||
item['mesh_normals'] = mesh_normals
|
||||
|
||||
for res in self.resolutions:
|
||||
res_string = ''
|
||||
if res != 512:
|
||||
res_string = '_' + str(res)
|
||||
|
||||
if 'uv_unposed' + res_string in self.signature:
|
||||
uv_unposed_no_shape = np.load(os.path.join(self.folder, 'uv_unposed_no_shape' + res_string, frame.id + separator + frame.frame_nr + '.npz')); uv_unposed_no_shape = uv_unposed_no_shape['uv_unposed_no_shape']
|
||||
item['uv_unposed' + res_string] = uv_unposed_no_shape.astype(np.float32)
|
||||
|
||||
if 'uv_body_posed' + res_string in self.signature:
|
||||
uv_posed_body_no_orient = np.load(os.path.join(self.folder, uv_posed_body_no_orient_folder_name + res_string, frame.id + separator + frame.frame_nr + '.npz'))
|
||||
uv_posed_body_no_orient = uv_posed_body_no_orient['uv_posed_body_no_orient']
|
||||
item['uv_body_posed' + res_string] = uv_posed_body_no_orient.astype(np.float32)
|
||||
|
||||
if 'uv_posed' + res_string in self.signature:
|
||||
uv_posed = np.load(os.path.join(self.folder, 'uv_posed_no_orient' + res_string, frame.id + separator + frame.frame_nr + '.npz')); uv_posed = uv_posed['uv_posed_no_orient']
|
||||
item['uv_posed' + res_string] = uv_posed.astype(np.float32)
|
||||
|
||||
if 'uv_normals' + res_string in self.signature:
|
||||
try:
|
||||
uv_normals = np.load(os.path.join(self.folder, 'uv_normals' + res_string, frame.id + separator + frame.frame_nr + '.npz')); uv_normals = uv_normals['uv_normals']
|
||||
except:
|
||||
print('Warning: uv_normals not found for frame ' + frame.id + separator + frame.frame_nr + '.npz')
|
||||
uv_normals = np.zeros((res, int(res/2), 3), dtype=np.float32)
|
||||
|
||||
item['uv_normals' + res_string] = uv_normals
|
||||
|
||||
|
||||
data = { key: (torch.from_numpy(value) if not (type(value) == str or type(value) == torch.Tensor) else value) for key, value in item.items()}
|
||||
|
||||
for key, value in data.items():
|
||||
if key.startswith('uv_') and (value.shape[-1] == 3 or value.shape[-1] == 7):
|
||||
data[key] = torch.permute(value, [2,0,1])
|
||||
|
||||
if self.cache is not None:
|
||||
self.cache[frame] = data
|
||||
|
||||
data = { key: (value.to(self.device) if type(value) == torch.Tensor else value) for key, value in data.items()}
|
||||
data = { **data, **self.static_cache[frame.id] }
|
||||
return data
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from torch.utils.data import DataLoader
|
||||
|
||||
device = "cuda" if torch.cuda.is_available() else "cpu"
|
||||
|
||||
signature = { 'id',
|
||||
'frame_nr',
|
||||
# 'pose_shape',
|
||||
# 'uv_posed',
|
||||
# 'uv_body_posed',
|
||||
# 'mesh_body_posed',
|
||||
# 'mesh_posed',
|
||||
# 'mesh_unposed',
|
||||
# 'uv_unposed',
|
||||
'uv_normals',
|
||||
# 'mesh_curvature',
|
||||
# 'uv_static',
|
||||
# 'mesh_static',
|
||||
# 'mesh_mask',
|
||||
# 'uv_mask',
|
||||
# 'uv_shaped_body',
|
||||
}
|
||||
|
||||
dataset = DatasetCape('/data-local/127_2/cape_processed/train/female', signature, resolutions=[512, 256, 128, 64], device=device, frames_file=None, is_cape=True)
|
||||
train_dataloader = DataLoader(dataset, batch_size=4, drop_last=True, shuffle=False)
|
||||
|
||||
for i, batch in enumerate(train_dataloader):
|
||||
batch
|
||||
print(i)
|
||||
pass
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# if __name__ == '__main__':
|
||||
# os.environ["CUDA_VISIBLE_DEVICES"] = "6"
|
||||
# from custom_utils.custom_utils import batch_to_dict, UV2Mesh, _maskFaces
|
||||
# import plotly.graph_objects as go
|
||||
# import plotly.express as ex
|
||||
# # import cmapy as cm
|
||||
# uv2mesh = UV2Mesh(is_skirt=True)
|
||||
|
||||
# F = np.load("custom_utils/smpl_faces.npy")
|
||||
|
||||
# sum_uv = np.zeros((512, 256, 3), dtype=np.float32)
|
||||
# sum_mask = np.zeros((512, 256), dtype=np.float32)
|
||||
# for i, batch in enumerate(dataset):
|
||||
# print(i)
|
||||
# batch = static_dataset.expand_batch(batch_to_dict(batch, signature_dynamic))
|
||||
# ex.imshow(batch['uv_curvature'][0].numpy().argmax(-1) / 6.0).show()
|
||||
# sum_uv += batch['uv_unposed'].numpy().sum(axis=0)
|
||||
# sum_mask += batch['uv_mask'].numpy().sum(axis=0)
|
||||
|
||||
# sum_mask[sum_mask == 0] = 1
|
||||
# avg_garment = sum_uv / sum_mask[:, :, np.newaxis]
|
||||
|
||||
# # x = np.transpose(avg_garment, [1,2,0])
|
||||
# x = uv2mesh(avg_garment[tf.newaxis,:,:,:])[0]
|
||||
# go.Figure(data=[
|
||||
# go.Mesh3d(
|
||||
# # 8 vertices of a cube
|
||||
# x=x[:,0],
|
||||
# y=x[:,1],
|
||||
# z=x[:,2],
|
||||
# # i, j and k give the vertices of triangles
|
||||
# i = F[:,0],
|
||||
# j = F[:,1],
|
||||
# k = F[:,2]
|
||||
# )]).show()
|
||||
|
||||
# np.save('custom_data/train_dress_30k_no_shape_avg_uv.npy', avg_garment)
|
||||
|
||||
# print()
|
||||
@@ -0,0 +1,223 @@
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
import tqdm
|
||||
import cv2
|
||||
import torch
|
||||
import scipy.interpolate as spi
|
||||
import numpy as np
|
||||
import plotly.graph_objects as go
|
||||
import plotly.express as ex
|
||||
from torchvision.transforms import Resize
|
||||
from torchvision.transforms.functional import InterpolationMode
|
||||
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = "4"
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
|
||||
from data.utils import Frame
|
||||
|
||||
|
||||
def fill(img, mask):
|
||||
coords = np.transpose(np.stack(np.nonzero((1 - mask))), (1,0))
|
||||
img_idx = np.transpose(np.stack(np.nonzero((mask))), (1,0))
|
||||
img_data = img[img_idx[:,0], img_idx[:,1], :]
|
||||
|
||||
interpolator = spi.NearestNDInterpolator(x=img_idx, y=img_data)
|
||||
# interpolator = spi.RBFInterpolator(y=img_idx, d=img_data, neighbors=5, kernel='linear')
|
||||
|
||||
img_2 = interpolator(coords)
|
||||
res = np.zeros((512,256,3), dtype=np.float32)
|
||||
res[coords[:,0], coords[:,1], :] = img_2
|
||||
res[img_idx[:,0], img_idx[:,1], :] = img_data
|
||||
|
||||
return res
|
||||
|
||||
|
||||
def fill_label(img, mask):
|
||||
coords = np.transpose(np.stack(np.nonzero((1 - mask))), (1,0))
|
||||
img_idx = np.transpose(np.stack(np.nonzero((mask))), (1,0))
|
||||
img_data = img[img_idx[:,0], img_idx[:,1]]
|
||||
|
||||
interpolator = spi.NearestNDInterpolator(x=img_idx, y=img_data)
|
||||
img_2 = interpolator(coords)
|
||||
res = np.zeros((512,256), dtype=np.float32)
|
||||
res[coords[:,0], coords[:,1]] = img_2
|
||||
res[img_idx[:,0], img_idx[:,1]] = img_data
|
||||
|
||||
return res
|
||||
|
||||
|
||||
def generate_downscaled_uv_map(folder, frame: Frame, size):
|
||||
img = np.load(os.path.join(folder, 'uv_mask', f'{frame.id}_{frame.garment}.npz')); img = img['uv_mask'].astype(np.float32)
|
||||
down = resizers_nearest[size](torch.from_numpy(img[None,:,:]).to(device))
|
||||
down = np.squeeze(down.cpu().numpy().astype(bool))
|
||||
if not os.path.exists(os.path.join(folder, 'uv_mask' + '_' + str(size))):
|
||||
os.makedirs(os.path.join(folder, 'uv_mask' + '_' + str(size)), exist_ok=True)
|
||||
np.savez_compressed(os.path.join(folder, 'uv_mask' + '_' + str(size), f'{frame.id}_{frame.garment}.npz'), uv_mask = down)
|
||||
|
||||
|
||||
class UVMaskStore():
|
||||
def __init__(self, folder, size):
|
||||
self.store = dict()
|
||||
self.folder = folder
|
||||
self.size = size
|
||||
|
||||
def read(self, frame: Frame):
|
||||
path = os.path.join(self.folder, 'uv_mask' + ('_' + str(self.size) if self.size != 512 else ''), f'{frame.id}_{frame.garment}.npz')
|
||||
if not os.path.exists(path):
|
||||
generate_downscaled_uv_map(self.folder, frame, self.size)
|
||||
|
||||
mask = np.load(path)
|
||||
mask = mask['uv_mask']
|
||||
return mask
|
||||
|
||||
def __getitem__(self, frame: Frame) -> dict:
|
||||
if (frame.id, frame.garment) not in self.store:
|
||||
self.store[(frame.id, frame.garment)] = self.read(frame)
|
||||
|
||||
return self.store[(frame.id, frame.garment)]
|
||||
|
||||
|
||||
def downscale_uv_maps_posed_body(folder, type, sizes):
|
||||
for size in sizes:
|
||||
os.makedirs(os.path.join(folder, type + str(size)), exist_ok=True)
|
||||
|
||||
frames = sorted(os.listdir(os.path.join(folder, type)))[int(args.start):int(args.end)]
|
||||
frames = [Frame(frame.split('_')[0], frame.split('_')[1].split('.')[0], '') for frame in frames]
|
||||
|
||||
for frame in tqdm.tqdm(frames):
|
||||
img = np.load(os.path.join(folder, type, f'{frame.id}_{frame.frame_nr}.npz'))['uv_body_posed']
|
||||
img = fill(img, uv_masks_body[512])
|
||||
for size in sizes:
|
||||
mask = uv_masks_body[size]
|
||||
down = resizers[size](torch.from_numpy(img.transpose((2,0,1))).to(device)).cpu().numpy()
|
||||
down = down * mask[None,:,:]
|
||||
np.savez_compressed(os.path.join(folder, type + str(size), f'{frame.id}_{frame.frame_nr}.npz'), uv_body_posed = down)
|
||||
|
||||
|
||||
def downscale_uv_maps_posed_no_orient(folder, type, sizes):
|
||||
for size in sizes:
|
||||
os.makedirs(os.path.join(folder, type + '_' + str(size)), exist_ok=True)
|
||||
|
||||
frames = sorted(os.listdir(os.path.join(folder, type)))[int(args.start):int(args.end)]
|
||||
frames = [Frame(frame.split('_')[0], frame.split('_')[1], frame.split('_')[2].split('.')[0]) for frame in frames]
|
||||
|
||||
for frame in tqdm.tqdm(frames):
|
||||
img = np.load(os.path.join(folder, type, f'{frame.id}_{frame.frame_nr}_{frame.garment}.npz'))['uv_posed']
|
||||
img = fill(img, uv_mask_store[512][frame])
|
||||
for size in sizes:
|
||||
mask = uv_mask_store[size][frame]
|
||||
down = resizers[size](torch.from_numpy(img.transpose((2,0,1))).to(device)).cpu().numpy()
|
||||
down = down * mask[None,:,:]
|
||||
np.savez_compressed(os.path.join(folder, type + '_' + str(size), f'{frame.id}_{frame.frame_nr}_{frame.garment}.npz'), uv_posed = down)
|
||||
|
||||
|
||||
def downscale_uv_maps_normals(folder, type, sizes):
|
||||
for size in sizes:
|
||||
os.makedirs(os.path.join(folder, type + '_' + str(size)), exist_ok=True)
|
||||
|
||||
frames = sorted(os.listdir(os.path.join(folder, type)))[int(args.start):int(args.end)]
|
||||
frames = [Frame(frame.split('_')[0], frame.split('_')[1], frame.split('_')[2].split('.')[0]) for frame in frames]
|
||||
|
||||
for frame in tqdm.tqdm(frames):
|
||||
img = np.load(os.path.join(folder, type, f'{frame.id}_{frame.frame_nr}_{frame.garment}.npz'))['uv_normals']
|
||||
img = fill(img, uv_mask_store[512][frame])
|
||||
for size in sizes:
|
||||
mask = uv_mask_store[size][frame]
|
||||
down = resizers[size](torch.from_numpy(img.transpose((2,0,1))).to(device)).cpu().numpy()
|
||||
down = down * mask[None,:,:]
|
||||
np.savez_compressed(os.path.join(folder, type + '_' + str(size), f'{frame.id}_{frame.frame_nr}_{frame.garment}.npz'), uv_normals = down)
|
||||
|
||||
|
||||
def downscale_uv_maps_unposed(folder, type, sizes):
|
||||
for size in sizes:
|
||||
os.makedirs(os.path.join(folder, type + '_' + str(size)), exist_ok=True)
|
||||
|
||||
frames = sorted(os.listdir(os.path.join(folder, type)))[int(args.start):int(args.end)]
|
||||
frames = [Frame(frame.split('_')[0], frame.split('_')[1], frame.split('_')[2].split('.')[0]) for frame in frames]
|
||||
|
||||
for frame in tqdm.tqdm(frames):
|
||||
img = np.load(os.path.join(folder, type, f'{frame.id}_{frame.frame_nr}_{frame.garment}.npz'))['uv_unposed']
|
||||
img = fill(img, uv_mask_store[512][frame])
|
||||
for size in sizes:
|
||||
mask = uv_mask_store[size][frame]
|
||||
down = resizers[size](torch.from_numpy(img.transpose((2,0,1))).to(device)).cpu().numpy()
|
||||
down = down * mask[None,:,:]
|
||||
np.savez_compressed(os.path.join(folder, type + '_' + str(size), f'{frame.id}_{frame.frame_nr}_{frame.garment}.npz'), uv_unposed = down)
|
||||
|
||||
|
||||
def downscale_uv_maps_static(folder, type, sizes):
|
||||
for size in sizes:
|
||||
os.makedirs(os.path.join(folder, type + '_' + str(size)), exist_ok=True)
|
||||
|
||||
frames = sorted(os.listdir(os.path.join(folder, type)))
|
||||
import random
|
||||
random.shuffle(frames)
|
||||
frames = [(frame.split('_')[0], frame.split('_')[1].split('.')[0]) for frame in frames]
|
||||
|
||||
for frame in tqdm.tqdm(frames):
|
||||
img = np.load(os.path.join(folder, type, f'{frame[0]}_{frame[1]}.npz'))['uv_static']
|
||||
img = fill(img, uv_mask_store[512][Frame(frame[0], 0, frame[1])])
|
||||
for size in sizes:
|
||||
mask = uv_mask_store[size][Frame(frame[0], 0, frame[1])]
|
||||
down = resizers[size](torch.from_numpy(img.transpose((2,0,1))).to(device)).cpu().numpy()
|
||||
down = down * mask[None,:,:]
|
||||
np.savez_compressed(os.path.join(folder, type + '_' + str(size), f'{frame[0]}_{frame[1]}.npz'), uv_static = down)
|
||||
|
||||
|
||||
def downscale_uv_maps_mask(folder, type, size):
|
||||
os.makedirs(os.path.join(folder, type + '_' + str(size)), exist_ok=True)
|
||||
|
||||
frames = sorted(os.listdir(os.path.join(folder, type)))[int(args.start):int(args.end)]
|
||||
|
||||
for frame in tqdm.tqdm(frames):
|
||||
id, _ = frame.split('.')
|
||||
img = np.load(os.path.join(folder, type, frame)); img = img['uv_mask'].astype(np.float32)
|
||||
down = tf.image.resize(img[:,:,tf.newaxis], size=(size, int(size/2)), method=tf.image.ResizeMethod.NEAREST_NEIGHBOR)
|
||||
down = np.squeeze(down.numpy().astype(bool))
|
||||
np.savez_compressed(os.path.join(folder, type + '_' + str(size), frame), uv_mask = down)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
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=0)
|
||||
parser.add_argument("-e", "--end", help = "end of range", default=25000)
|
||||
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()
|
||||
|
||||
# sizes = [32, 64, 128, 256]
|
||||
device = 'cuda'
|
||||
sizes = [32, 64, 128, 256]
|
||||
folder = args.folder
|
||||
resizers = { res: Resize(size=(res, int(res/2)), interpolation=InterpolationMode.BICUBIC).to(device) for res in sizes }
|
||||
resizers_nearest = { res: Resize(size=(res, int(res/2)), interpolation=InterpolationMode.NEAREST_EXACT).to(device) for res in sizes }
|
||||
|
||||
uv_masks_body = dict()
|
||||
uv_mask_body = np.load('custom_utils/mask_256x512.npy')
|
||||
uv_mask_body = cv2.dilate(uv_mask_body.astype(np.float32), cv2.getStructuringElement(cv2.MORPH_RECT, (2 * 2 + 1, 2 * 2 + 1), (2, 2)), iterations=2)
|
||||
uv_masks_body[512] = uv_mask_body.astype(bool)
|
||||
for res in [32, 64, 128, 256]:
|
||||
down = resizers_nearest[res](torch.from_numpy(uv_mask_body[None,:,:].astype(np.int32)).to(device))
|
||||
down = np.squeeze(down.cpu().numpy().astype(bool))
|
||||
uv_masks_body[res] = down
|
||||
|
||||
|
||||
uv_mask_store = { size: UVMaskStore(folder, size=size) for size in sizes }
|
||||
uv_mask_store[512] = UVMaskStore(folder, size=512)
|
||||
|
||||
# downscale_uv_maps_mask(folder=folder, type='uv_mask', size=32)
|
||||
# downscale_uv_maps_mask(folder=folder, type='uv_mask', size=64)
|
||||
# downscale_uv_maps_mask(folder=folder, type='uv_mask', size=128)
|
||||
# downscale_uv_maps_mask(folder=folder, type='uv_mask', size=256)
|
||||
# downscale_uv_maps_static(folder=folder, type='uv_static', sizes=sizes)
|
||||
|
||||
downscale_uv_maps_unposed(folder=folder, type='uv_unposed_no_shape', sizes=sizes)
|
||||
downscale_uv_maps_posed_no_orient(folder=folder, type='uv_posed_no_orient', sizes=sizes)
|
||||
downscale_uv_maps_normals(folder=folder, type='uv_normals', sizes=sizes)
|
||||
downscale_uv_maps_posed_body(folder=folder, type='uv_body_posed_no_orient', sizes=sizes)
|
||||
|
||||
|
||||
print()
|
||||
@@ -0,0 +1,207 @@
|
||||
import argparse
|
||||
import os
|
||||
import tqdm
|
||||
import cv2
|
||||
import scipy.interpolate as spi
|
||||
import numpy as np
|
||||
import plotly.graph_objects as go
|
||||
import plotly.express as ex
|
||||
import torch
|
||||
from torchvision.transforms import Resize
|
||||
from torchvision.transforms.functional import InterpolationMode
|
||||
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
|
||||
|
||||
|
||||
def get_img_idxs():
|
||||
img_idxs = dict()
|
||||
img_coords = dict()
|
||||
uv_masks = dict()
|
||||
uv_mask = np.load('custom_data/garment_uv_mask_full.npy')
|
||||
coords = np.transpose(np.stack(np.nonzero((1 - uv_mask))), (1,0))
|
||||
img_idx = np.transpose(np.stack(np.nonzero((uv_mask))), (1,0))
|
||||
img_idxs[512] = img_idx
|
||||
img_coords[512] = coords
|
||||
uv_masks[512] = uv_mask.astype(np.int32)
|
||||
for res in [32, 64, 128, 256]:
|
||||
down = resizers_nearest[res](torch.from_numpy(uv_mask[None,:,:]).to(device)).cpu().numpy()
|
||||
down = np.squeeze(down.astype(bool))
|
||||
coords = np.transpose(np.stack(np.nonzero((1 - down))), (1,0))
|
||||
img_idx = np.transpose(np.stack(np.nonzero((down))), (1,0))
|
||||
img_idxs[res] = img_idx
|
||||
img_coords[res] = coords
|
||||
uv_masks[res] = down.astype(np.int32)
|
||||
|
||||
|
||||
uv_masks_body = dict()
|
||||
uv_mask_body = np.load('custom_utils/mask_256x512.npy')
|
||||
uv_mask_body = cv2.dilate(uv_mask_body.astype(np.float32), cv2.getStructuringElement(cv2.MORPH_RECT, (2 * 2 + 1, 2 * 2 + 1), (2, 2)), iterations=2)
|
||||
uv_masks_body[512] = uv_mask_body
|
||||
for res in [32, 64, 128, 256]:
|
||||
down = resizers_nearest[res](torch.from_numpy(uv_mask_body[None,:,:]).to(device)).cpu().numpy()
|
||||
down = np.squeeze(down.astype(bool))
|
||||
uv_masks_body[res] = down
|
||||
|
||||
return img_idxs, img_coords, uv_masks, uv_masks_body
|
||||
|
||||
|
||||
def fill(img, mask):
|
||||
coords = img_coords[img.shape[0]]
|
||||
img_idx = img_idxs[img.shape[0]]
|
||||
# coords = np.transpose(np.stack(np.nonzero((1 - uv_masks[img.shape[0]]))), (1,0))
|
||||
# img_idx = np.transpose(np.stack(np.nonzero((uv_masks[img.shape[0]]))), (1,0))
|
||||
img_data = img[img_idx[:,0], img_idx[:,1], :]
|
||||
|
||||
interpolator = spi.NearestNDInterpolator(x=img_idx, y=img_data)
|
||||
img_2 = interpolator(coords)
|
||||
res = np.zeros((512,256,3), dtype=np.float32)
|
||||
res[coords[:,0], coords[:,1], :] = img_2
|
||||
res[img_idx[:,0], img_idx[:,1], :] = img_data
|
||||
|
||||
return res
|
||||
|
||||
|
||||
def fill_label(img, mask):
|
||||
coords = img_coords[img.shape[0]]
|
||||
img_idx = img_idxs[img.shape[0]]
|
||||
img_data = img[img_idx[:,0], img_idx[:,1]]
|
||||
|
||||
interpolator = spi.NearestNDInterpolator(x=img_idx, y=img_data)
|
||||
img_2 = interpolator(coords)
|
||||
res = np.zeros((512,256), dtype=np.float32)
|
||||
res[coords[:,0], coords[:,1]] = img_2
|
||||
res[img_idx[:,0], img_idx[:,1]] = img_data
|
||||
|
||||
return res
|
||||
|
||||
|
||||
def generate_downscaled_uv_map(folder, id, size):
|
||||
img = np.load(os.path.join(folder, 'uv_mask', id + '.npz')); img = img['uv_mask'].astype(np.float32)
|
||||
down = tf.image.resize(img[:,:,tf.newaxis], size=(size, int(size/2)), method=tf.image.ResizeMethod.NEAREST_NEIGHBOR)
|
||||
down = np.squeeze(down.numpy().astype(bool))
|
||||
np.savez_compressed(os.path.join(folder, 'uv_mask' + '_' + str(size), id + '.npz'), uv_mask = down)
|
||||
|
||||
|
||||
class UVMaskStore():
|
||||
def __init__(self, folder, size):
|
||||
self.size = size
|
||||
|
||||
def __getitem__(self, id) -> dict:
|
||||
return uv_masks[self.size]
|
||||
|
||||
|
||||
def downscale_uv_maps_posed_body(folder, type, sizes):
|
||||
for size in sizes:
|
||||
os.makedirs(os.path.join(folder, type + '_' + str(size)), exist_ok=True)
|
||||
|
||||
frames = os.listdir(os.path.join(folder, type))[int(args.start):int(args.end)]
|
||||
|
||||
for frame in tqdm.tqdm(frames):
|
||||
img = np.load(os.path.join(folder, type, frame)); img = img['uv_posed_body_no_orient']
|
||||
img = fill(img, uv_masks_body[512])
|
||||
for size in sizes:
|
||||
mask = uv_masks_body[size]
|
||||
down = resizers[size](torch.from_numpy(img.transpose((2,0,1))).to(device)).cpu().numpy()
|
||||
down = down * mask[None,:,:]
|
||||
np.savez_compressed(os.path.join(folder, type + '_' + str(size), frame), uv_posed_body_no_orient = down)
|
||||
|
||||
|
||||
def downscale_uv_normals(folder, type, sizes):
|
||||
for size in sizes:
|
||||
os.makedirs(os.path.join(folder, type + '_' + str(size)), exist_ok=True)
|
||||
|
||||
frames = os.listdir(os.path.join(folder, type))[int(args.start):int(args.end)]
|
||||
|
||||
for frame in tqdm.tqdm(frames):
|
||||
img = np.load(os.path.join(folder, type, frame)); img = img['uv_normals']
|
||||
img = fill(img, uv_masks_body[512])
|
||||
for size in sizes:
|
||||
mask = uv_masks_body[size]
|
||||
down = resizers[size](torch.from_numpy(img.transpose((2,0,1))).to(device)).cpu().numpy()
|
||||
down = down * mask[None,:,:]
|
||||
np.savez_compressed(os.path.join(folder, type + '_' + str(size), frame), uv_normals = down)
|
||||
|
||||
|
||||
|
||||
def downscale_uv_maps_unposed(folder, type, sizes):
|
||||
for size in sizes:
|
||||
os.makedirs(os.path.join(folder, type + '_' + str(size)), exist_ok=True)
|
||||
|
||||
frames = os.listdir(os.path.join(folder, type))[int(args.start):int(args.end)]
|
||||
|
||||
for frame in tqdm.tqdm(frames):
|
||||
img = np.load(os.path.join(folder, type, frame)); img = img['uv_unposed_no_shape']
|
||||
mask_full = uv_mask_store[512][None]
|
||||
img = fill(img, mask_full)
|
||||
for size in sizes:
|
||||
mask = uv_mask_store[size][None]
|
||||
down = resizers[size](torch.from_numpy(img.transpose((2,0,1))).to(device)).cpu().numpy()
|
||||
down = down * mask[None,:,:]
|
||||
np.savez_compressed(os.path.join(folder, type + '_' + str(size), frame), uv_unposed_no_shape = down)
|
||||
|
||||
|
||||
def downscale_uv_maps_static(folder, type, sizes):
|
||||
for size in sizes:
|
||||
os.makedirs(os.path.join(folder, type + '_' + str(size)), exist_ok=True)
|
||||
|
||||
frames = os.listdir(os.path.join(folder, type))[int(args.start):int(args.end)]
|
||||
|
||||
for frame in tqdm.tqdm(frames):
|
||||
img = np.load(os.path.join(folder, type, frame)); img = img['uv_static']
|
||||
mask_full = uv_mask_store[512][None]
|
||||
img = fill(img, mask_full)
|
||||
|
||||
for size in sizes:
|
||||
down = resizers[size](torch.from_numpy(img.transpose((2,0,1))).to(device)).cpu().numpy()
|
||||
mask = uv_mask_store[size][None]
|
||||
down = down * mask[None,:,:]
|
||||
np.savez_compressed(os.path.join(folder, type + '_' + str(size), frame), uv_static = down)
|
||||
|
||||
|
||||
def downscale_uv_maps_mask(folder, type, size):
|
||||
os.makedirs(os.path.join(folder, type + '_' + str(size)), exist_ok=True)
|
||||
|
||||
frames = os.listdir(os.path.join(folder, type))[int(args.start):int(args.end)]
|
||||
|
||||
for frame in tqdm.tqdm(frames):
|
||||
img = np.load(os.path.join(folder, type, frame)); img = img['uv_mask'].astype(np.float32)
|
||||
down = tf.image.resize(img[:,:,tf.newaxis], size=(size, int(size/2)), method=tf.image.ResizeMethod.NEAREST_NEIGHBOR)
|
||||
down = np.squeeze(down.numpy().astype(bool))
|
||||
np.savez_compressed(os.path.join(folder, type + '_' + str(size), frame), uv_mask = down)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-f", "--folder", help = "end of range", default='/data-local/127_2/cape_processed/train/male')
|
||||
parser.add_argument("-s", "--start", help = "start of range", default=0)
|
||||
parser.add_argument("-e", "--end", help = "end of range", default=100000)
|
||||
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()
|
||||
|
||||
device = 'cuda'
|
||||
|
||||
sizes = [32, 64, 128, 256]
|
||||
folder = args.folder
|
||||
|
||||
resizers = { res: Resize(size=(res, int(res/2)), interpolation=InterpolationMode.BICUBIC).to(device) for res in sizes }
|
||||
resizers_nearest = { res: Resize(size=(res, int(res/2)), interpolation=InterpolationMode.NEAREST_EXACT).to(device) for res in sizes }
|
||||
|
||||
img_idxs, img_coords, uv_masks, uv_masks_body = get_img_idxs()
|
||||
|
||||
uv_mask_store = { size: UVMaskStore(folder, size=size) for size in sizes }
|
||||
uv_mask_store[512] = UVMaskStore(folder, size=512)
|
||||
|
||||
# downscale_uv_maps_mask(folder=folder, type='uv_mask', size=32)
|
||||
# downscale_uv_maps_mask(folder=folder, type='uv_mask', size=64)
|
||||
# downscale_uv_maps_mask(folder=folder, type='uv_mask', size=128)
|
||||
# downscale_uv_maps_mask(folder=folder, type='uv_mask', size=256)
|
||||
# downscale_uv_maps_static(folder=folder, type='uv_static', sizes=sizes)
|
||||
|
||||
downscale_uv_maps_unposed(folder=folder, type='uv_unposed_no_shape', sizes=sizes)
|
||||
downscale_uv_normals(folder=folder, type='uv_normals', sizes=sizes)
|
||||
downscale_uv_maps_posed_body(folder=folder, type='uv_posed_body_no_orient', sizes=sizes)
|
||||
|
||||
|
||||
print()
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user