├── .gitignore ├── .gitmodules ├── LICENSE ├── PATH ├── README.md ├── asset │ ├── DATA.md │ ├── INSTALL.md │ ├── README.md │ ├── performance.jpg │ ├── pretrain_dataset.jpg │ └── teaser.png ├── core │ ├── __init__.py │ ├── augmentation.py │ ├── augmentation_pos.py │ ├── clipping.py │ ├── config.py │ ├── data │ │ ├── datasets │ │ │ ├── __init__.py │ │ │ └── images │ │ │ │ ├── image_helper.py │ │ │ │ ├── multi_posedataset.py │ │ │ │ ├── parsing_dataset.py │ │ │ │ ├── pedattr_dataset.py │ │ │ │ ├── peddet_dataset.py │ │ │ │ ├── peddet_dataset_dev.py │ │ │ │ ├── pos_dataset.py │ │ │ │ ├── pos_dataset_dev.py │ │ │ │ ├── reid_dataset.py │ │ │ │ ├── resources │ │ │ │ ├── CHval.odgt │ │ │ │ └── COCO_val2017_detections_AP_H_56_person.json │ │ │ │ ├── seg_data_tools │ │ │ │ ├── __init__.py │ │ │ │ ├── collate.py │ │ │ │ ├── cv2_aug_transforms.py │ │ │ │ └── transforms.py │ │ │ │ └── seg_dataset_dev.py │ │ ├── test_datasets │ │ │ ├── __init__.py │ │ │ └── images │ │ │ │ └── reid_dataset.py │ │ └── transforms │ │ │ ├── parsing_transforms.py │ │ │ ├── pedattr_transforms.py │ │ │ ├── peddet_transforms.py │ │ │ ├── peddet_transforms_helpers │ │ │ ├── __init__.py │ │ │ └── transforms.py │ │ │ ├── pose_transforms.py │ │ │ ├── post_transforms.py │ │ │ ├── reid_transforms.py │ │ │ ├── seg_aug_dev.py │ │ │ ├── seg_transforms_dev.py │ │ │ └── sparsercnn_peddet_transforms_helpers │ │ │ ├── __init__.py │ │ │ ├── augmentation.py │ │ │ ├── augmentation_impl.py │ │ │ └── transforms.py │ ├── distributed_utils.py │ ├── exceptions.py │ ├── fp16 │ │ ├── __init__.py │ │ ├── amp.py │ │ ├── opt.py │ │ ├── scaler.py │ │ ├── utils.py │ │ └── wrap.py │ ├── lr_scheduler │ │ ├── __init__.py │ │ └── base.py │ ├── make_param_group.py │ ├── memory.py │ ├── models │ │ ├── __init__.py │ │ ├── backbones │ │ │ ├── __init__.py │ │ │ ├── vit.py │ │ │ ├── vitdet.py │ │ │ ├── vitdet_for_ladder_attention.py │ │ │ └── vitdet_for_ladder_attention_share_pos_embed.py │ │ ├── ckpt.py │ │ ├── decoders │ │ │ ├── __init__.py │ │ │ ├── classification_decoders │ │ │ │ ├── pedattr_decoders.py │ │ │ │ └── reid_decoders.py │ │ │ ├── losses │ │ │ │ ├── __init__.py │ │ │ │ ├── classification_losses.py │ │ │ │ ├── criterion.py │ │ │ │ ├── matcher.py │ │ │ │ ├── pedattr_losses.py │ │ │ │ ├── peddet_losses.py │ │ │ │ ├── point_features.py │ │ │ │ ├── pos_losses.py │ │ │ │ ├── seg_losses.py │ │ │ │ └── test_time.py │ │ │ ├── peddet_decoders │ │ │ │ ├── __init__.py │ │ │ │ ├── aio_head.py │ │ │ │ ├── mask2former_transformer_decoder.py │ │ │ │ └── position_encoding.py │ │ │ ├── pose_decodes │ │ │ │ ├── __init__.py │ │ │ │ ├── pose_decoder.py │ │ │ │ └── pose_utils.py │ │ │ └── seg_decoders │ │ │ │ ├── module_helper.py │ │ │ │ ├── seg_decoders.py │ │ │ │ └── spatial_ocr_block.py │ │ ├── model_entry.py │ │ ├── necks │ │ │ ├── DoNothing.py │ │ │ ├── __init__.py │ │ │ ├── attention.py │ │ │ ├── ladder_side_attention_fpn.py │ │ │ └── simple_fpn.py │ │ ├── ops │ │ │ ├── __init__.py │ │ │ ├── box_ops.py │ │ │ ├── boxes.py │ │ │ ├── conv2d_helpers.py │ │ │ ├── hrt_helpers │ │ │ │ ├── __init___.py │ │ │ │ ├── basic_block.py │ │ │ │ ├── bottleneck_block.py │ │ │ │ ├── ffn_block.py │ │ │ │ ├── multihead_attention.py │ │ │ │ ├── multihead_isa_attention.py │ │ │ │ └── transformer_block.py │ │ │ ├── normalization_helpers.py │ │ │ └── utils.py │ │ └── tta.py │ ├── msg_server.py │ ├── optim.py │ ├── optimizers │ │ ├── __init__.py │ │ ├── adafactor.py │ │ ├── adam_clip.py │ │ └── lars.py │ ├── solvers │ │ ├── __init__.py │ │ ├── solver.py │ │ ├── solver_deter.py │ │ ├── solver_multitask_dev.py │ │ └── utils │ │ │ ├── __init__.py │ │ │ ├── attr_tester_dev.py │ │ │ ├── detools │ │ │ └── box.py │ │ │ ├── nms.py │ │ │ ├── par_tester_dev.py │ │ │ ├── peddet_tester_dev.py │ │ │ ├── pos_tester_dev.py │ │ │ ├── reid_tester_dev.py │ │ │ └── seg_tester_dev.py │ ├── testers │ │ ├── __init__.py │ │ ├── reid_tester.py │ │ ├── tester.py │ │ ├── tester_deter.py │ │ └── utils │ │ │ ├── __init__.py │ │ │ ├── metrics.py │ │ │ └── reranking.py │ └── utils.py ├── experiments │ ├── L2_full_setting_joint_v100_32g │ │ ├── finetune │ │ │ ├── attr │ │ │ │ ├── eval_logs │ │ │ │ │ ├── pa100k_vitbase_SGD_lr1e2x1_stepLRx2_wd5e4_backboneclip_dpr03_30ep__SmallSetting___LSA_10p_small_setting1.log_20220926_112930 │ │ │ │ │ ├── pa100k_vitbase_SGD_lr1e2x1_stepLRx2_wd5e4_backboneclip_dpr03_30ep__SmallSetting___LSA_10p_small_setting4_add_DGMarket.log_20220926_120328 │ │ │ │ │ ├── peta_vitbase_SGD_lr1e2x1_stepLRx2_wd1e4_dpr01_80ep__SmallSetting___LSA_10p_small_setting1.log_20220926_111916 │ │ │ │ │ ├── peta_vitbase_SGD_lr1e2x1_stepLRx2_wd1e4_dpr01_80ep__SmallSetting___LSA_10p_small_setting1.log_20220926_112926 │ │ │ │ │ └── peta_vitbase_SGD_lr1e2x1_stepLRx2_wd1e4_dpr01_80ep__SmallSetting___LSA_10p_small_setting2_add_posetrack.log_20220926_114030 │ │ │ │ ├── logs │ │ │ │ │ └── peta_vitbase_SGD_lr1e2x1_stepLRx2_wd1e4_dpr01_80ep__SmallSetting___LSA_10p_small_setting2_add_posetrack.log_20220925_222558 │ │ │ │ ├── pa100k_train.sh │ │ │ │ ├── pa100k_vitbase_SGD_lr1e2x1_stepLRx2_wd5e4_backboneclip_dpr03_30ep.yaml │ │ │ │ ├── pedattr_pa100k_test.sh │ │ │ │ ├── pedattr_pa100k_test.yaml │ │ │ │ ├── pedattr_peta_test.sh │ │ │ │ ├── pedattr_peta_test.yaml │ │ │ │ ├── peta_train.sh │ │ │ │ └── peta_vitbase_SGD_lr1e2x1_stepLRx2_wd1e4_dpr01_80ep.yaml │ │ │ ├── parsing │ │ │ │ ├── ATR_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep.yaml │ │ │ │ ├── ATR_test.sh │ │ │ │ ├── ATR_test.yaml │ │ │ │ ├── ATR_train.sh │ │ │ │ ├── CIHP_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep.yaml │ │ │ │ ├── CIHP_test.sh │ │ │ │ ├── CIHP_test.yaml │ │ │ │ ├── CIHP_train.sh │ │ │ │ ├── h36m_FT_vitbase_pos_embed_b4_lr5e4x08_backboneclip_wd01_cosineLR_ld75_dpr03_sz480_10ep.yaml │ │ │ │ ├── h36m_parsing_eval_logs │ │ │ │ │ ├── test_h36m_FT_vitbase_pos_embed_b4_lr5e4x08_backboneclip_wd01_cosineLR_ld75_dpr03_sz480_10ep__MAE.log_20220926_113804 │ │ │ │ │ ├── test_h36m_FT_vitbase_pos_embed_b4_lr5e4x08_backboneclip_wd01_cosineLR_ld75_dpr03_sz480_10ep___SmallSetting___LSA_10p_small_setting4_add_DGMarket.log_20220926_103013 │ │ │ │ │ ├── test_h36m_FT_vitbase_pos_embed_b4_lr5e4x08_backboneclip_wd01_cosineLR_ld75_dpr03_sz480_10ep___SmallSetting___LSA_10p_small_setting5_add_posetrack_DGMarket.log_20220928_101304 │ │ │ │ │ └── test_h36m_FT_vitbase_pos_embed_b4_lr5e4x08_backboneclip_wd01_cosineLR_ld75_dpr03_sz480_10ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion.log_20220928_101528 │ │ │ │ ├── h36m_test.sh │ │ │ │ ├── h36m_test.yaml │ │ │ │ ├── h36m_train.sh │ │ │ │ └── logs │ │ │ │ │ ├── ATR_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep__SmallSetting___LSA_10p_small_setting1.log_20220925_135531 │ │ │ │ │ ├── ATR_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep__SmallSetting___LSA_10p_small_setting1.log_20220925_135845 │ │ │ │ │ └── CIHP_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep__SmallSetting___LSA_10p_small_setting1.log_20220925_135536 │ │ │ ├── pose │ │ │ │ ├── coco_pose_eval_logs │ │ │ │ │ ├── coco_pose_lr5e4x08_wd01_backbonebclip_layerdecay_stepLR_classichead_dpr3e1_wowin_LN_udp_50ep__MAE.log_20220926_103753 │ │ │ │ │ ├── coco_pose_lr5e4x08_wd01_backbonebclip_layerdecay_stepLR_classichead_dpr3e1_wowin_LN_udp_50ep___SmallSetting___LSA_10p_small_setting4_add_DGMarket.log_20220926_102711 │ │ │ │ │ └── coco_pose_lr5e4x08_wd01_backbonebclip_layerdecay_stepLR_classichead_dpr3e1_wowin_LN_udp_50ep___SmallSetting___LSA_10p_small_setting4_add_DGMarket.log_20220926_103231 │ │ │ │ ├── coco_pose_lr5e4x08_wd01_backbonebclip_layerdecay_stepLR_classichead_dpr3e1_wowin_LN_udp_50ep.yaml │ │ │ │ ├── coco_pose_test.sh │ │ │ │ ├── coco_pose_test.yaml │ │ │ │ ├── coco_pose_train.sh │ │ │ │ ├── logs │ │ │ │ │ ├── coco_pose_lr5e4x08_wd01_backbonebclip_layerdecay_stepLR_classichead_dpr3e1_wowin_LN_udp_50ep__SmallSetting___LSA_10p_small_setting1.log_20220925_162519 │ │ │ │ │ ├── coco_pose_lr5e4x08_wd01_backbonebclip_layerdecay_stepLR_classichead_dpr3e1_wowin_LN_udp_50ep__SmallSetting___LSA_10p_small_setting1.log_20220925_162614 │ │ │ │ │ ├── coco_pose_lr5e4x08_wd01_backbonebclip_layerdecay_stepLR_classichead_dpr3e1_wowin_LN_udp_50ep___SmallSetting___LSA_10p_small_setting4_add_DGMarket.log_20220926_100430 │ │ │ │ │ └── coco_pose_lr5e4x08_wd01_backbonebclip_layerdecay_stepLR_classichead_dpr3e1_wowin_LN_udp_50ep___SmallSetting___LSA_10p_small_setting4_add_DGMarket.log_20220926_101104 │ │ │ │ ├── mpii_pose_eval_logs │ │ │ │ │ └── test_mpii_pose_lr5e4x08_wd01_backboneclip_stepLR_classichead_dpr3e1_LN_udp_50ep__MAE.log_20220926_103610 │ │ │ │ ├── mpii_pose_lr5e4x08_wd01_backboneclip_stepLR_classichead_dpr3e1_LN_udp_50ep.yaml │ │ │ │ ├── mpii_pose_test.sh │ │ │ │ ├── mpii_pose_test.yaml │ │ │ │ └── mpii_pose_train.sh │ │ │ └── reid │ │ │ │ ├── reid_market1501_test.sh │ │ │ │ ├── reid_market1501_test.yaml │ │ │ │ ├── reid_train.sh │ │ │ │ └── vit_base_b32_lr5e4x05_wd03_trained_pose_embed_cosineLR_ld75_dpr0_5set_30kiters.yaml │ │ ├── scripts │ │ │ ├── ckpt_trans.py │ │ │ ├── ckpt_trans_with_cls_token.py │ │ │ └── dataset_specific_sample_weight.py │ │ ├── task_info.md │ │ ├── test │ │ │ ├── parsing_CIHP_eval_logs │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_162518 │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_162601 │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_162839 │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_194533 │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_095242 │ │ │ │ └── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_095626 │ │ │ ├── parsing_human36_eval_logs │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_162714 │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_162849 │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_194537 │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_095250 │ │ │ │ └── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_095627 │ │ │ ├── parsing_test_CIHP.sh │ │ │ ├── parsing_test_CIHP.yaml │ │ │ ├── parsing_test_LIP.sh │ │ │ ├── parsing_test_LIP.yaml │ │ │ ├── parsing_test_human36.sh │ │ │ ├── parsing_test_human36.yaml │ │ │ ├── pedattr_pa100k_test.sh │ │ │ ├── pedattr_pa100k_test.yaml │ │ │ ├── peddet_crowdhuman_eval_logs │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_194542 │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_095257 │ │ │ │ └── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_095632 │ │ │ ├── peddet_crowdhuman_test.sh │ │ │ ├── peddet_crowdhuman_test.yaml │ │ │ ├── pose_coco_eval_logs │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_163141 │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_163707 │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_164531 │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_164809 │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_164933 │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_194538 │ │ │ │ ├── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_095252 │ │ │ │ └── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_095629 │ │ │ ├── pose_test_coco.sh │ │ │ ├── pose_test_coco.yaml │ │ │ ├── reid_eval_logs │ │ │ │ ├── test_v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_164258 │ │ │ │ ├── test_v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_164554 │ │ │ │ ├── test_v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_194540 │ │ │ │ ├── test_v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_095255 │ │ │ │ ├── test_v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_095630 │ │ │ │ ├── test_v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_100650 │ │ │ │ ├── test_v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_100831 │ │ │ │ └── test_v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_101036 │ │ │ ├── reid_test_MSMT.sh │ │ │ ├── reid_test_MSMT.yaml │ │ │ ├── reid_test_cuhk03.sh │ │ │ ├── reid_test_cuhk03.yaml │ │ │ ├── reid_test_duke.sh │ │ │ ├── reid_test_duke.yaml │ │ │ ├── reid_test_market.sh │ │ │ └── reid_test_market.yaml │ │ ├── train.sh │ │ └── v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml │ ├── L2_full_setting_vit_large_a100_80g │ │ ├── scripts │ │ │ ├── ckpt_trans.py │ │ │ └── dataset_specific_sample_weight.py │ │ ├── task_info.md │ │ ├── train.sh │ │ └── vitlarge_size480_lr1e3_stepLRx3_bmp1_adafactor_wd01_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml │ ├── evaluation │ │ ├── attr │ │ │ ├── full_finetune │ │ │ │ ├── pa100k_vitbase_b64_SGD_lr1e2x05_stepLRx2_wd5e4_backboneclip_dpr03_DecoderWd0_30ep.yaml │ │ │ │ ├── peta_vitbase_b64_adafactor_lr1e3x05_stepLRx2_wd5e4_dpr01_80ep.yaml │ │ │ │ └── rap2_vitbase_b64_SGD_lr1e2x1_stepLRx2_wd5e4_dpr02_35ep.yaml │ │ │ ├── head_finetune │ │ │ │ ├── pa100k_vitbase_b64_SGD_lr1e1_stepLRx2_backboneclip_dpr03_30ep_FixBackbone.yaml │ │ │ │ ├── peta_vitbase_b64_adafactor_lr1e1_stepLRx2_wd5e4_dpr01_80ep_FixBackbone.yaml │ │ │ │ └── rap2_vitbase_b64_SGD_lr1e2x1_stepLRx2_dpr01_35ep_FixBackbone.yaml │ │ │ └── partial_finetune │ │ │ │ ├── pa100k_vitbase_b64_SGD_lr1e2_stepLRx2_wd0_backboneclip_dpr01_30ep_PartialFT_OpenLast2_OpenNorm.yaml │ │ │ │ ├── peta_vitbase_b64_adafactor_lr1e3_stepLRx2_wd0_dpr01_80ep_PartialFT_OpenLast2_OpenNorm.yaml │ │ │ │ └── rap2_vitbase_b64_SGD_lr1e2x1_stepLRx2_wd0_dpr01_35ep_PartialFT_OpenLast2_OpenNorm.yaml │ │ └── peddet │ │ │ ├── full_finetune │ │ │ ├── Caltech_size224_adafactor_lr5e4_blr01_freezepe_cosinLR_dpr02_decoder_zero_wd_240ep.yaml │ │ │ └── crowdhuman_size224_adafactor_lr5e4_blr05_freezepe_cosinLR_dpr02_DecoderWd1e3_100ep.yaml │ │ │ ├── head_finetune │ │ │ ├── Caltech_size224_adafactor_lr5e4_blr05_freezepe_cosinLR_dpr02_240ep_FixBackbone.yaml │ │ │ └── crowdhuman_size224_adafactor_lr5e4_blr05_freezepe_cosinLR_dpr02_100ep_FixBackbone.yaml │ │ │ └── partial_finetune │ │ │ ├── Caltech_size224_adafactor_lr5e4_blr01_freezepe_cosinLR_dpr02_240ep_PartialFT_OpenLast2.yaml │ │ │ └── crowdhuman_size224_adafactor_lr5e4_blr05_freezepe_cosinLR_dpr02_100ep_PartialFT_Open_Last8_PosEmbed_Norm.yaml │ └── release_debug │ │ ├── parsing_debug.yaml │ │ ├── pedattr_debug.yaml │ │ ├── peddet_debug.yaml │ │ ├── pose_debug.yaml │ │ ├── reid_debug.yaml │ │ └── train.sh ├── helper │ ├── align.py │ ├── flops_helper.py │ ├── multitask_schedule.py │ ├── param_count.py │ └── vis_helper.py ├── multitask.py ├── requirements.txt └── test.py ├── README.md └── asset ├── .DS_Store ├── cover.png └── teaser.jpg /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "UniHCP"] 2 | path = UniHCP 3 | url = git@github.com:OpenGVLab/UniHCP.git 4 | [submodule "Hulk"] 5 | path = Hulk 6 | url = https://github.com/OpenGVLab/Hulk.git 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 OpenGVLab 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /PATH/asset/INSTALL.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | ### Requirements 4 | * Linux, CUDA>=9.2, GCC>=5.4 5 | * PyTorch >= 1.8.1 6 | * Other requirements 7 | ```bash 8 | pip install -r requirements.txt 9 | ``` 10 | 11 | ### Setup for COCO Pose Estimation Evalutaion 12 | 13 | Install [mmpose](https://github.com/open-mmlab/mmpose) following the instructions in [here](https://mmpose.readthedocs.io/en/v0.29.0/install.html). 14 | Or simply use the following command. 15 | 16 | ```bash 17 | git clone https://github.com/open-mmlab/mmpose.git 18 | cd mmpose 19 | pip install -r requirements.txt 20 | pip install -v -e . 21 | ``` 22 | -------------------------------------------------------------------------------- /PATH/asset/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /PATH/asset/performance.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/PATH/asset/performance.jpg -------------------------------------------------------------------------------- /PATH/asset/pretrain_dataset.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/PATH/asset/pretrain_dataset.jpg -------------------------------------------------------------------------------- /PATH/asset/teaser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/PATH/asset/teaser.png -------------------------------------------------------------------------------- /PATH/core/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/PATH/core/__init__.py -------------------------------------------------------------------------------- /PATH/core/clipping.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | import numpy as np 4 | import torch 5 | from core import distributed_utils as dist 6 | 7 | from easydict import EasyDict as edict 8 | 9 | import warnings 10 | from torch._six import inf 11 | from core.utils import sync_print 12 | 13 | # return if any inf/nan 14 | # div norm by loss_scale, for 'real' norm 15 | # if auto_clipper provided, compute max_norm using auto_clipper 16 | # else, using give max_norm 17 | def clip_grad_norm_(parameters, max_norm=1000000, norm_type=2, auto_clipper=None, loss_scale=1.0): 18 | if isinstance(parameters, torch.Tensor): 19 | parameters = [parameters] 20 | parameters = list(filter(lambda p: p[1].grad is not None, parameters)) 21 | 22 | if len(parameters) == 0: return None 23 | 24 | max_norm = float(max_norm) 25 | norm_type = float(norm_type) 26 | if norm_type == inf: 27 | total_norm = max(p.grad.data.abs().max() for p in parameters) 28 | else: 29 | total_norm = 0 30 | for name,p in parameters: 31 | param_norm = p.grad.data.norm(norm_type) 32 | total_norm += param_norm.item() ** norm_type 33 | 34 | total_norm = total_norm ** (1. / norm_type) 35 | 36 | # check inf/nan 37 | overflow_num = torch.zeros(1) 38 | if np.isinf(total_norm) or np.isnan(total_norm): 39 | overflow_num[0] = 1 40 | dist.allreduce(overflow_num) 41 | 42 | if overflow_num > 0: 43 | for name,p in parameters: 44 | p.grad.data.fill_(float('nan')) 45 | sync_print('total_norm is inf({})/nan({}), skip clipping!!!'.format(np.isinf(total_norm), np.isnan(total_norm))) 46 | return total_norm 47 | 48 | # rescale the total_norm by loss_scale 49 | total_norm /= loss_scale 50 | 51 | # update auto_clipper, compute max_norm 52 | if auto_clipper is not None: 53 | max_norm = auto_clipper.update(total_norm) 54 | 55 | # do clipping 56 | clip_coef = max_norm / (total_norm + 1e-6) 57 | if clip_coef < 1: 58 | # sync_print('clip_coef: {}'.format(clip_coef)) 59 | for _, p in parameters: 60 | p.grad.data.mul_(clip_coef) 61 | 62 | return total_norm 63 | 64 | class ClipMeter(object): 65 | def __init__(self, mom=None, thresh=None, min_max=False, mean=False, init=False): 66 | self.thresh = thresh 67 | self.mom = mom 68 | self.min_max = min_max 69 | self.mean = mean 70 | self.val = 1.0 71 | self.init = init 72 | 73 | def get_mean(self): 74 | return self.val 75 | 76 | def get_clip_val(self): 77 | if self.mean: 78 | return self.get_mean() 79 | else: 80 | return self.get_mean() * (1+self.thresh) 81 | 82 | def update(self, x): 83 | if self.init: 84 | self.val = x 85 | self.init = False 86 | mean = self.get_mean() 87 | if self.min_max: 88 | x = max(min(x, mean*(1+self.thresh)), mean*(1-self.thresh)) 89 | else: 90 | x = min(x, mean*(1+self.thresh)) 91 | 92 | self.val = self.mom * self.val + (1-self.mom)*x 93 | return self.get_clip_val() 94 | -------------------------------------------------------------------------------- /PATH/core/data/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | from .images.reid_dataset import ReIDDataset 2 | from .images.pedattr_dataset import AttrDataset 3 | from .images.pos_dataset_dev import COCOPosDatasetDev, MPIIPosDatasetDev 4 | from .images.multi_posedataset import MultiPoseDatasetDev 5 | from .images.parsing_dataset import Human3M6ParsingDataset, LIPParsingDataset, CIHPParsingDataset, ATRParsingDataset, DeepFashionParsingDataset, VIPParsingDataset, ModaNetParsingDataset, PaperDollParsingDataset 6 | from .images.pedattr_dataset import AttrDataset, MultiAttrDataset 7 | from .images.peddet_dataset import PedestrainDetectionDataset 8 | from core.utils import printlog 9 | 10 | def dataset_entry(config): 11 | printlog('config[kwargs]',config['kwargs']) 12 | return globals()[config['type']](**config['kwargs']) 13 | -------------------------------------------------------------------------------- /PATH/core/data/datasets/images/seg_data_tools/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/PATH/core/data/datasets/images/seg_data_tools/__init__.py -------------------------------------------------------------------------------- /PATH/core/data/datasets/images/seg_data_tools/transforms.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import torch 3 | from PIL import Image 4 | 5 | 6 | class Normalize(object): 7 | """Normalize a ``torch.tensor`` 8 | 9 | Args: 10 | inputs (torch.tensor): tensor to be normalized. 11 | mean: (list): the mean of RGB 12 | std: (list): the std of RGB 13 | 14 | Returns: 15 | Tensor: Normalized tensor. 16 | """ 17 | def __init__(self, div_value, mean, std): 18 | self.div_value = div_value 19 | self.mean = mean 20 | self.std =std 21 | 22 | def __call__(self, inputs): 23 | inputs = inputs.div(self.div_value) 24 | for t, m, s in zip(inputs, self.mean, self.std): 25 | t.sub_(m).div_(s) 26 | 27 | return inputs 28 | 29 | 30 | class DeNormalize(object): 31 | """DeNormalize a ``torch.tensor`` 32 | 33 | Args: 34 | inputs (torch.tensor): tensor to be normalized. 35 | mean: (list): the mean of RGB 36 | std: (list): the std of RGB 37 | 38 | Returns: 39 | Tensor: Normalized tensor. 40 | """ 41 | def __init__(self, div_value, mean, std): 42 | self.div_value = div_value 43 | self.mean = mean 44 | self.std =std 45 | 46 | def __call__(self, inputs): 47 | result = inputs.clone() 48 | for i in range(result.size(0)): 49 | result[i, :, :] = result[i, :, :] * self.std[i] + self.mean[i] 50 | 51 | return result.mul_(self.div_value) 52 | 53 | 54 | class ToTensor(object): 55 | """Convert a ``numpy.ndarray or Image`` to tensor. 56 | 57 | See ``ToTensor`` for more details. 58 | 59 | Args: 60 | inputs (numpy.ndarray or Image): Image to be converted to tensor. 61 | 62 | Returns: 63 | Tensor: Converted image. 64 | """ 65 | def __call__(self, inputs): 66 | if isinstance(inputs, Image.Image): 67 | channels = len(inputs.mode) 68 | inputs = np.array(inputs) 69 | inputs = inputs.reshape(inputs.shape[0], inputs.shape[1], channels) 70 | inputs = torch.from_numpy(inputs.transpose(2, 0, 1)) 71 | else: 72 | inputs = torch.from_numpy(inputs.transpose(2, 0, 1)) 73 | 74 | return inputs.float() 75 | 76 | 77 | class ToLabel(object): 78 | def __call__(self, inputs): 79 | return torch.from_numpy(np.array(inputs)).long() 80 | 81 | 82 | class ReLabel(object): 83 | """ 84 | 255 indicate the background, relabel 255 to some value. 85 | """ 86 | def __init__(self, olabel, nlabel): 87 | self.olabel = olabel 88 | self.nlabel = nlabel 89 | 90 | def __call__(self, inputs): 91 | assert isinstance(inputs, torch.LongTensor), 'tensor needs to be LongTensor' 92 | 93 | inputs[inputs == self.olabel] = self.nlabel 94 | return inputs 95 | 96 | 97 | class Compose(object): 98 | 99 | def __init__(self, transforms): 100 | self.transforms = transforms 101 | 102 | def __call__(self, inputs): 103 | for t in self.transforms: 104 | inputs = t(inputs) 105 | 106 | return inputs -------------------------------------------------------------------------------- /PATH/core/data/test_datasets/__init__.py: -------------------------------------------------------------------------------- 1 | from .images.reid_dataset import ReIDTestDataset 2 | from .images.reid_dataset import ReIDTestDatasetDev 3 | 4 | def dataset_entry(config): 5 | # print('config[kwargs]',config['kwargs']) 6 | return globals()[config['type']](**config['kwargs']) 7 | -------------------------------------------------------------------------------- /PATH/core/data/transforms/peddet_transforms.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved 2 | """ 3 | COCO dataset which returns image_id for evaluation. 4 | 5 | Mostly copy-paste from https://github.com/pytorch/vision/blob/13b35ff/references/detection/coco_utils.py 6 | """ 7 | from pathlib import Path 8 | import os.path as osp 9 | import json 10 | import torch 11 | import torch.utils.data 12 | import torchvision 13 | import core.data.transforms.peddet_transforms_helpers.transforms as T 14 | import cv2 15 | cv2.ocl.setUseOpenCL(False) 16 | 17 | class PedestrainDetectionAugmentation(object): 18 | def __init__(self, phase, vit=False, max_size=1024): 19 | if vit: 20 | normalize = T.Compose([ 21 | T.PILToTensor(), 22 | T.Normalize([0., 0., 0.], [1., 1., 1.]) 23 | ]) 24 | else: 25 | normalize = T.Compose([ 26 | T.ToTensor(), 27 | T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]) 28 | ]) 29 | 30 | scales = [480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800] 31 | if phase == 'train': 32 | self.transformer = T.Compose([ 33 | T.RandomHorizontalFlip(), 34 | T.RandomSelect( 35 | T.RandomResize(scales, max_size=max_size), 36 | T.Compose([ 37 | T.RandomResize([400, 500, 600]), 38 | T.RelativeRandomSizeCrop(384, 600), 39 | T.RandomResize(scales, max_size=max_size), 40 | ]) 41 | ), 42 | normalize, 43 | ]) 44 | elif phase == 'val': 45 | self.transformer = T.Compose([ 46 | T.RandomResize([800], max_size=max_size), 47 | normalize, 48 | ]) 49 | else: 50 | raise NotImplementedError 51 | 52 | def __call__(self, image, target): 53 | return self.transformer(image, target) 54 | 55 | 56 | class SparseRCNNPedestrainDetectionAugmentation(object): 57 | def __init__(self, phase, vit=False, max_size=1024): 58 | if vit: 59 | normalize = T.Compose([ 60 | T.PILToTensor(), 61 | T.Normalize([0., 0., 0.], [1., 1., 1.]) 62 | ]) 63 | else: 64 | normalize = T.Compose([ 65 | T.ToTensor(), 66 | T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]) 67 | ]) 68 | 69 | scales = [640, 672, 704, 736, 768, 800] 70 | 71 | if phase == 'train': 72 | self.transformer = T.Compose([ 73 | T.RandomHorizontalFlip(), 74 | T.RandomResize(scales, max_size=max_size), 75 | normalize, 76 | ]) 77 | elif phase == 'val': 78 | self.transformer = T.Compose([ 79 | T.RandomResize([800], max_size=max_size), 80 | normalize, 81 | ]) 82 | else: 83 | raise NotImplementedError 84 | 85 | def __call__(self, image, target): 86 | return self.transformer(image, target) 87 | -------------------------------------------------------------------------------- /PATH/core/data/transforms/peddet_transforms_helpers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/PATH/core/data/transforms/peddet_transforms_helpers/__init__.py -------------------------------------------------------------------------------- /PATH/core/data/transforms/sparsercnn_peddet_transforms_helpers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from fvcore.transforms.transform import Transform, TransformList # order them first 3 | from fvcore.transforms.transform import * 4 | from .transform import * 5 | from .augmentation import * 6 | from .augmentation_impl import * 7 | 8 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 9 | -------------------------------------------------------------------------------- /PATH/core/exceptions.py: -------------------------------------------------------------------------------- 1 | 2 | class MCReadFailException(Exception): 3 | pass 4 | 5 | class NoneImageException(Exception): 6 | pass 7 | -------------------------------------------------------------------------------- /PATH/core/fp16/__init__.py: -------------------------------------------------------------------------------- 1 | from .opt import * 2 | from .scaler import * 3 | from .amp import * 4 | from . import utils 5 | -------------------------------------------------------------------------------- /PATH/core/fp16/scaler.py: -------------------------------------------------------------------------------- 1 | import torch 2 | from torch._six import inf 3 | 4 | from .utils import iter_params 5 | 6 | __all__ = ['scale_check_overflow', 'LossScaler'] 7 | 8 | # from apex_C import scale_check_overflow 9 | 10 | # Python stopgap, until we get a future-proof kernel into upstream 11 | def scale_check_overflow(d_grads, scale): 12 | any_infinite = ((d_grads != d_grads) | (d_grads.abs() == inf)).any() 13 | if any_infinite: 14 | return True 15 | d_grads.mul_(scale) 16 | return False 17 | 18 | class LossScaler(object): 19 | def __init__(self, scale=1.0, dynamic=False): 20 | self._dynamic = dynamic 21 | self._loss_scale = 2.**16 if self._dynamic else scale 22 | self._max_loss_scale = 2.**24 23 | self._scale_seq_len = 2000 24 | self._unskipped = 0 25 | self._has_overflow = False 26 | 27 | @property 28 | def loss_scale(self): 29 | return self._loss_scale 30 | 31 | @property 32 | def has_overflow(self): 33 | return self._has_overflow 34 | 35 | def unscale_and_update(self, param_groups, scale): 36 | if not self._dynamic: 37 | for p in iter_params(param_groups): 38 | if p.grad is not None: 39 | p.grad.data.mul_(1. / scale) 40 | return 41 | 42 | self._has_overflow = False 43 | for p in iter_params(param_groups): 44 | if p.grad is not None: 45 | self._has_overflow = scale_check_overflow(p.grad.data, 46 | 1. / scale) 47 | if self._has_overflow: 48 | break 49 | 50 | # if self._overflow_buf.any(): 51 | if self._has_overflow: 52 | should_skip = True 53 | self._loss_scale /= 2. 54 | self._unskipped = 0 55 | else: 56 | should_skip = False 57 | self._unskipped += 1 58 | 59 | if self._unskipped == self._scale_seq_len: 60 | self._loss_scale = min(self._max_loss_scale, self._loss_scale * 2.) 61 | self._unskipped = 0 62 | 63 | return should_skip 64 | 65 | def backward(self, loss): 66 | scaled_loss = loss*self.loss_scale 67 | scaled_loss.backward() 68 | -------------------------------------------------------------------------------- /PATH/core/fp16/wrap.py: -------------------------------------------------------------------------------- 1 | from . import utils 2 | 3 | import functools 4 | 5 | import torch 6 | 7 | def make_cast_wrapper(orig_fn, cast_fn, handle, 8 | try_caching=False): 9 | @functools.wraps(orig_fn) 10 | def wrapper(*args, **kwargs): 11 | if not handle.is_active(): 12 | return orig_fn(*args, **kwargs) 13 | 14 | input_types = [ 15 | v.data.type() for v in list(args) + list(kwargs.values()) 16 | if utils.is_fp_tensor(v) 17 | ] 18 | #print('wrapper: orig_fn:{}, input_types:{}'.format(orig_fn, input_types)) 19 | input_type = input_types[0] 20 | 21 | if try_caching and handle.has_cache: 22 | args = list(args) 23 | for i in range(len(args)): 24 | if utils.should_cache(args[i]): 25 | args[i] = utils.cached_cast(cast_fn, args[i], handle.cache) 26 | for k in kwargs: 27 | if utils.should_cache(kwargs[k]): 28 | kwargs[k] = utils.cached_cast(cast_fn, kwargs[k], handle.cache) 29 | new_args = utils.casted_args(cast_fn, 30 | args, 31 | kwargs) 32 | output = orig_fn(*new_args, **kwargs) 33 | 34 | #if output.type() != input_type: 35 | # print('ori output type: {}, input type: {}'.format(output.type(), input_type)) 36 | # return output.type(input_type) 37 | #return output 38 | return cast_output(output, input_type, verbose=False) 39 | 40 | return wrapper 41 | 42 | def cast_output(output, input_type, verbose=False): 43 | if isinstance(output, dict): 44 | keys = output.keys() 45 | for k in keys: 46 | output[k] = cast_output(output[k], input_type) 47 | return output 48 | 49 | if utils.is_fp_tensor(output) and output.type() != input_type: 50 | if verbose: 51 | print('ori output type: {}, input type: {}'.format(output.type(), input_type)) 52 | return output.type(input_type) 53 | return output 54 | 55 | def cached_cast(mod, fn, cast_fn, handle, 56 | try_caching=False, verbose=False): 57 | if not utils.has_func(mod, fn): 58 | return 59 | 60 | orig_fn = utils.get_func(mod, fn) 61 | cast_fn = utils.verbosify(cast_fn, fn, verbose) 62 | wrapper = make_cast_wrapper(orig_fn, cast_fn, handle, try_caching) 63 | utils.set_func_save(handle, mod, fn, wrapper) 64 | 65 | -------------------------------------------------------------------------------- /PATH/core/lr_scheduler/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import StepLRScheduler, CosineLRScheduler, WarmupCosineLRScheduler, WarmupPolyLRScheduler 2 | 3 | def lr_scheduler_entry(config): 4 | return globals()[config['type']+'LRScheduler'](**config['kwargs']) 5 | -------------------------------------------------------------------------------- /PATH/core/memory.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | import logging 4 | from contextlib import contextmanager 5 | from functools import wraps 6 | import torch 7 | 8 | __all__ = ["retry_if_cuda_oom"] 9 | 10 | 11 | @contextmanager 12 | def _ignore_torch_cuda_oom(): 13 | """ 14 | A context which ignores CUDA OOM exception from pytorch. 15 | """ 16 | try: 17 | yield 18 | except RuntimeError as e: 19 | # NOTE: the string may change? 20 | if "CUDA out of memory. " in str(e): 21 | pass 22 | else: 23 | raise 24 | 25 | 26 | def retry_if_cuda_oom(func): 27 | """ 28 | Makes a function retry itself after encountering 29 | pytorch's CUDA OOM error. 30 | It will first retry after calling `torch.cuda.empty_cache()`. 31 | 32 | If that still fails, it will then retry by trying to convert inputs to CPUs. 33 | In this case, it expects the function to dispatch to CPU implementation. 34 | The return values may become CPU tensors as well and it's user's 35 | responsibility to convert it back to CUDA tensor if needed. 36 | 37 | Args: 38 | func: a stateless callable that takes tensor-like objects as arguments 39 | 40 | Returns: 41 | a callable which retries `func` if OOM is encountered. 42 | 43 | Examples: 44 | :: 45 | output = retry_if_cuda_oom(some_torch_function)(input1, input2) 46 | # output may be on CPU even if inputs are on GPU 47 | 48 | Note: 49 | 1. When converting inputs to CPU, it will only look at each argument and check 50 | if it has `.device` and `.to` for conversion. Nested structures of tensors 51 | are not supported. 52 | 53 | 2. Since the function might be called more than once, it has to be 54 | stateless. 55 | """ 56 | 57 | def maybe_to_cpu(x): 58 | try: 59 | like_gpu_tensor = x.device.type == "cuda" and hasattr(x, "to") 60 | except AttributeError: 61 | like_gpu_tensor = False 62 | if like_gpu_tensor: 63 | return x.to(device="cpu") 64 | else: 65 | return x 66 | 67 | @wraps(func) 68 | def wrapped(*args, **kwargs): 69 | with _ignore_torch_cuda_oom(): 70 | return func(*args, **kwargs) 71 | 72 | # Clear cache and retry 73 | torch.cuda.empty_cache() 74 | with _ignore_torch_cuda_oom(): 75 | return func(*args, **kwargs) 76 | 77 | # Try on CPU. This slows down the code significantly, therefore print a notice. 78 | logger = logging.getLogger(__name__) 79 | logger.info("Attempting to copy inputs of {} to CPU due to CUDA OOM".format(str(func))) 80 | new_args = (maybe_to_cpu(x) for x in args) 81 | new_kwargs = {k: maybe_to_cpu(v) for k, v in kwargs.items()} 82 | return func(*new_args, **new_kwargs) 83 | 84 | return wrapped 85 | -------------------------------------------------------------------------------- /PATH/core/models/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/PATH/core/models/__init__.py -------------------------------------------------------------------------------- /PATH/core/models/backbones/__init__.py: -------------------------------------------------------------------------------- 1 | from .vitdet import vit_base_patch16 2 | from .vitdet_for_ladder_attention import vit_base_patch16_ladder_attention, vit_large_patch16_ladder_attention 3 | from .vitdet_for_ladder_attention_share_pos_embed import vit_base_patch16_ladder_attention_share_pos_embed, vit_large_patch16_ladder_attention_share_pos_embed 4 | 5 | def backbone_entry(config): 6 | return globals()[config['type']](**config['kwargs']) 7 | -------------------------------------------------------------------------------- /PATH/core/models/decoders/__init__.py: -------------------------------------------------------------------------------- 1 | from .classification_decoders.reid_decoders import * 2 | from .pose_decodes.pose_decoder import TopDownSimpleHead 3 | from .seg_decoders.seg_decoders import HRT_OCR_V2, ViT_OCR_V2, ViT_SimpleUpSampling 4 | from .peddet_decoders import AIOHead 5 | from .classification_decoders.pedattr_decoders import * 6 | def decoder_entry(config): 7 | return globals()[config['type']](**config['kwargs']) 8 | -------------------------------------------------------------------------------- /PATH/core/models/decoders/classification_decoders/pedattr_decoders.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | import torch.nn.functional as F 4 | import math 5 | from torch.nn.parameter import Parameter 6 | 7 | from ..losses import loss_entry 8 | 9 | __all__ = ['pedattr_cls_vit_A'] 10 | 11 | 12 | class pedattr_cls_vit_A(nn.Module): 13 | def __init__(self, out_feature, nattr, loss_cfg, use_sync_bn=False, \ 14 | bn_group=None, bn_momentum=0.1, \ 15 | bn_eps=1.e-5, **kwargs): 16 | 17 | super(pedattr_cls_vit_A, self).__init__() 18 | 19 | global BN 20 | 21 | def BNFunc(*args, **kwargs): 22 | class SyncBatchNorm1d(torch.nn.SyncBatchNorm): 23 | def forward(self, input): 24 | assert input.dim() == 2 25 | output = super(SyncBatchNorm1d, self).forward(input.unsqueeze(-1).unsqueeze(-1)) 26 | return output.squeeze(dim=2).squeeze(dim=2) 27 | return SyncBatchNorm1d(*args, **kwargs, process_group=bn_group, momentum=bn_momentum, eps=bn_eps) 28 | 29 | if use_sync_bn: 30 | BN = BNFunc 31 | else: 32 | BN = nn.BatchNorm1d 33 | 34 | self.logits = nn.Sequential( 35 | nn.Linear(out_feature, nattr), 36 | nn.BatchNorm1d(nattr) 37 | ) 38 | 39 | self.avg_pool2d = nn.AdaptiveAvgPool2d(1) 40 | self.loss = loss_entry(loss_cfg) 41 | 42 | def forward(self, input_var): 43 | output = {} 44 | patch_feats = input_var['neck_output'] 45 | patch_feats = self.avg_pool2d(patch_feats).squeeze() 46 | logits = self.logits(patch_feats) 47 | output['pred_logits'] = logits 48 | output.update(input_var) 49 | losses = self.loss(output) 50 | output.update(losses) 51 | return output 52 | -------------------------------------------------------------------------------- /PATH/core/models/decoders/classification_decoders/reid_decoders.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | import torch.nn.functional as F 4 | import math 5 | from torch.nn.parameter import Parameter 6 | from ...ops.hrt_helpers.transformer_block import GeneralTransformerBlock 7 | from ..losses import loss_entry 8 | 9 | 10 | __all__ = ['reid_cls_vit_B'] 11 | 12 | def weights_init_kaiming(m): 13 | classname = m.__class__.__name__ 14 | if classname.find('Linear') != -1: 15 | nn.init.kaiming_normal_(m.weight, a=0, mode='fan_out') 16 | nn.init.constant_(m.bias, 0.0) 17 | 18 | elif classname.find('Conv') != -1: 19 | nn.init.kaiming_normal_(m.weight, a=0, mode='fan_in') 20 | if m.bias is not None: 21 | nn.init.constant_(m.bias, 0.0) 22 | elif classname.find('BatchNorm') != -1: 23 | if m.affine: 24 | nn.init.constant_(m.weight, 1.0) 25 | nn.init.constant_(m.bias, 0.0) 26 | 27 | 28 | class reid_cls_vit_B(nn.Module): 29 | def __init__(self, out_feature, loss_cfg, feature_bn=True, use_sync_bn=False, \ 30 | bn_group=None, bn_momentum=0.1, \ 31 | bn_eps=1.e-5, feature_only=False, **kwargs): 32 | super(reid_cls_vit_B, self).__init__() 33 | 34 | global BN 35 | 36 | def BNFunc(*args, **kwargs): 37 | class SyncBatchNorm1d(torch.nn.SyncBatchNorm): 38 | def forward(self, input): 39 | assert input.dim() == 2 40 | output = super(SyncBatchNorm1d, self).forward(input.unsqueeze(-1).unsqueeze(-1)) 41 | return output.squeeze(dim=2).squeeze(dim=2) 42 | return SyncBatchNorm1d(*args, **kwargs, process_group=bn_group, momentum=bn_momentum, eps=bn_eps) 43 | 44 | if use_sync_bn: 45 | BN = BNFunc 46 | else: 47 | BN = nn.BatchNorm1d 48 | 49 | self.feature_bn = feature_bn 50 | if feature_bn: 51 | self.feat_bn = BN(out_feature) 52 | self.feat_bn.bias.requires_grad_(False) 53 | self.feat_bn.apply(weights_init_kaiming) 54 | 55 | self.loss = loss_entry(loss_cfg) 56 | self.feature_only = feature_only 57 | 58 | def forward(self, input_var): 59 | output = {} 60 | features_nobn = input_var['neck_output']['cls_feats'] 61 | if self.feature_bn: 62 | features = self.feat_bn(features_nobn) 63 | labels = input_var['label'] 64 | output['feature'] = features 65 | output['feature_nobn'] = features_nobn 66 | output['label'] = labels 67 | if self.feature_only: return output 68 | logits = self.loss(output) 69 | output.update(logits) 70 | return output 71 | -------------------------------------------------------------------------------- /PATH/core/models/decoders/losses/__init__.py: -------------------------------------------------------------------------------- 1 | from .classification_losses import MarginCosineProductLoss 2 | from .classification_losses import ArcFaceLoss, Softmax_TripletLoss, Softmax_TripletLoss_wBN 3 | from .seg_losses import FSAuxCELoss, FocalDiceLoss, FocalDiceLoss_bce_cls_emb, FSCELoss, FocalDiceLoss_bce_cls_emb_sample_weight 4 | from .pos_losses import BasePosLoss 5 | from .peddet_losses import DetFocalDiceLoss 6 | from .pedattr_losses import CEL_Sigmoid 7 | 8 | def loss_entry(config): 9 | return globals()[config['type']](**config['kwargs']) 10 | -------------------------------------------------------------------------------- /PATH/core/models/decoders/losses/pedattr_losses.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | 4 | import torch 5 | import torch.nn as nn 6 | import torch.nn.functional as F 7 | import numpy as np 8 | 9 | 10 | 11 | __all__ = ['CEL_Sigmoid'] 12 | 13 | def ratio2weight(targets, ratio): 14 | ratio = torch.from_numpy(ratio).type_as(targets) 15 | pos_weights = targets * (1 - ratio) 16 | neg_weights = (1 - targets) * ratio 17 | weights = torch.exp(neg_weights + pos_weights) 18 | 19 | # for RAP dataloader, targets element may be 2, with or without smooth, some element must great than 1 20 | weights[targets > 1] = 0.0 21 | 22 | return weights 23 | 24 | class CEL_Sigmoid(nn.Module): 25 | def __init__(self, sample_weight=None, size_average=True): 26 | super(CEL_Sigmoid, self).__init__() 27 | 28 | self.sample_weight = sample_weight 29 | 30 | if sample_weight is not None: 31 | self.sample_weight = np.array(self.sample_weight) 32 | 33 | self.size_average = size_average 34 | 35 | def forward(self, input_var): 36 | logits = input_var['pred_logits'] 37 | targets = input_var['label'] 38 | batch_size = logits.shape[0] 39 | 40 | weight_mask = (targets != -1) 41 | loss = F.binary_cross_entropy_with_logits(logits, targets, weight=weight_mask, reduction='none') 42 | 43 | targets_mask = torch.where(targets.detach().cpu() > 0.5, torch.ones(1), torch.zeros(1)) 44 | if self.sample_weight is not None: 45 | weight = ratio2weight(targets_mask, self.sample_weight) 46 | loss = (loss * weight.cuda()) 47 | 48 | loss = loss.sum() / batch_size if self.size_average else loss.sum() 49 | 50 | output = {'loss': loss, 'top1': torch.Tensor([0]).cuda()} 51 | 52 | return output 53 | 54 | def __repr__(self): 55 | return self.__class__.__name__ + '(' \ 56 | + 'sample_weight=' + str(self.sample_weight) \ 57 | + ', size_average=' + str(self.size_average) + ')' 58 | 59 | class CEL_Sigmoid_Q2L(nn.Module): 60 | def __init__(self, cfg, **kwargs): 61 | super(CEL_Sigmoid_Q2L, self).__init__() 62 | 63 | self.sample_weight = cfg['sample_weight'] 64 | 65 | if self.sample_weight is not None: 66 | self.sample_weight = np.array(self.sample_weight) 67 | 68 | self.size_average = cfg['size_average'] 69 | 70 | def forward(self, input_var): 71 | logits = input_var['pred_logits'].squeeze() 72 | targets = input_var['label'] 73 | batch_size = logits.shape[0] 74 | 75 | loss = F.binary_cross_entropy_with_logits(logits, targets, reduction='none') 76 | 77 | targets_mask = torch.where(targets.detach().cpu() > 0.5, torch.ones(1), torch.zeros(1)) 78 | if self.sample_weight is not None: 79 | weight = ratio2weight(targets_mask, self.sample_weight) 80 | loss = (loss * weight.cuda()) 81 | 82 | loss = loss.sum() / batch_size if self.size_average else loss.sum() 83 | 84 | output = {'loss': loss, 'top1': torch.Tensor([0]).cuda()} 85 | 86 | return output 87 | 88 | def __repr__(self): 89 | return self.__class__.__name__ + '(' \ 90 | + 'sample_weight=' + str(self.sample_weight) \ 91 | + ', size_average=' + str(self.size_average) + ')' 92 | -------------------------------------------------------------------------------- /PATH/core/models/decoders/losses/peddet_losses.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | import torch.nn.functional as F 4 | from .matcher import DetectionHungarianMatcher 5 | from .criterion import DetSetCriterion 6 | 7 | class DetFocalDiceLoss(nn.Module): 8 | def __init__(self, cfg): 9 | super(DetFocalDiceLoss, self).__init__() 10 | matcher = DetectionHungarianMatcher( 11 | cost_class=cfg.class_weight, 12 | cost_bbox=cfg.bbox_weight, 13 | cost_giou=cfg.giou_weight, 14 | ) 15 | 16 | weight_dict = {"loss_ce": cfg.class_weight, 17 | "loss_bbox": cfg.bbox_weight, 18 | "loss_giou": cfg.giou_weight} 19 | 20 | if cfg.deep_supervision: 21 | aux_weight_dict = {} 22 | for i in range(cfg.dec_layers-1): 23 | aux_weight_dict.update({k + f"_{i}": v for k, v in weight_dict.items()}) # {loss_ce_i : cfg.class_weight ...} 24 | aux_weight_dict.update({k + f'_enc': v for k, v in weight_dict.items()}) 25 | weight_dict.update(aux_weight_dict) 26 | 27 | self.fd_loss = DetSetCriterion( 28 | cfg.num_classes, 29 | ginfo=cfg.ginfo, 30 | matcher=matcher, 31 | weight_dict=weight_dict, 32 | losses=["labels", "boxes"], 33 | focal_alpha=cfg.focal_alpha, 34 | ign_thr=cfg.ign_thr, 35 | ) 36 | 37 | self.cfg = cfg 38 | 39 | def forward(self, outputs, targets, **kwargs): # {"aux_outputs": xx, 'xx': xx} 40 | losses = self.fd_loss(outputs, targets) 41 | for k in list(losses.keys()): 42 | if k in self.fd_loss.weight_dict: 43 | losses[k] *= self.fd_loss.weight_dict[k] 44 | elif 'loss' in k: 45 | # remove this loss if not specified in `weight_dict` 46 | losses.pop(k) 47 | return losses 48 | -------------------------------------------------------------------------------- /PATH/core/models/decoders/losses/pos_losses.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | import torch.nn.functional as F 4 | from .matcher import HungarianMatcher, DirectMatcher, RedundantQMatcher, POSDirectMatcher 5 | from .criterion import SetCriterion, POSSetCriterion 6 | 7 | class BasePosLoss(nn.Module): 8 | def __init__(self, target_type, use_target_weight=True, cfg=None): 9 | super(BasePosLoss, self).__init__() 10 | self.criterion = nn.MSELoss() 11 | 12 | self.target_type = target_type 13 | self.use_target_weight = use_target_weight 14 | 15 | self.cfg = cfg 16 | 17 | def get_loss(self, num_joints, heatmaps_pred, heatmaps_gt, target_weight): 18 | loss = 0. 19 | for idx in range(num_joints): 20 | heatmap_pred = heatmaps_pred[idx].squeeze(1) 21 | heatmap_gt = heatmaps_gt[idx].squeeze(1) 22 | if self.use_target_weight: 23 | loss += self.criterion(heatmap_pred * target_weight[:, idx], 24 | heatmap_gt * target_weight[:, idx]) 25 | else: 26 | loss += self.criterion(heatmap_pred, heatmap_gt) 27 | return loss 28 | 29 | def forward(self, outputs, target, target_weight): # {"aux_outputs": xx, 'xx': xx} 30 | """Forward function.""" 31 | output = outputs['pred_masks'] # {'pred_logits':'pred_masks':} 32 | 33 | batch_size = output.size(0) 34 | num_joints = output.size(1) 35 | 36 | heatmaps_pred = output.reshape((batch_size, num_joints, -1)).split(1, 1) 37 | heatmaps_gt = target.reshape((batch_size, num_joints, -1)).split(1, 1) 38 | 39 | loss = self.get_loss(num_joints, heatmaps_pred, heatmaps_gt, target_weight) 40 | # import pdb; 41 | # pdb.set_trace() 42 | # In case of auxiliary losses, we repeat this process with the output of each intermediate layer. 43 | if "aux_outputs" in outputs and self.cfg.get('aux_loss', True): 44 | for aux_outputs in outputs["aux_outputs"]: 45 | heatmaps_pred = aux_outputs['pred_masks'].reshape((batch_size, num_joints, -1)).split(1, 1) 46 | 47 | loss = loss + self.get_loss(num_joints, heatmaps_pred, heatmaps_gt, target_weight) 48 | 49 | return loss / num_joints 50 | 51 | 52 | class JointsMSELoss(nn.Module): 53 | """MSE loss for heatmaps. 54 | Args: 55 | use_target_weight (bool): Option to use weighted MSE loss. 56 | Different joint types may have different target weights. 57 | loss_weight (float): Weight of the loss. Default: 1.0. 58 | """ 59 | 60 | def __init__(self, use_target_weight=False, loss_weight=1.): 61 | super().__init__() 62 | self.criterion = nn.MSELoss() 63 | self.use_target_weight = use_target_weight 64 | self.loss_weight = loss_weight 65 | 66 | def forward(self, output, target, target_weight): 67 | """Forward function.""" 68 | batch_size = output.size(0) 69 | num_joints = output.size(1) 70 | 71 | heatmaps_pred = output.reshape( 72 | (batch_size, num_joints, -1)).split(1, 1) 73 | heatmaps_gt = target.reshape((batch_size, num_joints, -1)).split(1, 1) 74 | 75 | loss = 0. 76 | 77 | for idx in range(num_joints): 78 | heatmap_pred = heatmaps_pred[idx].squeeze(1) 79 | heatmap_gt = heatmaps_gt[idx].squeeze(1) 80 | if self.use_target_weight: 81 | loss += self.criterion(heatmap_pred * target_weight[:, idx], 82 | heatmap_gt * target_weight[:, idx]) 83 | else: 84 | loss += self.criterion(heatmap_pred, heatmap_gt) 85 | 86 | return loss / num_joints * self.loss_weight 87 | -------------------------------------------------------------------------------- /PATH/core/models/decoders/peddet_decoders/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from .aio_head import AIOHead 3 | -------------------------------------------------------------------------------- /PATH/core/models/decoders/peddet_decoders/position_encoding.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # # Modified by Bowen Cheng from: https://github.com/facebookresearch/detr/blob/master/models/position_encoding.py 3 | """ 4 | Various positional encodings for the transformer. 5 | """ 6 | import math 7 | 8 | import torch 9 | from torch import nn 10 | 11 | 12 | class PositionEmbeddingSine(nn.Module): 13 | """ 14 | This is a more standard version of the position embedding, very similar to the one 15 | used by the Attention is all you need paper, generalized to work on images. 16 | """ 17 | 18 | def __init__(self, num_pos_feats=64, temperature=10000, normalize=False, scale=None): 19 | super().__init__() 20 | self.num_pos_feats = num_pos_feats 21 | self.temperature = temperature 22 | self.normalize = normalize 23 | if scale is not None and normalize is False: 24 | raise ValueError("normalize should be True if scale is passed") 25 | if scale is None: 26 | scale = 2 * math.pi 27 | self.scale = scale 28 | 29 | def forward(self, x, mask=None): 30 | if mask is None: 31 | mask = torch.zeros((x.size(0), x.size(2), x.size(3)), device=x.device, dtype=torch.bool) 32 | not_mask = ~mask 33 | y_embed = not_mask.cumsum(1, dtype=torch.float32) 34 | x_embed = not_mask.cumsum(2, dtype=torch.float32) 35 | if self.normalize: 36 | eps = 1e-6 37 | y_embed = y_embed / (y_embed[:, -1:, :] + eps) * self.scale 38 | x_embed = x_embed / (x_embed[:, :, -1:] + eps) * self.scale 39 | 40 | dim_t = torch.arange(self.num_pos_feats, dtype=torch.float32, device=x.device) 41 | dim_t = self.temperature ** (2 * (dim_t // 2) / self.num_pos_feats) 42 | 43 | pos_x = x_embed[:, :, :, None] / dim_t 44 | pos_y = y_embed[:, :, :, None] / dim_t 45 | pos_x = torch.stack( 46 | (pos_x[:, :, :, 0::2].sin(), pos_x[:, :, :, 1::2].cos()), dim=4 47 | ).flatten(3) 48 | pos_y = torch.stack( 49 | (pos_y[:, :, :, 0::2].sin(), pos_y[:, :, :, 1::2].cos()), dim=4 50 | ).flatten(3) 51 | pos = torch.cat((pos_y, pos_x), dim=3).permute(0, 3, 1, 2) 52 | return pos 53 | 54 | def __repr__(self, _repr_indent=4): 55 | head = "Positional encoding " + self.__class__.__name__ 56 | body = [ 57 | "num_pos_feats: {}".format(self.num_pos_feats), 58 | "temperature: {}".format(self.temperature), 59 | "normalize: {}".format(self.normalize), 60 | "scale: {}".format(self.scale), 61 | ] 62 | # _repr_indent = 4 63 | lines = [head] + [" " * _repr_indent + line for line in body] 64 | return "\n".join(lines) 65 | -------------------------------------------------------------------------------- /PATH/core/models/decoders/pose_decodes/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/PATH/core/models/decoders/pose_decodes/__init__.py -------------------------------------------------------------------------------- /PATH/core/models/necks/DoNothing.py: -------------------------------------------------------------------------------- 1 | import os 2 | import argparse 3 | import torch 4 | import torch.nn as nn 5 | import torch.nn.functional as F 6 | 7 | __all__ = ['DoNothing'] 8 | 9 | class DoNothing(nn.Module): 10 | def __init__(self, backbone=None, bn_group=None): 11 | super(DoNothing, self).__init__() 12 | 13 | def forward(self, x): 14 | x.update({'neck_output': x['backbone_output']}) 15 | return x 16 | -------------------------------------------------------------------------------- /PATH/core/models/necks/__init__.py: -------------------------------------------------------------------------------- 1 | from .DoNothing import * 2 | # from .simple_fpn import (SimpleFPN, MoreSimpleFPN, PoseSimpleFPN, SimpleNeck, PedDetMoreSimpleFPN) 3 | from .ladder_side_attention_fpn import LadderSideAttentionFPN 4 | 5 | def neck_entry(config): 6 | return globals()[config['type']](**config['kwargs']) 7 | -------------------------------------------------------------------------------- /PATH/core/models/ops/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/PATH/core/models/ops/__init__.py -------------------------------------------------------------------------------- /PATH/core/models/ops/hrt_helpers/__init___.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/PATH/core/models/ops/hrt_helpers/__init___.py -------------------------------------------------------------------------------- /PATH/core/models/ops/hrt_helpers/basic_block.py: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------- 2 | # High Resolution Transformer 3 | # Copyright (c) 2021 Microsoft 4 | # Licensed under The MIT License [see LICENSE for details] 5 | # Written by Rao Fu, RainbowSecret 6 | # -------------------------------------------------------- 7 | 8 | import os 9 | import pdb 10 | import logging 11 | import torch.nn as nn 12 | 13 | 14 | BN_MOMENTUM = 0.1 15 | 16 | 17 | def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): 18 | """3x3 convolution with padding""" 19 | return nn.Conv2d( 20 | in_planes, 21 | out_planes, 22 | kernel_size=3, 23 | stride=stride, 24 | padding=dilation, 25 | groups=groups, 26 | bias=False, 27 | dilation=dilation, 28 | ) 29 | 30 | 31 | class BasicBlock(nn.Module): 32 | """Only replce the second 3x3 Conv with the TransformerBlocker""" 33 | 34 | expansion = 1 35 | 36 | def __init__(self, inplanes, planes, stride=1, downsample=None): 37 | super(BasicBlock, self).__init__() 38 | self.conv1 = conv3x3(inplanes, planes, stride) 39 | self.bn1 = nn.BatchNorm2d(planes, momentum=BN_MOMENTUM) 40 | self.relu = nn.ReLU(inplace=True) 41 | 42 | self.conv2 = conv3x3(planes, planes) 43 | self.bn2 = nn.BatchNorm2d(planes, momentum=BN_MOMENTUM) 44 | self.downsample = downsample 45 | self.stride = stride 46 | 47 | def forward(self, x): 48 | residual = x 49 | 50 | out = self.conv1(x) 51 | out = self.bn1(out) 52 | out = self.relu(out) 53 | 54 | out = self.conv2(out) 55 | out = self.bn2(out) 56 | 57 | if self.downsample is not None: 58 | residual = self.downsample(x) 59 | 60 | out += residual 61 | out = self.relu(out) 62 | 63 | return out 64 | -------------------------------------------------------------------------------- /PATH/core/models/ops/hrt_helpers/bottleneck_block.py: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------- 2 | # High Resolution Transformer 3 | # Copyright (c) 2021 Microsoft 4 | # Licensed under The MIT License [see LICENSE for details] 5 | # Written by Rao Fu, RainbowSecret 6 | # -------------------------------------------------------- 7 | 8 | import os 9 | import logging 10 | import torch.nn as nn 11 | 12 | 13 | BN_MOMENTUM = 0.1 14 | 15 | 16 | class Bottleneck(nn.Module): 17 | expansion = 4 18 | 19 | def __init__(self, inplanes, planes, stride=1, downsample=None): 20 | super(Bottleneck, self).__init__() 21 | self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False) 22 | self.bn1 = nn.BatchNorm2d(planes, momentum=BN_MOMENTUM) 23 | self.conv2 = nn.Conv2d( 24 | planes, planes, kernel_size=3, stride=stride, padding=1, bias=False 25 | ) 26 | self.bn2 = nn.BatchNorm2d(planes, momentum=BN_MOMENTUM) 27 | self.conv3 = nn.Conv2d( 28 | planes, planes * self.expansion, kernel_size=1, bias=False 29 | ) 30 | self.bn3 = nn.BatchNorm2d(planes * self.expansion, momentum=BN_MOMENTUM) 31 | self.relu = nn.ReLU(inplace=True) 32 | self.downsample = downsample 33 | self.stride = stride 34 | 35 | def forward(self, x): 36 | residual = x 37 | 38 | out = self.conv1(x) 39 | out = self.bn1(out) 40 | out = self.relu(out) 41 | 42 | out = self.conv2(out) 43 | out = self.bn2(out) 44 | out = self.relu(out) 45 | 46 | out = self.conv3(out) 47 | out = self.bn3(out) 48 | 49 | if self.downsample is not None: 50 | residual = self.downsample(x) 51 | 52 | out += residual 53 | out = self.relu(out) 54 | 55 | return out 56 | 57 | 58 | class BottleneckDWP(nn.Module): 59 | expansion = 4 60 | 61 | def __init__(self, inplanes, planes, stride=1, downsample=None): 62 | super(BottleneckDWP, self).__init__() 63 | self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False) 64 | self.bn1 = nn.BatchNorm2d(planes, momentum=BN_MOMENTUM) 65 | self.conv2 = nn.Conv2d( 66 | planes, 67 | planes, 68 | kernel_size=3, 69 | stride=stride, 70 | padding=1, 71 | bias=False, 72 | groups=planes, 73 | ) 74 | self.bn2 = nn.BatchNorm2d(planes, momentum=BN_MOMENTUM) 75 | self.conv3 = nn.Conv2d( 76 | planes, planes * self.expansion, kernel_size=1, bias=False 77 | ) 78 | self.bn3 = nn.BatchNorm2d(planes * self.expansion, momentum=BN_MOMENTUM) 79 | self.relu = nn.ReLU(inplace=True) 80 | self.downsample = downsample 81 | self.stride = stride 82 | 83 | def forward(self, x): 84 | residual = x 85 | 86 | out = self.conv1(x) 87 | out = self.bn1(out) 88 | out = self.relu(out) 89 | 90 | out = self.conv2(out) 91 | out = self.bn2(out) 92 | out = self.relu(out) 93 | 94 | out = self.conv3(out) 95 | out = self.bn3(out) 96 | 97 | if self.downsample is not None: 98 | residual = self.downsample(x) 99 | 100 | out += residual 101 | out = self.relu(out) 102 | 103 | return out 104 | -------------------------------------------------------------------------------- /PATH/core/models/ops/hrt_helpers/ffn_block.py: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------- 2 | # High Resolution Transformer 3 | # Copyright (c) 2021 Microsoft 4 | # Licensed under The MIT License [see LICENSE for details] 5 | # Written by Rao Fu, RainbowSecret 6 | # -------------------------------------------------------- 7 | 8 | 9 | import torch 10 | import torch.nn as nn 11 | 12 | 13 | class Mlp(nn.Module): 14 | def __init__( 15 | self, 16 | in_features, 17 | hidden_features=None, 18 | out_features=None, 19 | act_layer=nn.GELU, 20 | drop=0.0, 21 | ): 22 | super().__init__() 23 | out_features = out_features or in_features 24 | hidden_features = hidden_features or in_features 25 | self.fc1 = nn.Linear(in_features, hidden_features) 26 | self.act = act_layer() 27 | self.fc2 = nn.Linear(hidden_features, out_features) 28 | self.drop = nn.Dropout(drop) 29 | 30 | def forward(self, x, H, W): 31 | x = self.fc1(x) 32 | x = self.act(x) 33 | x = self.drop(x) 34 | x = self.fc2(x) 35 | x = self.drop(x) 36 | return x 37 | 38 | 39 | class MlpDWBN(nn.Module): 40 | def __init__( 41 | self, 42 | in_features, 43 | hidden_features=None, 44 | out_features=None, 45 | act_layer=nn.GELU, 46 | dw_act_layer=nn.GELU, 47 | drop=0.0, 48 | ): 49 | super().__init__() 50 | out_features = out_features or in_features 51 | hidden_features = hidden_features or in_features 52 | self.fc1 = nn.Conv2d(in_features, hidden_features, kernel_size=1) 53 | self.act1 = act_layer() 54 | self.norm1 = nn.BatchNorm2d(hidden_features) 55 | self.dw3x3 = nn.Conv2d( 56 | hidden_features, 57 | hidden_features, 58 | kernel_size=3, 59 | stride=1, 60 | groups=hidden_features, 61 | padding=1, 62 | ) 63 | self.act2 = dw_act_layer() 64 | self.norm2 = nn.BatchNorm2d(hidden_features) 65 | self.fc2 = nn.Conv2d(hidden_features, out_features, kernel_size=1) 66 | self.act3 = act_layer() 67 | self.norm3 = nn.BatchNorm2d(out_features) 68 | self.drop = nn.Dropout(drop) 69 | 70 | def forward(self, x, H, W): 71 | if len(x.shape) == 3: 72 | B, N, C = x.shape 73 | if N == (H * W + 1): 74 | cls_tokens = x[:, 0, :] 75 | x_ = x[:, 1:, :].permute(0, 2, 1).reshape(B, C, H, W) 76 | else: 77 | x_ = x.permute(0, 2, 1).reshape(B, C, H, W) 78 | 79 | x_ = self.fc1(x_) 80 | x_ = self.norm1(x_) 81 | x_ = self.act1(x_) 82 | x_ = self.dw3x3(x_) 83 | x_ = self.norm2(x_) 84 | x_ = self.act2(x_) 85 | x_ = self.drop(x_) 86 | x_ = self.fc2(x_) 87 | x_ = self.norm3(x_) 88 | x_ = self.act3(x_) 89 | x_ = self.drop(x_) 90 | x_ = x_.reshape(B, C, -1).permute(0, 2, 1) 91 | if N == (H * W + 1): 92 | x = torch.cat((cls_tokens.unsqueeze(1), x_), dim=1) 93 | else: 94 | x = x_ 95 | return x 96 | 97 | elif len(x.shape) == 4: 98 | x = self.fc1(x) 99 | x = self.norm1(x) 100 | x = self.act1(x) 101 | x = self.dw3x3(x) 102 | x = self.norm2(x) 103 | x = self.act2(x) 104 | x = self.drop(x) 105 | x = self.fc2(x) 106 | x = self.norm3(x) 107 | x = self.act3(x) 108 | x = self.drop(x) 109 | return x 110 | 111 | else: 112 | raise RuntimeError("Unsupported input shape: {}".format(x.shape)) 113 | -------------------------------------------------------------------------------- /PATH/core/models/ops/normalization_helpers.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | import torch.nn.functional as F 4 | import math 5 | from spring.linklink.nn import SyncBatchNorm2d 6 | 7 | class IBN(nn.Module): 8 | def __init__(self, planes, BN): 9 | super(IBN, self).__init__() 10 | half1 = int(planes / 2) 11 | self.half = half1 12 | half2 = planes - half1 13 | self.IN = nn.InstanceNorm2d(half1, affine=True) 14 | self.BN = BN(half2) 15 | 16 | def forward(self, x): 17 | split = torch.split(x, self.half, 1) 18 | out1 = self.IN(split[0].contiguous()) 19 | out2 = self.BN(split[1].contiguous()) 20 | out = torch.cat((out1, out2), 1) 21 | return out 22 | 23 | 24 | def get_normalization(num_features, bn_type=None, **kwargs): 25 | if bn_type == "bn": 26 | return nn.BatchNorm2d(num_features, **kwargs) 27 | elif bn_type == 'syncbn': 28 | return SyncBatchNorm2d(num_features, **kwargs, group=group, \ 29 | sync_stats=sync_stats, momentum=bn_mom, eps=bn_eps) 30 | elif bn_type == 'ibn': 31 | assert half_bn is not None, "Half BN is not set!" 32 | return IBN(num_features, half_bn) 33 | elif bn_type == 'sn': 34 | raise NotImplementedError('switchable normalization is not supported!') 35 | elif bn_type == 'gn': 36 | raise NotImplementedError('group normalization is not supported!') 37 | elif bn_type == 'ln': 38 | raise NotImplementedError('layer normalization is not supported!') 39 | else: 40 | raise ValueError('bn_type ({}) is not supported.'.format(bn_type)) 41 | -------------------------------------------------------------------------------- /PATH/core/optimizers/__init__.py: -------------------------------------------------------------------------------- 1 | from torch.optim import SGD, RMSprop, Adadelta, Adagrad, Adam, AdamW # noqa F401 2 | from .lars import LARS # noqa F401 3 | from .adam_clip import AdamWithClip, AdamWWithClip, AdamWWithClipDev, AdamWWithBackboneClipDev # noqa F401 4 | from .adafactor import Adafactor_dev 5 | 6 | 7 | 8 | def optim_entry(config): 9 | return globals()[config['type']](**config['kwargs']) 10 | -------------------------------------------------------------------------------- /PATH/core/solvers/__init__.py: -------------------------------------------------------------------------------- 1 | from .solver import Solver 2 | from .solver_deter import SolverDeter 3 | from .solver_multitask_dev import SolverMultiTaskDev 4 | 5 | def solver_entry(C): 6 | return globals()[C.config['common']['solver']['type']](C) 7 | -------------------------------------------------------------------------------- /PATH/core/solvers/solver_deter.py: -------------------------------------------------------------------------------- 1 | import copy 2 | import os 3 | import random 4 | import time 5 | 6 | import core 7 | import core.models.decoders as decoders 8 | import core.models.backbones as backbones 9 | import core.models.necks as necks 10 | import core.data.datasets as datasets 11 | from core.models.model_entry import model_entry 12 | import numpy as np 13 | import torch 14 | import torch.backends.cudnn as cudnn 15 | from core import distributed_utils as dist 16 | 17 | from core.distributed_utils import DistributedGivenIterationSampler 18 | 19 | from torch.utils.data import DataLoader 20 | 21 | from .solver import Solver 22 | 23 | class WorkerInit(object): 24 | def __init__(self, rank, num_workers): 25 | self.rank = rank 26 | self.num_workers = num_workers 27 | def func(self, pid): 28 | print(f'[rank{self.rank}] setting worker seed {self.rank*self.num_workers+pid}', flush=True) 29 | np.random.seed(self.rank*self.num_workers+pid) 30 | 31 | class SolverDeter(Solver): 32 | 33 | def __init__(self, C): 34 | super().__init__(C) 35 | 36 | if self.config.get('deterministic', False): 37 | if self.config.get('cudnn_deterministic', True): 38 | cudnn.deterministic = True 39 | cudnn.benchmark = False 40 | else: 41 | cudnn.benchmark = True 42 | seed = self.config.get('random_seed', 0) 43 | worker_rank = self.config.get('worker_rank', False) 44 | if worker_rank: 45 | worker_init = WorkerInit(self.C.rank, self.config.workers) 46 | else: 47 | worker_init = WorkerInit(0, 0) 48 | self.worker_init_fn = worker_init.func 49 | random.seed(seed) 50 | np.random.seed(seed) 51 | torch.manual_seed(seed) 52 | torch.cuda.manual_seed(seed) 53 | dist.barrier() 54 | if self.C.rank == 0: 55 | self.logger.info(f'deterministic mode, seed: {seed}, worker_rank: {worker_rank},\ 56 | cudnn_deterministic: {self.config.get("cudnn_deterministic", True)}') 57 | dist.barrier() 58 | else: 59 | self.worker_init_fn = None 60 | 61 | def create_dataloader(self): 62 | config = self.config 63 | ginfo = self.ginfo 64 | 65 | self.sampler = DistributedGivenIterationSampler( 66 | self.dataset, config.max_iter, config.sampler.batch_size, 67 | world_size=ginfo.task_size, rank=ginfo.task_rank, 68 | last_iter=self.last_iter, 69 | shuffle_strategy=config.sampler.shuffle_strategy, 70 | random_seed=ginfo.task_random_seed, 71 | ret_save_path=config.sampler.get('ret_save_path', None)) 72 | 73 | 74 | self.loader = DataLoader(self.dataset, batch_size=config.sampler.batch_size, 75 | shuffle=False, num_workers=config.workers, 76 | pin_memory=False, sampler=self.sampler, worker_init_fn=self.worker_init_fn) 77 | -------------------------------------------------------------------------------- /PATH/core/solvers/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/PATH/core/solvers/utils/__init__.py -------------------------------------------------------------------------------- /PATH/core/testers/__init__.py: -------------------------------------------------------------------------------- 1 | from .reid_tester import ReIDTester 2 | from ..solvers.solver_multitask_dev import TesterMultiTaskDev, PLMultiTaskDev 3 | 4 | def tester_entry(C_train, C_test): 5 | return globals()[C_test.config['common']['tester']['type']](C_train, C_test) 6 | -------------------------------------------------------------------------------- /PATH/core/testers/tester_deter.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | import numpy as np 4 | import torch 5 | import torch.backends.cudnn as cudnn 6 | from core import distributed_utils as dist 7 | 8 | 9 | from .tester import Tester 10 | 11 | class WorkerInit(object): 12 | def __init__(self, rank, num_workers): 13 | self.rank = rank 14 | self.num_workers = num_workers 15 | def func(self, pid): 16 | print(f'[rank{self.rank}] setting worker seed {self.rank*self.num_workers+pid}', flush=True) 17 | np.random.seed(self.rank*self.num_workers+pid) 18 | 19 | class TesterDeter(Tester): 20 | 21 | def __init__(self, C_train, C_test): 22 | super().__init__(C_train, C_test) 23 | 24 | if self.config.get('deterministic', False): 25 | if self.config.get('cudnn_deterministic', True): 26 | cudnn.deterministic = True 27 | cudnn.benchmark = False 28 | else: 29 | cudnn.benchmark = True 30 | seed = self.config.get('random_seed', 0) 31 | worker_rank = self.config.get('worker_rank', False) 32 | if worker_rank: 33 | worker_init = WorkerInit(self.C_train.rank, self.config.workers) 34 | else: 35 | worker_init = WorkerInit(0, 0) 36 | self.worker_init_fn = worker_init.func 37 | random.seed(seed) 38 | np.random.seed(seed) 39 | torch.manual_seed(seed) 40 | torch.cuda.manual_seed(seed) 41 | dist.barrier() 42 | if self.C_train.rank == 0: 43 | self.logger.info(f'deterministic mode, seed: {seed}, worker_rank: {worker_rank},\ 44 | cudnn_deterministic: {self.config.get("cudnn_deterministic", True)}') 45 | dist.barrier() 46 | else: 47 | self.worker_init_fn = None 48 | -------------------------------------------------------------------------------- /PATH/core/testers/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/PATH/core/testers/utils/__init__.py -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/attr/logs/peta_vitbase_SGD_lr1e2x1_stepLRx2_wd1e4_dpr01_80ep__SmallSetting___LSA_10p_small_setting2_add_posetrack.log_20220925_222558: -------------------------------------------------------------------------------- 1 | phoenix-srun: Job 88722 scheduled successfully! 2 | Current QUOTA_TYPE is [reserved], which means the job has occupied quota in RESERVED_TOTAL under your partition. 3 | Current PHX_PRIORITY is P0 4 | 5 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/attr/pa100k_train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source pavi_env 3 | # set -x 4 | 5 | # source /mnt/lustre/share/spring/r0.3.0 6 | ROOT=../../../../ 7 | export PYTHONPATH=$ROOT:$PYTHONPATH 8 | 9 | if [[ ! -d "logs" ]]; then 10 | mkdir logs 11 | fi 12 | ################ 13 | gpus=${1-2} 14 | job_name=${2-pa100k_vitbase_SGD_lr1e2x1_stepLRx2_wd5e4_backboneclip_dpr03_30ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 15 | CONFIG=${3-pa100k_vitbase_SGD_lr1e2x1_stepLRx2_wd5e4_backboneclip_dpr03_30ep.yaml} 16 | ################ 17 | 18 | g=$((${gpus}<8?${gpus}:8)) 19 | echo 'start job:' ${job_name} ' config:' ${CONFIG} 20 | 21 | 22 | LOG_FILE=logs/${job_name}.log 23 | now=$(date +"%Y%m%d_%H%M%S") 24 | if [[ -f ${LOG_FILE} ]]; then 25 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 26 | mv ${LOG_FILE} ${LOG_FILE}_${now} 27 | fi 28 | echo 'log file: ' ${LOG_FILE} 29 | 30 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 31 | srun -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=auto \ 32 | --job-name=${job_name} --cpus-per-task=5 --phx-priority P0 --comment wbsR-SC220052.001 -x SH-IDC1-10-5-40-[177,64,238,107,163,168,171,162,165,134,136,248,239,114,136,161,164,245,186,64,44,86,87,88],SH-IDC1-10-5-41-[3,4] \ 33 | python -W ignore -u ${ROOT}/multitask.py \ 34 | --expname ${job_name} \ 35 | --config ${CONFIG} \ 36 | --auto-resume=checkpoints/${job_name}/ckpt_task_iter_newest.pth.tar \ 37 | 2>&1 | tee ${LOG_FILE} 38 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/attr/pa100k_vitbase_SGD_lr1e2x1_stepLRx2_wd5e4_backboneclip_dpr03_30ep.yaml: -------------------------------------------------------------------------------- 1 | out_dir: /mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_samll_setting_attr_FT 2 | 3 | common: # prefix 4 | project_name: L2_samll_setting_attr_FT 5 | backbone: 6 | type: vit_base_patch16 7 | kwargs: 8 | task_sp_list: ['pos_embed', 'rel_pos_h', 'rel_pos_w'] # wrong list would somehow cause .cuda() stuck without error 9 | pretrained: True 10 | pretrain_path: '/mnt/lustre/chencheng1/expr_files/vitruvian/devL2/transed_ckpt_for_pretrain/devL2_small_setting/reid/vitbase_lr1e3_StepLRx3_backboneclip_bmp08_ld75_pose_dpr03_dcLN_par_dpr03_dcBN_attr_dpr01_reid_clstoken_dpr0_LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion.pth' 11 | load_pos_embed: True 12 | pos_embed_interp: False 13 | learnable_pos: True 14 | window: False 15 | drop_path_rate: 0.3 16 | img_size: [256, 192] 17 | 18 | solver: 19 | type: SolverMultiTaskDev 20 | 21 | 22 | lr_scheduler: 23 | type: 'Step' 24 | kwargs: 25 | base_lr: 1.0e-4 26 | warmup_steps: 500 27 | warmup_lr: 1.0e-2 #5.0e-4 28 | lr_mults: [0.1, 0.1] 29 | lr_steps: [31640, 40077] # 75% 95% 30 | 31 | backbone_multiplier: 1.0 32 | optimizer: 33 | type: SGD 34 | kwargs: 35 | weight_decay: 0.0005 36 | nesterov: False 37 | 38 | layer_decay: 39 | # layer decay 40 | num_layers: 12 41 | layer_decay_rate: 0.75 42 | lpe_lr: True 43 | 44 | auto_denan: False 45 | 46 | workers: 2 47 | max_iter: 42187 # (90000 * 30) / 64 48 | 49 | deterministic: True # seed control 50 | cudnn_deterministic: True 51 | worker_rank: True 52 | random_seed: 42 53 | 54 | print_freq: 10 55 | vis_batch: False 56 | save_interval: 60000 57 | 58 | use_ceph: True 59 | sync: True 60 | 61 | # task_specific_param = ['backbone', 'neck', 'decoder', 'dataset', 'sampler', 'lr_scheduler', 'optimizer'] 62 | tasks : # prefix 63 | 0: # prefix 64 | name: pedattr 65 | loss_weight: 1.0 66 | gres_ratio: 1 # int, > 0| world/sum*ratio 67 | dataset: 68 | type: AttrDataset 69 | kwargs: 70 | task_spec: 71 | dataset: 'PA-100k' 72 | data_path: shlg:s3://pedattr_public/PA-100k/dataset.pkl 73 | root_path: shlg:s3://pedattr_public/PA-100k/data/ 74 | augmentation: 75 | height: 256 76 | width: 192 77 | use_random_aug: False 78 | sampler: 79 | batch_size: 32 # per card 80 | shuffle_strategy: 1 81 | neck: 82 | type: DoNothing 83 | kwargs: {} 84 | # kwargs: 85 | # vis_token_dim: 256 86 | # mask_dim: 256 87 | decoder: # todo: coco instance seg config for now 88 | type: pedattr_cls_vit_A 89 | kwargs: 90 | out_feature: 768 91 | nattr: 26 92 | loss_cfg: 93 | type: CEL_Sigmoid 94 | kwargs: 95 | sample_weight: [0.04354444,0.17997778,0.5834,0.4166,0.04947778,0.15104444, 96 | 0.10775556,0.04191111,0.00472222,0.01688889, 0.03241111, 97 | 0.71171111,0.17344444,0.11484444, 0.006, 98 | 0.185, 0.19273333, 0.1601, 0.00952222, 0.01345556, 99 | 0.92437778, 0.06216667, 0.46044444, 0.35266667, 0.29462222, 100 | 0.35271111] 101 | size_average: True 102 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/attr/pedattr_pa100k_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -x 3 | source pavi_env 4 | 5 | # source /mnt/lustre/share/spring/r0.3.0 6 | ROOT=../../../../ 7 | export PYTHONPATH=$ROOT:$PYTHONPATH 8 | 9 | if [[ ! -d "eval_logs" ]]; then 10 | mkdir eval_logs 11 | fi 12 | 13 | ################ 14 | gpus=${1-1} 15 | job_name=${2-pa100k_vitbase_SGD_lr1e2x1_stepLRx2_wd5e4_backboneclip_dpr03_30ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 16 | CONFIG=${3-pa100k_vitbase_SGD_lr1e2x1_stepLRx2_wd5e4_backboneclip_dpr03_30ep.yaml} 17 | TEST_CONFIG=${4-pedattr_pa100k_test.yaml} 18 | GINFO_INDEX=${5-0} # task index config cherrypick (if necessary) 19 | TEST_MODEL=${6-'/mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_samll_setting_attr_FT/checkpoints/pa100k_vitbase_SGD_lr1e2x1_stepLRx2_wd5e4_backboneclip_dpr03_30ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion/ckpt_task0_iter_newest.pth.tar'} 20 | ################ 21 | 22 | g=$((${gpus}<8?${gpus}:8)) 23 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 24 | 25 | LOG_FILE=eval_logs/${job_name}.log 26 | now=$(date +"%Y%m%d_%H%M%S") 27 | if [[ -f ${LOG_FILE} ]]; then 28 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 29 | mv ${LOG_FILE} ${LOG_FILE}_${now} 30 | fi 31 | echo 'log file: ' ${LOG_FILE} 32 | 33 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 34 | srun -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=auto \ 35 | --job-name=${job_name} --comment wbsR-SC220052.001 --cpus-per-task=5 \ 36 | python -W ignore -u ${ROOT}/test.py \ 37 | --expname ${job_name} \ 38 | --config ${CONFIG} \ 39 | --test_config ${TEST_CONFIG} \ 40 | --spec_ginfo_index ${GINFO_INDEX} \ 41 | --load-path=${TEST_MODEL} \ 42 | 2>&1 | tee ${LOG_FILE} 43 | 44 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/attr/pedattr_pa100k_test.yaml: -------------------------------------------------------------------------------- 1 | common: 2 | backbone: 3 | kwargs: 4 | test_pos_mode: learnable # simple_interpolate 5 | tester: 6 | type: TesterMultiTaskDev 7 | use_ceph: True 8 | sync: True 9 | collate: dev 10 | 11 | tasks: 12 | 0: 13 | name: pedattrTest 14 | loss_weight: 1.0 15 | gres_ratio: 1 # int, > 0| world/sum*ratio 16 | dataset: 17 | type: AttrDataset 18 | kwargs: 19 | task_spec: 20 | dataset: 'PA-100k' 21 | data_path: shlg:s3://pedattr_public/PA-100k/dataset.pkl 22 | root_path: shlg:s3://pedattr_public/PA-100k/data/ 23 | augmentation: 24 | height: 256 25 | width: 192 26 | train: False 27 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/attr/pedattr_peta_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -x 3 | source pavi_env 4 | 5 | # source /mnt/lustre/share/spring/r0.3.0 6 | ROOT=../../../../ 7 | export PYTHONPATH=$ROOT:$PYTHONPATH 8 | 9 | if [[ ! -d "eval_logs" ]]; then 10 | mkdir eval_logs 11 | fi 12 | 13 | ################ 14 | gpus=${1-1} 15 | job_name=${2-peta_vitbase_SGD_lr1e2x1_stepLRx2_wd1e4_dpr01_80ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 16 | CONFIG=${3-peta_vitbase_SGD_lr1e2x1_stepLRx2_wd1e4_dpr01_80ep.yaml} 17 | TEST_CONFIG=${4-pedattr_peta_test.yaml} 18 | GINFO_INDEX=${5-0} # task index config cherrypick (if necessary) 19 | TEST_MODEL=${6-'/mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_samll_setting_attr_FT/checkpoints/peta_vitbase_SGD_lr1e2x1_stepLRx2_wd1e4_dpr01_80ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion/ckpt_task0_iter_newest.pth.tar'} 20 | ################ 21 | 22 | g=$((${gpus}<8?${gpus}:8)) 23 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 24 | 25 | 26 | LOG_FILE=eval_logs/${job_name}.log 27 | now=$(date +"%Y%m%d_%H%M%S") 28 | if [[ -f ${LOG_FILE} ]]; then 29 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 30 | mv ${LOG_FILE} ${LOG_FILE}_${now} 31 | fi 32 | echo 'log file: ' ${LOG_FILE} 33 | 34 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 35 | srun -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=auto \ 36 | --job-name=${job_name} --comment wbsR-SC220052.001 --cpus-per-task=5 \ 37 | python -W ignore -u ${ROOT}/test.py \ 38 | --expname ${job_name} \ 39 | --config ${CONFIG} \ 40 | --test_config ${TEST_CONFIG} \ 41 | --spec_ginfo_index ${GINFO_INDEX} \ 42 | --load-path=${TEST_MODEL} \ 43 | 2>&1 | tee ${LOG_FILE} -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/attr/pedattr_peta_test.yaml: -------------------------------------------------------------------------------- 1 | common: 2 | backbone: 3 | kwargs: 4 | test_pos_mode: learnable # simple_interpolate 5 | tester: 6 | type: TesterMultiTaskDev 7 | use_ceph: True 8 | sync: True 9 | collate: dev 10 | 11 | tasks: 12 | 0: 13 | name: pedattrTest 14 | loss_weight: 1.0 15 | gres_ratio: 1 # int, > 0| world/sum*ratio 16 | dataset: 17 | type: AttrDataset 18 | kwargs: 19 | task_spec: 20 | dataset: 'peta' 21 | data_path: shlg:s3://pedattr_public/peta/dataset.pkl 22 | root_path: shlg:s3://pedattr_public/peta/images/ 23 | augmentation: 24 | height: 256 25 | width: 192 26 | train: False 27 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/attr/peta_train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source pavi_env 3 | # set -x 4 | 5 | # source /mnt/lustre/share/spring/r0.3.0 6 | ROOT=../../../../ 7 | export PYTHONPATH=$ROOT:$PYTHONPATH 8 | 9 | if [[ ! -d "logs" ]]; then 10 | mkdir logs 11 | fi 12 | 13 | ################ 14 | gpus=${1-2} 15 | job_name=${2-peta_vitbase_SGD_lr1e2x1_stepLRx2_wd1e4_dpr01_80ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 16 | CONFIG=${3-peta_vitbase_SGD_lr1e2x1_stepLRx2_wd1e4_dpr01_80ep.yaml} 17 | ################ 18 | 19 | g=$((${gpus}<8?${gpus}:8)) 20 | echo 'start job:' ${job_name} ' config:' ${CONFIG} 21 | 22 | 23 | LOG_FILE=logs/${job_name}.log 24 | now=$(date +"%Y%m%d_%H%M%S") 25 | if [[ -f ${LOG_FILE} ]]; then 26 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 27 | mv ${LOG_FILE} ${LOG_FILE}_${now} 28 | fi 29 | echo 'log file: ' ${LOG_FILE} 30 | 31 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 32 | srun -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=auto \ 33 | --job-name=${job_name} --cpus-per-task=5 --phx-priority P0 --comment wbsR-SC220052.001 -x SH-IDC1-10-5-40-[177,64,238,107,163,168,171,162,165,134,136,248,239,114,136,161,164,245,186,64,44,86,87,88],SH-IDC1-10-5-41-[3,4] \ 34 | python -W ignore -u ${ROOT}/multitask.py \ 35 | --expname ${job_name} \ 36 | --config ${CONFIG} \ 37 | --auto-resume=checkpoints/${job_name}/ckpt_task_iter_newest.pth.tar \ 38 | 2>&1 | tee ${LOG_FILE} 39 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/attr/peta_vitbase_SGD_lr1e2x1_stepLRx2_wd1e4_dpr01_80ep.yaml: -------------------------------------------------------------------------------- 1 | out_dir: /mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_samll_setting_attr_FT 2 | 3 | common: # prefix 4 | project_name: L2_samll_setting_attr_FT 5 | 6 | backbone: 7 | type: vit_base_patch16 8 | kwargs: 9 | task_sp_list: ['pos_embed', 'rel_pos_h', 'rel_pos_w'] 10 | pretrained: True 11 | pretrain_path: '/mnt/lustre/chencheng1/expr_files/vitruvian/devL2/transed_ckpt_for_pretrain/devL2_small_setting/reid/vitbase_lr1e3_StepLRx3_backboneclip_bmp08_ld75_pose_dpr03_dcLN_par_dpr03_dcBN_attr_dpr01_reid_clstoken_dpr0_LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion.pth' 12 | load_pos_embed: True 13 | pos_embed_interp: False 14 | learnable_pos: True 15 | window: False 16 | drop_path_rate: 0.1 17 | img_size: [256, 192] 18 | 19 | solver: 20 | type: SolverMultiTaskDev 21 | 22 | lr_scheduler: 23 | type: 'Step' 24 | kwargs: 25 | base_lr: 1.0e-4 26 | warmup_steps: 500 27 | warmup_lr: 1.0e-2 #5.0e-4 28 | lr_mults: [0.1, 0.1] 29 | lr_steps: [10687, 12825] # 75% 90% 30 | 31 | backbone_multiplier: 1.0 32 | optimizer: 33 | type: SGD 34 | kwargs: 35 | weight_decay: 0.0001 36 | nesterov: False 37 | 38 | layer_decay: 39 | # layer decay 40 | num_layers: 12 41 | layer_decay_rate: 0.75 42 | lpe_lr: True 43 | 44 | auto_denan: False 45 | 46 | workers: 2 47 | max_iter: 14250 # 60ep (11400 * 60) / 64 48 | 49 | deterministic: True # seed control 50 | cudnn_deterministic: True 51 | worker_rank: True 52 | random_seed: 42 53 | 54 | print_freq: 10 55 | vis_batch: False 56 | save_interval: 60000 57 | 58 | use_ceph: True 59 | sync: True 60 | 61 | # task_specific_param = ['backbone', 'neck', 'decoder', 'dataset', 'sampler', 'lr_scheduler', 'optimizer'] 62 | tasks : # prefix 63 | 0: # prefix 64 | name: pedattr 65 | loss_weight: 1.0 66 | gres_ratio: 1 # int, > 0| world/sum*ratio 67 | dataset: 68 | type: AttrDataset 69 | kwargs: 70 | task_spec: 71 | dataset: 'peta' 72 | data_path: shlg:s3://pedattr_public/peta/dataset.pkl 73 | root_path: shlg:s3://pedattr_public/peta/images/ 74 | augmentation: 75 | height: 256 76 | width: 192 77 | use_random_aug: False 78 | sampler: 79 | batch_size: 32 # per card 80 | shuffle_strategy: 1 81 | neck: 82 | type: DoNothing 83 | kwargs: {} 84 | # kwargs: 85 | # vis_token_dim: 256 86 | # mask_dim: 256 87 | decoder: # todo: coco instance seg config for now 88 | type: pedattr_cls_vit_A 89 | kwargs: 90 | out_feature: 768 91 | nattr: 35 92 | loss_cfg: 93 | type: CEL_Sigmoid 94 | kwargs: 95 | sample_weight: [0.10570175, 0.08438596, 0.74526316, 0.02929825, 0.23763158, 96 | 0.85192982, 0.13491228, 0.06842105, 0.04096491, 0.02649123, 97 | 0.14078947, 0.01754386, 0.08421053, 0.45614035, 0.01263158, 98 | 0.86052632, 0.13763158, 0.30701754, 0.035 , 0.045 , 99 | 0.51210526, 0.29938596, 0.02140351, 0.36210526, 0.21324561, 100 | 0.19631579, 0.19807018, 0.29333333, 0.27649123, 0.07614035, 101 | 0.4922807 , 0.33385965, 0.10219298, 0.06236842, 0.55035088] 102 | size_average: True 103 | 104 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/ATR_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep.yaml: -------------------------------------------------------------------------------- 1 | out_dir: /mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_samll_setting_parsing_FT 2 | 3 | common: # prefix 4 | project_name: L2_samll_setting_parsing_FT 5 | model_entry_type: backbone_aio_entry 6 | solver: 7 | type: SolverMultiTaskDev 8 | 9 | lr_scheduler: 10 | type: 'WarmupCosine' 11 | kwargs: 12 | base_lr: 5e-4 13 | warmup_factor: 0.01 14 | warmup_iters: 1500 15 | warmup_method: linear 16 | 17 | backbone_multiplier: 0.8 18 | optimizer: 19 | type: AdamWWithBackboneClipDev 20 | kwargs: 21 | clip_norm: 0.01 22 | norm_type: 2 23 | betas: [0.9, 0.999] 24 | weight_decay: 0.1 25 | 26 | layer_decay: 27 | # layer decay 28 | num_layers: 12 29 | layer_decay_rate: 0.75 30 | lpe_lr: True 31 | 32 | auto_denan: False 33 | 34 | workers: 2 35 | max_iter: 22100 # 20ep 4card 17706 images / (20 * 17706) / (4 * 4) 36 | 37 | deterministic: True # seed control 38 | cudnn_deterministic: False 39 | worker_rank: True 40 | random_seed: 42 41 | 42 | print_freq: 10 43 | vis_batch: False 44 | save_interval: 30000 45 | 46 | use_ceph: True 47 | sync: True 48 | 49 | # task_specific_param = ['backbone', 'neck', 'decoder', 'dataset', 'sampler', 'lr_scheduler', 'optimizer'] 50 | tasks : # prefix 51 | 0: # prefix 52 | name: ATR_parsing 53 | loss_weight: 1.0 54 | gres_ratio: 1 # int, > 0, = Task_GPUs / (world_Size/sum(all_gres_ratios)) 55 | backbone: 56 | type: vit_base_patch16 57 | kwargs: 58 | task_sp_list: ['pos_embed', 'rel_pos_h', 'rel_pos_w'] # wrong list would somehow cause .cuda() stuck without error 59 | pretrained: True 60 | pretrain_path: '/mnt/lustre/chencheng1/expr_files/vitruvian/devL2/transed_ckpt_for_pretrain/devL2_small_setting/parsing/vitbase_lr1e3_StepLRx3_backboneclip_bmp08_ld75_pose_dpr03_dcLN_par_dpr03_dcBN_attr_dpr01_reid_clstoken_dpr0_LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion.pth' 61 | load_pos_embed: True 62 | pos_embed_interp: False 63 | learnable_pos: True 64 | window: False 65 | drop_path_rate: 0.3 66 | img_size: 480 67 | 68 | dataset: 69 | type: ATRParsingDataset 70 | kwargs: 71 | data_path: /mnt/lustrenew/share_data/viface/vitruvian/L1_benchmark/human_parsing/ATR # files in core/data/datasets/images/resources/* or absolute path 72 | cfg: 73 | is_flip: True 74 | crop_size: [480, 480] 75 | is_multi_scale: True 76 | scale_factor: 11 77 | center_crop_test: False 78 | base_size: 480 79 | # mean: [0.485, 0.456, 0.406] 80 | # std: [0.229, 0.224, 0.225] 81 | eval_crop_size: [480, 480] 82 | 83 | #### 84 | ignore_value: 255 # duplicated with decoder.kwargs.ignore_value 85 | num_classes: 18 86 | label_list: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,] 87 | # reduce_zero_label: True 88 | 89 | sampler: 90 | batch_size: 4 # per card 91 | shuffle_strategy: 1 92 | 93 | neck: 94 | type: DoNothing 95 | kwargs: {} 96 | 97 | decoder: # todo: coco instance seg config for now 98 | type: ViT_SimpleUpSampling 99 | kwargs: 100 | task: par 101 | input_size: [480,480] 102 | in_channels: 768 103 | num_classes: 18 104 | bn_type: torchbn 105 | loss_cfg: 106 | type: FSCELoss 107 | kwargs: 108 | configer: 109 | ce_reduction: elementwise_mean 110 | ce_ignore_index: 255 -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/ATR_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source pavi_env 4 | # set -x 5 | 6 | # source /mnt/lustre/share/spring/r0.3.0 7 | ROOT=../../../../ 8 | export PYTHONPATH=$ROOT:$PYTHONPATH 9 | 10 | if [[ ! -d "ATR_parsing_eval_logs" ]]; then 11 | mkdir ATR_parsing_eval_logs 12 | fi 13 | 14 | ################ 15 | gpus=${1-1} 16 | job_name=${2-ATR_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 17 | CONFIG=${3-ATR_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep.yaml} 18 | TEST_CONFIG=${4-ATR_test.yaml} 19 | GINFO_INDEX=${5-0} # task index config cherrypick (if necessary) 20 | TEST_MODEL=${6-'/mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_samll_setting_parsing_FT/checkpoints/ATR_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion/ckpt_task0_iter_newest.pth.tar'} 21 | ################ 22 | 23 | g=$((${gpus}<8?${gpus}:8)) 24 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 25 | 26 | 27 | LOG_FILE=ATR_parsing_eval_logs/test_${job_name}.log 28 | now=$(date +"%Y%m%d_%H%M%S") 29 | if [[ -f ${LOG_FILE} ]]; then 30 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 31 | mv ${LOG_FILE} ${LOG_FILE}_${now} 32 | fi 33 | echo 'log file: ' ${LOG_FILE} 34 | 35 | 36 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 37 | srun -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=auto \ 38 | --job-name=${job_name} --cpus-per-task=5 --comment wbsR-SC220052.001 -x SH-IDC1-10-5-40-[238,107,163,168,171,162,165,134,136,248,239,114,136,161,164,245,186],SH-IDC1-10-5-41-[3,4] \ 39 | python -W ignore -u ${ROOT}/test.py \ 40 | --expname ${job_name} \ 41 | --config ${CONFIG} \ 42 | --test_config ${TEST_CONFIG} \ 43 | --spec_ginfo_index ${GINFO_INDEX} \ 44 | --load-path=${TEST_MODEL} \ 45 | 2>&1 | tee ${LOG_FILE} 46 | 47 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/ATR_test.yaml: -------------------------------------------------------------------------------- 1 | common: 2 | paroject_name: ATR_parsing_test 3 | backbone: 4 | kwargs: 5 | test_pos_mode: learnable 6 | tester: 7 | type: TesterMultiTaskDev 8 | use_ceph: True 9 | sync: True 10 | collate: dev 11 | 12 | # task_specific_param = ['backbone', 'neck', 'decoder', 'dataset', 'sampler', 'lr_scheduler', 'optimizer'] 13 | tasks: 14 | 0: 15 | name: ParTest 16 | loss_weight: 1.0 # *redundant* 17 | gres_ratio: 1 # int, > 0| world/sum*ratio, *redundant* 18 | dataset: 19 | type: ATRParsingDataset 20 | kwargs: 21 | data_path: /mnt/lustrenew/share_data/viface/vitruvian/L1_benchmark/human_parsing/ATR 22 | data_use_ratio: 1 23 | dataset: val 24 | is_train: False 25 | cfg: 26 | # mean: [ 0.485, 0.456, 0.406 ] 27 | # std: [ 0.229, 0.224, 0.225 ] 28 | eval_crop_size: [ 480, 480 ] 29 | is_flip: False 30 | is_multi_scale: False 31 | 32 | ignore_value: 255 # TODO: duplicated with decoder.kwargs.ignore_value 33 | num_classes: 18 34 | label_list: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ] 35 | 36 | sampler: 37 | batch_size: 4 # per card 38 | 39 | # extra: 40 | # min_sizes: [320, 480, 640, 800, 960, 1120] # TTA 41 | # max_size: 4480 42 | # flip: True 43 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/ATR_train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source pavi_env 3 | set -x 4 | 5 | # source /mnt/lustre/share/spring/r0.3.0 6 | ROOT=../../../../ 7 | export PYTHONPATH=$ROOT:$PYTHONPATH 8 | 9 | if [[ ! -d "logs" ]]; then 10 | mkdir logs 11 | fi 12 | 13 | ################ 14 | gpus=${1-4} 15 | job_name=${2-ATR_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 16 | CONFIG=${3-ATR_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep.yaml} 17 | ################ 18 | 19 | g=$((${gpus}<8?${gpus}:8)) 20 | echo 'start job:' ${job_name} ' config:' ${CONFIG} 21 | 22 | AutoResume=checkpoints/${job_name}/ckpt_task_iter_newest.pth.tar 23 | 24 | LOG_FILE=logs/${job_name}.log 25 | now=$(date +"%Y%m%d_%H%M%S") 26 | if [[ -f ${LOG_FILE} ]]; then 27 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 28 | mv ${LOG_FILE} ${LOG_FILE}_${now} 29 | fi 30 | echo 'log file: ' ${LOG_FILE} 31 | 32 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 33 | srun -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=reserved \ 34 | --job-name=${job_name} --cpus-per-task=5 --comment wbsR-SC220052.001 -x SH-IDC1-10-5-40-[166,170,238,107,163,168,171,162,165,134,136,248,239,114,136,161,164,245,186,64],SH-IDC1-10-5-41-[3,4] \ 35 | python -W ignore -u ${ROOT}/multitask.py \ 36 | --expname ${job_name} \ 37 | --config ${CONFIG} \ 38 | --auto-resume=checkpoints/${job_name}/ckpt_task_iter_newest.pth.tar \ 39 | 2>&1 | tee ${LOG_FILE} 40 | 41 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/CIHP_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep.yaml: -------------------------------------------------------------------------------- 1 | out_dir: /mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_samll_setting_parsing_FT 2 | 3 | common: # prefix 4 | project_name: L2_samll_setting_parsing_FT 5 | model_entry_type: backbone_aio_entry 6 | solver: 7 | type: SolverMultiTaskDev 8 | 9 | lr_scheduler: 10 | type: 'WarmupCosine' 11 | kwargs: 12 | base_lr: 5e-4 13 | warmup_factor: 0.01 14 | warmup_iters: 1500 15 | warmup_method: linear 16 | 17 | backbone_multiplier: 0.8 18 | optimizer: 19 | type: AdamWWithBackboneClipDev 20 | kwargs: 21 | clip_norm: 0.01 22 | norm_type: 2 23 | betas: [0.9, 0.999] 24 | weight_decay: 0.1 25 | 26 | layer_decay: 27 | # layer decay 28 | num_layers: 12 29 | layer_decay_rate: 0.75 30 | lpe_lr: True 31 | 32 | auto_denan: False 33 | 34 | workers: 2 35 | max_iter: 35000 # (20 * 28280) / (4 * 4) 36 | 37 | deterministic: True # seed control 38 | cudnn_deterministic: False 39 | worker_rank: True 40 | random_seed: 42 41 | 42 | print_freq: 10 43 | vis_batch: False 44 | save_interval: 70000 45 | 46 | use_ceph: True 47 | sync: True 48 | 49 | # task_specific_param = ['backbone', 'neck', 'decoder', 'dataset', 'sampler', 'lr_scheduler', 'optimizer'] 50 | tasks : # prefix 51 | 0: # prefix 52 | name: cihp_parsing 53 | loss_weight: 1.0 54 | gres_ratio: 1 # int, > 0, = Task_GPUs / (world_Size/sum(all_gres_ratios)) 55 | backbone: 56 | type: vit_base_patch16 57 | kwargs: 58 | task_sp_list: ['pos_embed', 'rel_pos_h', 'rel_pos_w'] # wrong list would somehow cause .cuda() stuck without error 59 | pretrained: True 60 | pretrain_path: '/mnt/lustre/chencheng1/expr_files/vitruvian/devL2/transed_ckpt_for_pretrain/devL2_small_setting/parsing/vitbase_lr1e3_StepLRx3_backboneclip_bmp08_ld75_pose_dpr03_dcLN_par_dpr03_dcBN_attr_dpr01_reid_clstoken_dpr0_LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion.pth' 61 | load_pos_embed: True 62 | pos_embed_interp: False 63 | learnable_pos: True 64 | window: False 65 | drop_path_rate: 0.3 66 | img_size: 480 67 | 68 | dataset: 69 | type: CIHPParsingDataset 70 | kwargs: 71 | data_path: shlg:s3://parsing_public/CIHP # files in core/data/datasets/images/resources/* or absolute path 72 | cfg: 73 | is_flip: True 74 | crop_size: [480, 480] 75 | is_multi_scale: True 76 | scale_factor: 11 77 | center_crop_test: False 78 | base_size: 480 79 | eval_crop_size: [480, 480] 80 | ignore_value: 255 # duplicated with decoder.kwargs.ignore_value 81 | num_classes: 20 82 | label_list: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] 83 | 84 | sampler: 85 | batch_size: 4 # per card 86 | shuffle_strategy: 1 87 | 88 | neck: 89 | type: DoNothing 90 | kwargs: {} 91 | 92 | decoder: # todo: coco instance seg config for now 93 | type: ViT_OCR_V2 94 | kwargs: 95 | type: ViT_SimpleUpSampling 96 | kwargs: 97 | task: par 98 | input_size: [480,480] 99 | in_channels: 768 100 | num_classes: 20 101 | bn_type: torchbn 102 | loss_cfg: 103 | type: FSCELoss 104 | kwargs: 105 | configer: 106 | ce_reduction: elementwise_mean 107 | ce_ignore_index: 255 108 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/CIHP_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source pavi_env 4 | set -x 5 | 6 | # source /mnt/lustre/share/spring/r0.3.0 7 | ROOT=../../../../ 8 | export PYTHONPATH=$ROOT:$PYTHONPATH 9 | 10 | if [[ ! -d "CIHP_parsing_eval_logs" ]]; then 11 | mkdir CIHP_parsing_eval_logs 12 | fi 13 | 14 | ################ 15 | gpus=${1-1} 16 | job_name=${2-CIHP_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 17 | CONFIG=${3-CIHP_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep.yaml} 18 | TEST_CONFIG=${4-CIHP_test.yaml} 19 | GINFO_INDEX=${5-0} # task index config cherrypick (if necessary) 20 | TEST_MODEL=${6-'/mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_samll_setting_parsing_FT/checkpoints/CIHP_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion/ckpt_task0_iter_newest.pth.tar'} 21 | ################ 22 | 23 | g=$((${gpus}<8?${gpus}:8)) 24 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 25 | 26 | 27 | LOG_FILE=CIHP_parsing_eval_logs/${job_name}.log 28 | now=$(date +"%Y%m%d_%H%M%S") 29 | if [[ -f ${LOG_FILE} ]]; then 30 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 31 | mv ${LOG_FILE} ${LOG_FILE}_${now} 32 | fi 33 | echo 'log file: ' ${LOG_FILE} 34 | 35 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 36 | srun -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=auto \ 37 | --job-name=${job_name} --preempt --comment wbsR-SC220052.001 --cpus-per-task=5 \ 38 | python -W ignore -u ${ROOT}/test.py \ 39 | --expname ${job_name} \ 40 | --config ${CONFIG} \ 41 | --test_config ${TEST_CONFIG} \ 42 | --spec_ginfo_index ${GINFO_INDEX} \ 43 | --load-path=${TEST_MODEL} \ 44 | 2>&1 | tee ${LOG_FILE} 45 | 46 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/CIHP_test.yaml: -------------------------------------------------------------------------------- 1 | common: 2 | project_name: parsing_test 3 | backbone: 4 | kwargs: 5 | test_pos_mode: learnable 6 | tester: 7 | type: TesterMultiTaskDev 8 | use_ceph: True 9 | sync: True 10 | collate: dev 11 | 12 | # task_specific_param = ['backbone', 'neck', 'decoder', 'dataset', 'sampler', 'lr_scheduler', 'optimizer'] 13 | tasks: 14 | 0: 15 | name: ParTest 16 | loss_weight: 1.0 # *redundant* 17 | gres_ratio: 1 # int, > 0| world/sum*ratio, *redundant* 18 | dataset: 19 | type: CIHPParsingDataset 20 | kwargs: 21 | data_path: shlg:s3://parsing_public/CIHP 22 | dataset: val 23 | is_train: False 24 | cfg: 25 | # mean: [ 0.485, 0.456, 0.406 ] 26 | # std: [ 0.229, 0.224, 0.225 ] 27 | eval_crop_size: [ 480, 480 ] 28 | is_flip: False 29 | is_multi_scale: False 30 | 31 | ignore_value: 255 # TODO: duplicated with decoder.kwargs.ignore_value 32 | num_classes: 20 33 | label_list: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ] 34 | 35 | sampler: 36 | batch_size: 4 # per card 37 | 38 | # extra: 39 | # min_sizes: [320, 480, 640, 800, 960, 1120] # TTA 40 | # max_size: 4480 41 | # flip: True 42 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/CIHP_train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source pavi_env 3 | set -x 4 | 5 | # source /mnt/lustre/share/spring/r0.3.0 6 | ROOT=../../../../ 7 | export PYTHONPATH=$ROOT:$PYTHONPATH 8 | 9 | if [[ ! -d "logs" ]]; then 10 | mkdir logs 11 | fi 12 | 13 | ################ 14 | gpus=${1-4} 15 | job_name=${2-CIHP_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 16 | CONFIG=${3-CIHP_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep.yaml} 17 | ################ 18 | 19 | g=$((${gpus}<8?${gpus}:8)) 20 | echo 'start job:' ${job_name} ' config:' ${CONFIG} 21 | 22 | AutoResume=checkpoints/${job_name}/ckpt_task_iter_newest.pth.tar 23 | 24 | LOG_FILE=logs/${job_name}.log 25 | now=$(date +"%Y%m%d_%H%M%S") 26 | if [[ -f ${LOG_FILE} ]]; then 27 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 28 | mv ${LOG_FILE} ${LOG_FILE}_${now} 29 | fi 30 | echo 'log file: ' ${LOG_FILE} 31 | 32 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 33 | srun -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=reserved \ 34 | --job-name=${job_name} --cpus-per-task=5 --comment wbsR-SC220052.001 -x SH-IDC1-10-5-40-[189,190,177,178,238,107,163,168,171,162,165,134,136,248,239,114,136,161,164,245,186,64],SH-IDC1-10-5-41-[3,4] \ 35 | python -W ignore -u ${ROOT}/multitask.py \ 36 | --expname ${job_name} \ 37 | --config ${CONFIG} \ 38 | --auto-resume=checkpoints/${job_name}/ckpt_task_iter_newest.pth.tar \ 39 | 2>&1 | tee ${LOG_FILE} 40 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/h36m_FT_vitbase_pos_embed_b4_lr5e4x08_backboneclip_wd01_cosineLR_ld75_dpr03_sz480_10ep.yaml: -------------------------------------------------------------------------------- 1 | out_dir: /mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_samll_setting_parsing_FT 2 | 3 | common: # prefix 4 | project_name: L2_samll_setting_parsing_FT 5 | model_entry_type: backbone_aio_entry 6 | solver: 7 | type: SolverMultiTaskDev 8 | 9 | lr_scheduler: 10 | type: 'WarmupCosine' 11 | kwargs: 12 | base_lr: 5e-4 13 | warmup_factor: 0.01 14 | warmup_iters: 1500 15 | warmup_method: linear 16 | 17 | backbone_multiplier: 0.8 18 | optimizer: 19 | type: AdamWWithBackboneClipDev 20 | kwargs: 21 | clip_norm: 0.01 22 | norm_type: 2 23 | betas: [0.9, 0.999] 24 | weight_decay: 0.1 25 | 26 | layer_decay: 27 | # layer decay 28 | num_layers: 12 29 | layer_decay_rate: 0.75 30 | lpe_lr: True 31 | 32 | auto_denan: False 33 | 34 | workers: 2 35 | max_iter: 40000 # (10 * 62668) / (4 * 4) = 39167.5 36 | 37 | deterministic: True # seed control 38 | cudnn_deterministic: False 39 | worker_rank: True 40 | random_seed: 42 41 | 42 | print_freq: 10 43 | vis_batch: False 44 | save_interval: 70000 45 | 46 | use_ceph: True 47 | sync: True 48 | 49 | # task_specific_param = ['backbone', 'neck', 'decoder', 'dataset', 'sampler', 'lr_scheduler', 'optimizer'] 50 | tasks : # prefix 51 | 0: # prefix 52 | name: h36m_parsing 53 | loss_weight: 1.0 54 | gres_ratio: 1 # int, > 0, = Task_GPUs / (world_Size/sum(all_gres_ratios)) 55 | backbone: 56 | type: vit_base_patch16 57 | kwargs: 58 | task_sp_list: ['pos_embed', 'rel_pos_h', 'rel_pos_w'] # wrong list would somehow cause .cuda() stuck without error 59 | pretrained: True 60 | pretrain_path: '/mnt/lustre/chencheng1/expr_files/vitruvian/devL2/transed_ckpt_for_pretrain/devL2_small_setting/parsing/vitbase_lr1e3_StepLRx3_backboneclip_bmp08_ld75_pose_dpr03_dcLN_par_dpr03_dcBN_attr_dpr01_reid_clstoken_dpr0_LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion.pth' 61 | load_pos_embed: True 62 | pos_embed_interp: False 63 | learnable_pos: True 64 | window: False 65 | drop_path_rate: 0.3 66 | img_size: 480 67 | 68 | dataset: 69 | type: Human3M6ParsingDataset 70 | kwargs: 71 | data_path: shlg:s3://parsing_public/human3.6 # files in core/data/datasets/images/resources/* or absolute path 72 | cfg: 73 | is_flip: True 74 | crop_size: [480, 480] 75 | is_multi_scale: True 76 | scale_factor: 11 77 | center_crop_test: False 78 | base_size: 480 79 | eval_crop_size: [480, 480] 80 | ignore_value: 255 # duplicated with decoder.kwargs.ignore_value 81 | num_classes: 25 82 | label_list: [0, 1, 2, 3, 6, 7, 8, 17, 18, 19, 25, 26, 27, 32, 33, 34, 38, 39, 43, 44, 83 | 46, 49, 50, 56, 58] 84 | 85 | 86 | sampler: 87 | batch_size: 4 # per card 88 | shuffle_strategy: 1 89 | 90 | neck: 91 | type: DoNothing 92 | kwargs: {} 93 | 94 | decoder: # todo: coco instance seg config for now 95 | type: ViT_OCR_V2 96 | kwargs: 97 | task: par 98 | input_size: [ 480,480 ] 99 | in_channels: 768 100 | num_classes: 25 101 | bn_type: torchbn 102 | loss_cfg: 103 | type: FSAuxCELoss 104 | kwargs: 105 | configer: 106 | loss_weights: 107 | aux_loss: 0.4 108 | seg_loss: 1.0 109 | ce_reduction: elementwise_mean 110 | ce_ignore_index: 255 111 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/h36m_parsing_eval_logs/test_h36m_FT_vitbase_pos_embed_b4_lr5e4x08_backboneclip_wd01_cosineLR_ld75_dpr03_sz480_10ep__MAE.log_20220926_113804: -------------------------------------------------------------------------------- 1 | h36m_test.sh: line 47: O_INDEX}: command not found 2 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/h36m_parsing_eval_logs/test_h36m_FT_vitbase_pos_embed_b4_lr5e4x08_backboneclip_wd01_cosineLR_ld75_dpr03_sz480_10ep___SmallSetting___LSA_10p_small_setting5_add_posetrack_DGMarket.log_20220928_101304: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/h36m_parsing_eval_logs/test_h36m_FT_vitbase_pos_embed_b4_lr5e4x08_backboneclip_wd01_cosineLR_ld75_dpr03_sz480_10ep___SmallSetting___LSA_10p_small_setting5_add_posetrack_DGMarket.log_20220928_101304 -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/h36m_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source pavi_env 4 | # set -x 5 | 6 | # source /mnt/lustre/share/spring/r0.3.0 7 | ROOT=../../../../ 8 | export PYTHONPATH=$ROOT:$PYTHONPATH 9 | 10 | if [[ ! -d "h36m_parsing_eval_logs" ]]; then 11 | mkdir h36m_parsing_eval_logs 12 | fi 13 | 14 | ################ 15 | gpus=${1-1} 16 | job_name=${2-h36m_FT_vitbase_pos_embed_b4_lr5e4x08_backboneclip_wd01_cosineLR_ld75_dpr03_sz480_10ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 17 | CONFIG=${3-h36m_FT_vitbase_pos_embed_b4_lr5e4x08_backboneclip_wd01_cosineLR_ld75_dpr03_sz480_10ep.yaml} 18 | TEST_CONFIG=${4-h36m_test.yaml} 19 | GINFO_INDEX=${5-0} # task index config cherrypick (if necessary) 20 | TEST_MODEL=${6-'/mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_samll_setting_parsing_FT/checkpoints/h36m_FT_vitbase_pos_embed_b4_lr5e4x08_backboneclip_wd01_cosineLR_ld75_dpr03_sz480_10ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion/ckpt_task0_iter_newest.pth.tar'} 21 | ################ 22 | 23 | g=$((${gpus}<8?${gpus}:8)) 24 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 25 | 26 | 27 | LOG_FILE=h36m_parsing_eval_logs/test_${job_name}.log 28 | now=$(date +"%Y%m%d_%H%M%S") 29 | if [[ -f ${LOG_FILE} ]]; then 30 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 31 | mv ${LOG_FILE} ${LOG_FILE}_${now} 32 | fi 33 | echo 'log file: ' ${LOG_FILE} 34 | 35 | 36 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 37 | srun -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=reserved \ 38 | --job-name=${job_name} --cpus-per-task=5 --comment wbsR-SC220052.001 -x SH-IDC1-10-5-40-[238,107,163,168,171,162,165,134,136,248,239,114,136,161,164,245,186],SH-IDC1-10-5-41-[3,4] \ 39 | python -W ignore -u ${ROOT}/test.py \ 40 | --expname ${job_name} \ 41 | --config ${CONFIG} \ 42 | --test_config ${TEST_CONFIG} \ 43 | --spec_ginfo_index ${GINFO_INDEX} \ 44 | --load-path=${TEST_MODEL} \ 45 | 2>&1 | tee ${LOG_FILE} 46 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/h36m_test.yaml: -------------------------------------------------------------------------------- 1 | project_name: parsing_test 2 | 3 | common: 4 | backbone: 5 | kwargs: 6 | test_pos_mode: learnable 7 | tester: 8 | type: TesterMultiTaskDev 9 | use_ceph: True 10 | sync: True 11 | collate: dev 12 | 13 | # task_specific_param = ['backbone', 'neck', 'decoder', 'dataset', 'sampler', 'lr_scheduler', 'optimizer'] 14 | tasks: 15 | 0: 16 | name: ParTest 17 | loss_weight: 1.0 # *redundant* 18 | gres_ratio: 1 # int, > 0| world/sum*ratio, *redundant* 19 | dataset: 20 | type: Human3M6ParsingDataset 21 | kwargs: 22 | data_path: shlg:s3://parsing_public/human3.6 23 | dataset: val 24 | is_train: False 25 | cfg: 26 | # mean: [ 0.485, 0.456, 0.406 ] 27 | # std: [ 0.229, 0.224, 0.225 ] 28 | eval_crop_size: [ 480, 480 ] 29 | is_flip: False 30 | is_multi_scale: False 31 | 32 | ignore_value: 255 # TODO: duplicated with decoder.kwargs.ignore_value 33 | num_classes: 25 34 | label_list: [ 0, 1, 2, 3, 6, 7, 8, 17, 18, 19, 25, 26, 27, 32, 33, 34, 38, 39, 43, 44, 35 | 46, 49, 50, 56, 58 ] 36 | 37 | sampler: 38 | batch_size: 4 # per card 39 | 40 | # extra: 41 | # min_sizes: [320, 480, 640, 800, 960, 1120] # TTA 42 | # max_size: 4480 43 | # flip: True 44 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/h36m_train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source pavi_env 3 | set -x 4 | 5 | # source /mnt/lustre/share/spring/r0.3.0 6 | ROOT=../../../../ 7 | export PYTHONPATH=$ROOT:$PYTHONPATH 8 | 9 | if [[ ! -d "logs" ]]; then 10 | mkdir logs 11 | fi 12 | 13 | ################ 14 | gpus=${1-4} 15 | job_name=${2-h36m_FT_vitbase_pos_embed_b4_lr5e4x08_backboneclip_wd01_cosineLR_ld75_dpr03_sz480_10ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 16 | CONFIG=${3-h36m_FT_vitbase_pos_embed_b4_lr5e4x08_backboneclip_wd01_cosineLR_ld75_dpr03_sz480_10ep.yaml} 17 | ################ 18 | 19 | g=$((${gpus}<8?${gpus}:8)) 20 | echo 'start job:' ${job_name} ' config:' ${CONFIG} 21 | 22 | AutoResume=checkpoints/${job_name}/ckpt_task_iter_newest.pth.tar 23 | 24 | LOG_FILE=logs/${job_name}.log 25 | now=$(date +"%Y%m%d_%H%M%S") 26 | if [[ -f ${LOG_FILE} ]]; then 27 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 28 | mv ${LOG_FILE} ${LOG_FILE}_${now} 29 | fi 30 | echo 'log file: ' ${LOG_FILE} 31 | 32 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 33 | srun -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=reserved \ 34 | --job-name=${job_name} --cpus-per-task=5 --phx-priority P0 --comment wbsR-SC220052.001 -x SH-IDC1-10-5-40-[166,238,107,163,168,171,162,165,134,136,248,239,114,136,161,164,245,186,64,177,178],SH-IDC1-10-5-41-[3,4] \ 35 | python -W ignore -u ${ROOT}/multitask.py \ 36 | --expname ${job_name} \ 37 | --config ${CONFIG} \ 38 | --auto-resume=checkpoints/${job_name}/ckpt_task_iter_newest.pth.tar \ 39 | 2>&1 | tee ${LOG_FILE} 40 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/parsing/logs/CIHP_FT_simplehead_vitbase_b4_lr5e4x08_wd01_backboneclip_cosineLR_ld75_dpr03_sz480_20ep__SmallSetting___LSA_10p_small_setting1.log_20220925_135536: -------------------------------------------------------------------------------- 1 | phoenix-srun: Job 88625 scheduled successfully! 2 | Current QUOTA_TYPE is [reserved], which means the job has occupied quota in RESERVED_TOTAL under your partition. 3 | Current PHX_PRIORITY is P0 4 | 5 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/pose/coco_pose_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source pavi_env 4 | set -x 5 | 6 | # source /mnt/lustre/share/spring/r0.3.0 7 | ROOT=../../../../ 8 | export PYTHONPATH=$ROOT:$PYTHONPATH 9 | 10 | if [[ ! -d "coco_pose_eval_logs" ]]; then 11 | mkdir coco_pose_eval_logs 12 | fi 13 | 14 | 15 | ################ 16 | gpus=${1-1} 17 | job_name=${2-coco_pose_lr5e4x08_wd01_backbonebclip_layerdecay_stepLR_classichead_dpr3e1_wowin_LN_udp_50ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 18 | CONFIG=${3-coco_pose_lr5e4x08_wd01_backbonebclip_layerdecay_stepLR_classichead_dpr3e1_wowin_LN_udp_50ep.yaml} 19 | TEST_CONFIG=${4-coco_pose_test.yaml} 20 | GINFO_INDEX=${5-0} # task index config cherrypick (if necessary) 21 | TEST_MODEL=${6-'/mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_samll_setting_pose_FT/checkpoints/coco_pose_lr5e4x08_wd01_backbonebclip_layerdecay_stepLR_classichead_dpr3e1_wowin_LN_udp_50ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion/ckpt_task0_iter_newest.pth.tar'} 22 | ################ 23 | 24 | g=$((${gpus}<8?${gpus}:8)) 25 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 26 | 27 | 28 | LOG_FILE=coco_pose_eval_logs/${job_name}.log 29 | now=$(date +"%Y%m%d_%H%M%S") 30 | if [[ -f ${LOG_FILE} ]]; then 31 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 32 | mv ${LOG_FILE} ${LOG_FILE}_${now} 33 | fi 34 | echo 'log file: ' ${LOG_FILE} 35 | 36 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 37 | srun -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=auto \ 38 | --job-name=${job_name} --cpus-per-task=5 --comment wbsR-SC220052.001 \ 39 | python -W ignore -u ${ROOT}/test.py \ 40 | --expname ${job_name} \ 41 | --config ${CONFIG} \ 42 | --test_config ${TEST_CONFIG} \ 43 | --spec_ginfo_index ${GINFO_INDEX} \ 44 | --load-path=${TEST_MODEL} \ 45 | 2>&1 | tee ${LOG_FILE} 46 | 47 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/pose/coco_pose_test.yaml: -------------------------------------------------------------------------------- 1 | common: 2 | project_name: pose_test 3 | backbone: 4 | kwargs: 5 | test_pos_mode: learnable # simple_interpolate 6 | tester: 7 | type: TesterMultiTaskDev 8 | use_ceph: True 9 | sync: True 10 | collate: dev_collate 11 | 12 | # task_specific_param = ['backbone', 'neck', 'decoder', 'dataset', 'sampler', 'lr_scheduler', 'optimizer'] 13 | tasks: 14 | 0: 15 | name: COCOPoseTest # deprecated 16 | loss_weight: 1.0 # *redundant* 17 | gres_ratio: 1 # int, > 0| world/sum*ratio, *redundant* 18 | dataset: 19 | type: COCOPosDatasetDev 20 | kwargs: 21 | ann_file: 'shlg:s3://pose_public/coco/annotations/person_keypoints_val2017.json' 22 | img_prefix: 'shlg:s3://pose_public/coco/val2017/' 23 | use_dup: True 24 | test_mode: True 25 | data_use_ratio: 1 26 | sampler: 27 | batch_size: 16 # per card 28 | evaluation: 29 | cfg: 30 | interval: 10 31 | metric: mAP 32 | key_indicator: AP 33 | 34 | soft_nms: False 35 | nms_thr: 1.0 36 | oks_thr: 0.9 37 | vis_thr: 0.2 38 | 39 | # extra: 40 | # min_sizes: [320, 480, 640, 800, 960, 1120] # TTA 41 | # max_size: 4480 42 | # flip: True 43 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/pose/coco_pose_train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source pavi_env 3 | # set -x 4 | 5 | # source /mnt/lustre/share/spring/r0.3.0 6 | ROOT=../../../../ 7 | export PYTHONPATH=$ROOT:$PYTHONPATH 8 | 9 | if [[ ! -d "logs" ]]; then 10 | mkdir logs 11 | fi 12 | 13 | ################ 14 | gpus=${1-4} 15 | job_name=${2-coco_pose_lr5e4x08_wd01_backbonebclip_layerdecay_stepLR_classichead_dpr3e1_wowin_LN_udp_50ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 16 | CONFIG=${3-coco_pose_lr5e4x08_wd01_backbonebclip_layerdecay_stepLR_classichead_dpr3e1_wowin_LN_udp_50ep.yaml} 17 | ################ 18 | 19 | g=$((${gpus}<8?${gpus}:8)) 20 | echo 'start job:' ${job_name} ' config:' ${CONFIG} 21 | 22 | AutoResume=checkpoints/${job_name}/ckpt_task_iter_newest.pth.tar 23 | 24 | LOG_FILE=logs/${job_name}.log 25 | now=$(date +"%Y%m%d_%H%M%S") 26 | if [[ -f ${LOG_FILE} ]]; then 27 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 28 | mv ${LOG_FILE} ${LOG_FILE}_${now} 29 | fi 30 | echo 'log file: ' ${LOG_FILE} 31 | 32 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 33 | srun -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=reserved \ 34 | --job-name=${job_name} --cpus-per-task=5 --phx-priority P0 --comment wbsR-SC220052.001 -x SH-IDC1-10-5-40-[185,238,107,163,168,171,175,183,162,165,134,136,248,239,114,136,161,164,245,186,178,64],SH-IDC1-10-5-41-[3,4] \ 35 | python -W ignore -u ${ROOT}/multitask.py \ 36 | --expname ${job_name} \ 37 | --config ${CONFIG} \ 38 | --auto-resume=checkpoints/${job_name}/ckpt_task_iter_newest.pth.tar \ 39 | 2>&1 | tee ${LOG_FILE} 40 | 41 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/pose/logs/coco_pose_lr5e4x08_wd01_backbonebclip_layerdecay_stepLR_classichead_dpr3e1_wowin_LN_udp_50ep__SmallSetting___LSA_10p_small_setting1.log_20220925_162614: -------------------------------------------------------------------------------- 1 | phoenix-srun: Job 88662 scheduled successfully! 2 | Current QUOTA_TYPE is [reserved], which means the job has occupied quota in RESERVED_TOTAL under your partition. 3 | Current PHX_PRIORITY is P0 4 | 5 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/pose/mpii_pose_eval_logs/test_mpii_pose_lr5e4x08_wd01_backboneclip_stepLR_classichead_dpr3e1_LN_udp_50ep__MAE.log_20220926_103610: -------------------------------------------------------------------------------- 1 | phoenix-srun: Job 88856 scheduled successfully! 2 | Current QUOTA_TYPE is [reserved], which means the job has occupied quota in RESERVED_TOTAL under your partition. 3 | Current PHX_PRIORITY is P0 4 | 5 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/pose/mpii_pose_lr5e4x08_wd01_backboneclip_stepLR_classichead_dpr3e1_LN_udp_50ep.yaml: -------------------------------------------------------------------------------- 1 | out_dir: /mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_samll_setting_pose_FT 2 | 3 | common: # prefix 4 | backbone: 5 | project_name: L2_samll_setting_pose_FT 6 | type: vit_base_patch16 7 | kwargs: 8 | task_sp_list: ['pos_embed', 'rel_pos_h', 'rel_pos_w'] # wrong list would somehow cause .cuda() stuck without error 9 | pretrained: True 10 | pretrain_path: '/mnt/lustre/chencheng1/expr_files/vitruvian/devL2/transed_ckpt_for_pretrain/devL2_small_setting/pose/vitbase_lr1e3_StepLRx3_backboneclip_bmp08_ld75_pose_dpr03_dcLN_par_dpr03_dcBN_attr_dpr01_reid_clstoken_dpr0_LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion.pth' 11 | load_pos_embed: True 12 | pos_embed_interp: False 13 | learnable_pos: True 14 | window: False 15 | drop_path_rate: 0.3 16 | img_size: [256, 192] 17 | 18 | solver: 19 | type: SolverMultiTaskDev 20 | 21 | lr_scheduler: 22 | type: 'Step' 23 | kwargs: 24 | base_lr: 1.0e-7 #5.0e-7 25 | warmup_steps: 1000 26 | warmup_lr: 5.0e-4 #5.0e-4 27 | lr_mults: [0.1, 0.1] 28 | lr_steps: [5250, 6300] # 75%, 90% 29 | 30 | optimizer: 31 | type: AdamWWithBackboneClipDev 32 | kwargs: 33 | clip_norm: 0.01 34 | norm_type: 2 35 | betas: [0.9, 0.999] 36 | weight_decay: 0.1 37 | 38 | backbone_multiplier: 0.8 # 0.8 39 | layer_decay: 40 | # layer decay 41 | num_layers: 12 42 | layer_decay_rate: 0.75 43 | lpe_lr: True 44 | 45 | auto_denan: False 46 | 47 | workers: 2 48 | max_iter: 7000 # (50 * 22246) / (4 * 40) = 6951.875 49 | 50 | deterministic: True # seed control 51 | cudnn_deterministic: False 52 | worker_rank: True 53 | random_seed: 42 54 | 55 | print_freq: 10 56 | vis_batch: False 57 | save_interval: 70000 58 | 59 | use_ceph: True 60 | sync: True 61 | 62 | # task_specific_param = ['backbone', 'neck', 'decoder', 'dataset', 'sampler', 'lr_scheduler', 'optimizer'] 63 | tasks : # prefix 64 | 0: # prefix 65 | name: mpiipose 66 | loss_weight: 1.0 67 | gres_ratio: 1 # int, > 0| world/sum*ratio 68 | dataset: 69 | type: MPIIPosDatasetDev 70 | kwargs: 71 | ann_file: 'shlg:s3://pose_public/MPI/annotations/mpii_train.json' 72 | img_prefix: 'shlg:s3://pose_public/MPI/images/' 73 | use_udp: True 74 | data_cfg: { 75 | 'image_size':[192, 256], 76 | 'heatmap_size':[48, 64], 77 | 'num_output_channels': 16, 78 | 'num_joints': 16, 79 | 'dataset_channel': [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],], 80 | 'inference_channel': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], 81 | } 82 | sampler: 83 | batch_size: 40 # 16 84 | shuffle_strategy: 1 85 | neck: 86 | type: DoNothing 87 | kwargs: 88 | backbone: None 89 | decoder: 90 | type: TopDownSimpleHead 91 | kwargs: 92 | layer_norm: True 93 | use_sync_bn: False 94 | bn_sync_stats: False 95 | in_channels: 768 96 | out_channels: 16 97 | num_deconv_layers: 2 98 | num_deconv_filters: [256, 256] 99 | num_deconv_kernels: [4, 4] 100 | upsample: 0 101 | extra: {'final_conv_kernel': 1} 102 | train_cfg: {} 103 | test_cfg: { 104 | 'flip_test': True, 105 | 'post_process':'default', 106 | 'shift_heatmap': False, 107 | 'modulate_kernel': 11, 108 | 'use_udp': True} 109 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/pose/mpii_pose_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source pavi_env 4 | set -x 5 | 6 | # source /mnt/lustre/share/spring/r0.3.0 7 | ROOT=../../../../ 8 | export PYTHONPATH=$ROOT:$PYTHONPATH 9 | 10 | if [[ ! -d "mpii_pose_eval_logs" ]]; then 11 | mkdir mpii_pose_eval_logs 12 | fi 13 | 14 | ################ 15 | gpus=${1-1} 16 | job_name=${2-mpii_pose_lr5e4x08_wd01_backboneclip_stepLR_classichead_dpr3e1_LN_udp_50ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 17 | CONFIG=${3-mpii_pose_lr5e4x08_wd01_backboneclip_stepLR_classichead_dpr3e1_LN_udp_50ep.yaml} 18 | TEST_CONFIG=${4-mpii_pose_test.yaml} 19 | GINFO_INDEX=${5-0} # task index config cherrypick (if necessary) 20 | TEST_MODEL=${6-'/mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_samll_setting_pose_FT/checkpoints/mpii_pose_lr5e4x08_wd01_backboneclip_stepLR_classichead_dpr3e1_LN_udp_50ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion/ckpt_task0_iter_newest.pth.tar'} 21 | ################ 22 | 23 | g=$((${gpus}<8?${gpus}:8)) 24 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 25 | 26 | 27 | LOG_FILE=mpii_pose_eval_logs/test_${job_name}.log 28 | now=$(date +"%Y%m%d_%H%M%S") 29 | if [[ -f ${LOG_FILE} ]]; then 30 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 31 | mv ${LOG_FILE} ${LOG_FILE}_${now} 32 | fi 33 | echo 'log file: ' ${LOG_FILE} 34 | 35 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 36 | srun -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=auto \ 37 | --job-name=${job_name} --cpus-per-task=5 --preempt --comment wbsR-SC220052.001 -x SH-IDC1-10-5-40-[64,238,107,163,168,171,162,165,134,136,248,239,114,136,161,164,245,186,64],SH-IDC1-10-5-41-[3,4] \ 38 | python -W ignore -u ${ROOT}/test.py \ 39 | --expname ${job_name} \ 40 | --config ${CONFIG} \ 41 | --test_config ${TEST_CONFIG} \ 42 | --spec_ginfo_index ${GINFO_INDEX} \ 43 | --load-path=${TEST_MODEL} \ 44 | 2>&1 | tee ${LOG_FILE} 45 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/pose/mpii_pose_test.yaml: -------------------------------------------------------------------------------- 1 | project_name: pose_test 2 | common: 3 | backbone: 4 | kwargs: 5 | test_pos_mode: learnable # simple_interpolate, learnable 6 | tester: 7 | type: TesterMultiTaskDev 8 | use_ceph: True 9 | sync: True 10 | collate: dev_collate 11 | 12 | # task_specific_param = ['backbone', 'neck', 'decoder', 'dataset', 'sampler', 'lr_scheduler', 'optimizer'] 13 | tasks: 14 | 0: 15 | name: MPIIPoseTest # deprecated 16 | loss_weight: 1.0 # *redundant* 17 | gres_ratio: 1 # int, > 0| world/sum*ratio, *redundant* 18 | dataset: 19 | type: MPIIPosDatasetDev 20 | kwargs: 21 | ann_file: '/mnt/lustrenew/share_data/viface/vitruvian/L1_benchmark/pose/MPI/annotations/mpii_val.json' 22 | img_prefix: '/mnt/lustrenew/share_data/viface/vitruvian/L1_benchmark/pose/MPI/images/' 23 | test_mode: True 24 | use_udp: True 25 | data_use_ratio: 1 26 | sampler: 27 | batch_size: 16 # per card 28 | evaluation: 29 | cfg: 30 | interval: 10 31 | metric: PCKh 32 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/pose/mpii_pose_train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source pavi_env 3 | # set -x 4 | 5 | # source /mnt/lustre/share/spring/r0.3.0 6 | ROOT=../../../../ 7 | export PYTHONPATH=$ROOT:$PYTHONPATH 8 | 9 | if [[ ! -d "logs" ]]; then 10 | mkdir logs 11 | fi 12 | 13 | ################ 14 | gpus=${1-4} 15 | job_name=${2-mpii_pose_lr5e4x08_wd01_backboneclip_stepLR_classichead_dpr3e1_LN_udp_50ep___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 16 | CONFIG=${3-mpii_pose_lr5e4x08_wd01_backboneclip_stepLR_classichead_dpr3e1_LN_udp_50ep.yaml} 17 | ################ 18 | 19 | g=$((${gpus}<8?${gpus}:8)) 20 | echo 'start job:' ${job_name} ' config:' ${CONFIG} 21 | 22 | AutoResume=checkpoints/${job_name}/ckpt_task_iter_newest.pth.tar 23 | 24 | LOG_FILE=logs/${job_name}.log 25 | now=$(date +"%Y%m%d_%H%M%S") 26 | if [[ -f ${LOG_FILE} ]]; then 27 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 28 | mv ${LOG_FILE} ${LOG_FILE}_${now} 29 | fi 30 | echo 'log file: ' ${LOG_FILE} 31 | 32 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 33 | srun -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=reserved \ 34 | --job-name=${job_name} --cpus-per-task=5 --comment wbsR-SC220052.001 -x SH-IDC1-10-5-40-[64,185,238,107,163,168,171,175,183,162,165,134,136,248,239,114,136,161,164,245,186,178],SH-IDC1-10-5-41-[3,4] \ 35 | python -W ignore -u ${ROOT}/multitask.py \ 36 | --expname ${job_name} \ 37 | --config ${CONFIG} \ 38 | --auto-resume=checkpoints/${job_name}/ckpt_task_iter_newest.pth.tar \ 39 | 2>&1 | tee ${LOG_FILE} 40 | 41 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/reid/reid_market1501_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source pavi_env 4 | set -x 5 | 6 | # source /mnt/lustre/share/spring/r0.3.0 7 | ROOT=../../../../ 8 | export PYTHONPATH=$ROOT:$PYTHONPATH 9 | 10 | if [[ ! -d "reid_market1501_eval_logs" ]]; then 11 | mkdir reid_market1501_eval_logs 12 | fi 13 | 14 | ################ 15 | gpus=${1-1} 16 | job_name=${2-vit_base_b32_lr5e4x05_wd03_trained_pose_embed_cosineLR_ld75_dpr0_5set_30kiters___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 17 | CONFIG=${3-vit_base_b32_lr5e4x05_wd03_trained_pose_embed_cosineLR_ld75_dpr0_5set_30kiters.yaml} 18 | TEST_CONFIG=${4-reid_market1501_test.yaml} 19 | GINFO_INDEX=${5-0} # task index config cherrypick (if necessary) 20 | TEST_MODEL=${6-'/mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_samll_setting_reid_FT/checkpoints/vit_base_b32_lr5e4x05_wd03_trained_pose_embed_cosineLR_ld75_dpr0_5set_30kiters___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion/ckpt_task0_iter_newest.pth.tar'} 21 | ################ 22 | 23 | g=$((${gpus}<8?${gpus}:8)) 24 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 25 | 26 | 27 | LOG_FILE=reid_market1501_eval_logs/test_${job_name}.log 28 | now=$(date +"%Y%m%d_%H%M%S") 29 | if [[ -f ${LOG_FILE} ]]; then 30 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 31 | mv ${LOG_FILE} ${LOG_FILE}_${now} 32 | fi 33 | echo 'log file: ' ${LOG_FILE} 34 | 35 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 36 | spring.submit run -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --gpu --quotatype=auto \ 37 | --job-name=${job_name} --cpus-per-task=5 \ 38 | "python -W ignore -u ${ROOT}/test.py \ 39 | --expname ${job_name} \ 40 | --config ${CONFIG} \ 41 | --test_config ${TEST_CONFIG} \ 42 | --spec_ginfo_index ${GINFO_INDEX} \ 43 | --load-path=${TEST_MODEL} \ 44 | 2>&1 | tee ${LOG_FILE}" 45 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/reid/reid_market1501_test.yaml: -------------------------------------------------------------------------------- 1 | common: 2 | tester: 3 | type: 'ReIDTester' 4 | test_feature_name: 'feature_nobn' 5 | use_ceph: True 6 | sync: True 7 | 8 | tasks : 9 | 0 : 10 | name : market1501 11 | loss_weight : 1.0 12 | gres_ratio: 1 13 | dataset: 14 | type: ReIDTestDataset 15 | kwargs: 16 | root_path: sh40:s3://chendapeng.reid_data/datasets8/ 17 | query_file_path: 18 | - sh1986:s3://tangshixiang.reid_data_list/market1501/probe.txt 19 | gallery_file_path: 20 | - sh1986:s3://tangshixiang.reid_data_list/market1501/gallery.txt 21 | loader: 'pil' 22 | vit: True 23 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/finetune/reid/reid_train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source pavi_env 3 | # set -x 4 | 5 | # source /mnt/lustre/share/spring/r0.3.0 6 | ROOT=../../../../ 7 | export PYTHONPATH=$ROOT:$PYTHONPATH 8 | 9 | if [[ ! -d "logs" ]]; then 10 | mkdir logs 11 | fi 12 | 13 | ################ 14 | gpus=${1-1} 15 | job_name=${2-vit_base_b32_lr5e4x05_wd03_trained_pose_embed_cosineLR_ld75_dpr0_5set_30kiters___SmallSetting___LSA_10p_small_setting6_add_posetrack_DGMarket_deepfashion} 16 | CONFIG=${3-vit_base_b32_lr5e4x05_wd03_trained_pose_embed_cosineLR_ld75_dpr0_5set_30kiters.yaml} 17 | ################ 18 | 19 | g=$((${gpus}<8?${gpus}:8)) 20 | echo 'start job:' ${job_name} ' config:' ${CONFIG} 21 | 22 | AutoResume=checkpoints/${job_name}/ckpt_task_iter_newest.pth.tar 23 | 24 | LOG_FILE=logs/${job_name}.log 25 | now=$(date +"%Y%m%d_%H%M%S") 26 | if [[ -f ${LOG_FILE} ]]; then 27 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 28 | mv ${LOG_FILE} ${LOG_FILE}_${now} 29 | fi 30 | echo 'log file: ' ${LOG_FILE} 31 | 32 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 33 | srun -n${gpus} -p stc1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=auto \ 34 | --job-name=${job_name} --comment wbsR-SC220052.001 --cpus-per-task=5 -x SH-IDC1-10-5-40-[238,107,163,168,171,162,165,134,136,248,239,114,136,161,164,245,186,64],SH-IDC1-10-5-41-[3,4] \ 35 | python -W ignore -u ${ROOT}/multitask.py \ 36 | --expname ${job_name} \ 37 | --config ${CONFIG} \ 38 | --auto-resume=checkpoints/${job_name}/ckpt_task_iter_newest.pth.tar \ 39 | 2>&1 | tee ${LOG_FILE} 40 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/scripts/ckpt_trans_with_cls_token.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import collections 4 | import torch 5 | import numpy as np 6 | 7 | sys.path.append('/mnt/cache/chencheng1/vitruvian/vitruvian-multitask') 8 | 9 | mae_pretrain_path = '/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/models/backbones/pretrain_weights/mae_pretrain_vit_base.pth' 10 | mae_model = torch.load(mae_pretrain_path) 11 | 12 | save_root = '/mnt/lustre/share_data/chencheng1/vitruvian/L2_final_base' 13 | 14 | root = '/mnt/lustre/chencheng1/expr_files/vitruvian/L2_full_setting_joint/checkpoints' 15 | config_lists = [ 16 | 'v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed' 17 | ] 18 | 19 | for config in config_lists: 20 | trained_ckpt_root = os.path.join(root, config) 21 | expr_name = trained_ckpt_root.split('/')[-1] 22 | 23 | wo_cls_token_index = 0 # coco 24 | with_cls_token_index = 20 # reid_4set 25 | 26 | 27 | # with_cls_token-reid 28 | with_cls_token_train_model_path = os.path.join(trained_ckpt_root, 'ckpt_task{}_iter_newest.pth.tar'.format(with_cls_token_index)) 29 | with_cls_token_transed_ckpt_save_path = os.path.join(save_root, 'with_cls_token', expr_name+'.pth') 30 | with_cls_token_train_model = torch.load(with_cls_token_train_model_path, map_location=torch.device('cpu')) 31 | 32 | cnt = 0 33 | traned_ckpt = collections.OrderedDict() 34 | for name, param in mae_model['model'].items(): 35 | trained_model_name = 'module.backbone_module.' + name 36 | if trained_model_name in with_cls_token_train_model['state_dict']: 37 | if name == 'pos_embed': 38 | cnt += 1 39 | traned_ckpt[name] = torch.cat([with_cls_token_train_model['state_dict']['module.backbone_module.cls_token_pos_embed'], with_cls_token_train_model['state_dict'][trained_model_name]], dim=1) 40 | else: 41 | cnt += 1 42 | traned_ckpt[name] = with_cls_token_train_model['state_dict'][trained_model_name] 43 | else: 44 | traned_ckpt[name] = mae_model['model'][name] 45 | 46 | torch.save({'model': traned_ckpt}, with_cls_token_transed_ckpt_save_path) 47 | print('done! transed ckpt saved at: {}'.format(with_cls_token_transed_ckpt_save_path)) 48 | 49 | 50 | # wo_cls_token-reid 51 | wo_cls_token_train_model_path = os.path.join(trained_ckpt_root, 'ckpt_task{}_iter_newest.pth.tar'.format(wo_cls_token_index)) 52 | wo_cls_token_transed_ckpt_save_path = os.path.join(save_root, 'wo_cls_token', expr_name+'.pth') 53 | wo_cls_token_train_model = torch.load(wo_cls_token_train_model_path, map_location=torch.device('cpu')) 54 | 55 | cnt = 0 56 | traned_ckpt = collections.OrderedDict() 57 | for name, param in mae_model['model'].items(): 58 | trained_model_name = 'module.backbone_module.' + name 59 | if trained_model_name in wo_cls_token_train_model['state_dict']: 60 | cnt += 1 61 | traned_ckpt[name] = wo_cls_token_train_model['state_dict'][trained_model_name] 62 | else: 63 | traned_ckpt[name] = mae_model['model'][name] 64 | 65 | torch.save({'model': traned_ckpt}, wo_cls_token_transed_ckpt_save_path) 66 | print('done! transed ckpt saved at: {}'.format(wo_cls_token_transed_ckpt_save_path)) -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/parsing_CIHP_eval_logs/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_162518: -------------------------------------------------------------------------------- 1 | phoenix-srun: job 486768 queued and waiting for resources 2 | phoenix-srun: job 486768 has been allocated resources 3 | phoenix-srun: Job 486768 scheduled successfully! 4 | Current QUOTA_TYPE is [reserved], which means the job has occupied quota in RESERVED_TOTAL under your partition. 5 | Current PHX_PRIORITY is normal 6 | 7 | /mnt/cache/share/spring/conda_envs/miniconda3/envs/s0.3.4/bin/python: can't open file '../..//test.py': [Errno 2] No such file or directory 8 | phoenix-srun: error: SH-IDC1-10-198-4-246: task 0: Exited with exit code 2 9 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/parsing_CIHP_eval_logs/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_095626: -------------------------------------------------------------------------------- 1 | phoenix-srun: job 489121 queued and waiting for resources 2 | phoenix-srun: job 489121 has been allocated resources 3 | phoenix-srun: Job 489121 scheduled successfully! 4 | Current QUOTA_TYPE is [reserved], which means the job has occupied quota in RESERVED_TOTAL under your partition. 5 | Current PHX_PRIORITY is normal 6 | 7 | [_init_petrel]- 1 cur: 0.000s, avg(1): 0.000s 8 | Traceback (most recent call last): 9 | File "../../..//test.py", line 9, in 10 | from core.testers import tester_entry 11 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/testers/__init__.py", line 1, in 12 | from .reid_tester import ReIDTester 13 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/testers/reid_tester.py", line 10, in 14 | import core.models.necks as necks 15 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/models/necks/__init__.py", line 3, in 16 | from .ladder_side_attention_fpn import LadderSideAttentionFPN, ResidualLadderSideAttentionFPN 17 | ImportError: cannot import name 'ResidualLadderSideAttentionFPN' 18 | phoenix-srun: error: SH-IDC1-10-198-4-60: task 0: Exited with exit code 1 19 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/parsing_human36_eval_logs/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_162714: -------------------------------------------------------------------------------- 1 | phoenix-srun: job 486772 queued and waiting for resources 2 | phoenix-srun: job 486772 has been allocated resources 3 | phoenix-srun: Job 486772 scheduled successfully! 4 | Current QUOTA_TYPE is [reserved], which means the job has occupied quota in RESERVED_TOTAL under your partition. 5 | Current PHX_PRIORITY is normal 6 | 7 | [_init_petrel]- 1 cur: 0.000s, avg(1): 0.000s 8 | [rank 0000]-[INFO]-[7acb]-[2022-10-31 04:26:52]-[/spring/src/linklink/src/core.cc:220]: linklink init: world_size=1, rank=(0,0), device_num=1, thread_pool=1, buffer_pool=-1 9 | Traceback (most recent call last): 10 | File "../../..//test.py", line 99, in 11 | main() 12 | File "../../..//test.py", line 73, in main 13 | C_train = Config(args.config, spec_ginfo_index=args.spec_ginfo_index) 14 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/config.py", line 148, in __init__ 15 | with open(config_file) as f: 16 | FileNotFoundError: [Errno 2] No such file or directory: 'v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml' 17 | Error in system call pthread_mutex_destroy: Device or resource busy 18 | src/mpi/init/initthread.c:242 19 | phoenix-srun: error: SH-IDC1-10-198-4-246: task 0: Segmentation fault 20 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/parsing_human36_eval_logs/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_095627: -------------------------------------------------------------------------------- 1 | phoenix-srun: job 489122 queued and waiting for resources 2 | phoenix-srun: job 489122 has been allocated resources 3 | phoenix-srun: Job 489122 scheduled successfully! 4 | Current QUOTA_TYPE is [reserved], which means the job has occupied quota in RESERVED_TOTAL under your partition. 5 | Current PHX_PRIORITY is normal 6 | 7 | [_init_petrel]- 1 cur: 0.000s, avg(1): 0.000s 8 | Traceback (most recent call last): 9 | File "../../..//test.py", line 9, in 10 | from core.testers import tester_entry 11 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/testers/__init__.py", line 1, in 12 | from .reid_tester import ReIDTester 13 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/testers/reid_tester.py", line 10, in 14 | import core.models.necks as necks 15 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/models/necks/__init__.py", line 3, in 16 | from .ladder_side_attention_fpn import LadderSideAttentionFPN, ResidualLadderSideAttentionFPN 17 | ImportError: cannot import name 'ResidualLadderSideAttentionFPN' 18 | phoenix-srun: error: SH-IDC1-10-198-4-60: task 0: Exited with exit code 1 19 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/parsing_test_CIHP.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source /mnt/lustre/share/platform/env/pavi_env 4 | set -x 5 | 6 | # source /mnt/lustre/share/spring/r0.3.0 7 | ROOT=../../../ 8 | export PYTHONPATH=$ROOT:$PYTHONPATH 9 | 10 | if [[ ! -d "parsing_CIHP_eval_logs" ]]; then 11 | mkdir parsing_CIHP_eval_logs 12 | fi 13 | 14 | ################ 15 | gpus=${1-1} 16 | job_name=${2-v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed} 17 | CONFIG=${3-../v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml} 18 | TEST_CONFIG=${4-parsing_test_CIHP.yaml} 19 | GINFO_INDEX=${5-13} # task index config cherrypick (if necessary) 20 | TEST_MODEL=${6-/mnt/lustre/chencheng1/expr_files/vitruvian/L2_full_setting_joint/checkpoints/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed/ckpt_task${GINFO_INDEX}_iter_newest.pth.tar} 21 | ################ 22 | 23 | g=$((${gpus}<8?${gpus}:8)) 24 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 25 | 26 | 27 | LOG_FILE=parsing_CIHP_eval_logs/${job_name}.log 28 | now=$(date +"%Y%m%d_%H%M%S") 29 | if [[ -f ${LOG_FILE} ]]; then 30 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 31 | mv ${LOG_FILE} ${LOG_FILE}_${now} 32 | fi 33 | echo 'log file: ' ${LOG_FILE} 34 | 35 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 36 | srun -n${gpus} -p rdbp1_v100_32g --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=spot \ 37 | --job-name=${job_name} --comment wbsR-SC220052.001 --cpus-per-task=5 \ 38 | python -W ignore -u ${ROOT}/test.py \ 39 | --expname ${job_name} \ 40 | --config ${CONFIG} \ 41 | --test_config ${TEST_CONFIG} \ 42 | --spec_ginfo_index ${GINFO_INDEX} \ 43 | --load-path=${TEST_MODEL} \ 44 | 2>&1 | tee ${LOG_FILE} 45 | 46 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/parsing_test_CIHP.yaml: -------------------------------------------------------------------------------- 1 | common: 2 | project_name: parsing_test 3 | # backbone: 4 | # kwargs: 5 | # test_pos_mode: learnable 6 | tester: 7 | type: TesterMultiTaskDev 8 | use_ceph: True 9 | sync: True 10 | collate: dev 11 | 12 | # task_specific_param = ['backbone', 'neck', 'decoder', 'dataset', 'sampler', 'lr_scheduler', 'optimizer'] 13 | tasks: 14 | 0: 15 | name: ParTest 16 | loss_weight: 1.0 # *redundant* 17 | gres_ratio: 1 # int, > 0| world/sum*ratio, *redundant* 18 | dataset: 19 | type: CIHPParsingDataset 20 | kwargs: 21 | data_path: sh1424:s3://parsing_public/CIHP 22 | data_use_ratio: 1 23 | dataset: val 24 | is_train: False 25 | cfg: 26 | # mean: [ 0.485, 0.456, 0.406 ] 27 | # std: [ 0.229, 0.224, 0.225 ] 28 | eval_crop_size: [ 480, 480 ] 29 | is_flip: False 30 | is_multi_scale: False 31 | 32 | ignore_value: 255 # TODO: duplicated with decoder.kwargs.ignore_value 33 | num_classes: 20 34 | label_list: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ] 35 | 36 | sampler: 37 | batch_size: 4 # per card 38 | 39 | # extra: 40 | # min_sizes: [320, 480, 640, 800, 960, 1120] # TTA 41 | # max_size: 4480 42 | # flip: True 43 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/parsing_test_LIP.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source /mnt/lustre/share/platform/env/pavi_env 4 | set -x 5 | 6 | # source /mnt/lustre/share/spring/r0.3.0 7 | ROOT=../../../ 8 | export PYTHONPATH=$ROOT:$PYTHONPATH 9 | 10 | if [[ ! -d "parsing_LIP_eval_logs" ]]; then 11 | mkdir parsing_LIP_eval_logs 12 | fi 13 | 14 | ################ 15 | gpus=${1-1} 16 | job_name=${2-v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed} 17 | CONFIG=${3-../v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml} 18 | TEST_CONFIG=${4-parsing_test_LIP.yaml} 19 | GINFO_INDEX=${5-13} # task index config cherrypick (if necessary) 20 | TEST_MODEL=${6-/mnt/lustre/chencheng1/expr_files/vitruvian/L2_full_setting_joint/checkpoints/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed/ckpt_task${GINFO_INDEX}_iter_newest.pth.tar} 21 | ################ 22 | 23 | g=$((${gpus}<8?${gpus}:8)) 24 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 25 | 26 | 27 | LOG_FILE=parsing_LIP_eval_logs/${job_name}.log 28 | now=$(date +"%Y%m%d_%H%M%S") 29 | if [[ -f ${LOG_FILE} ]]; then 30 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 31 | mv ${LOG_FILE} ${LOG_FILE}_${now} 32 | fi 33 | echo 'log file: ' ${LOG_FILE} 34 | 35 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 36 | srun -n${gpus} -p rdbp1_v100_32g --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=spot \ 37 | --job-name=${job_name} --comment wbsR-SC220052.001 --cpus-per-task=5 \ 38 | python -W ignore -u ${ROOT}/test.py \ 39 | --expname ${job_name} \ 40 | --config ${CONFIG} \ 41 | --test_config ${TEST_CONFIG} \ 42 | --spec_ginfo_index ${GINFO_INDEX} \ 43 | --load-path=${TEST_MODEL} \ 44 | 2>&1 | tee ${LOG_FILE} 45 | 46 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/parsing_test_LIP.yaml: -------------------------------------------------------------------------------- 1 | common: 2 | project_name: parsing_test 3 | # backbone: 4 | # kwargs: 5 | # test_pos_mode: learnable 6 | tester: 7 | type: TesterMultiTaskDev 8 | use_ceph: True 9 | sync: True 10 | collate: dev 11 | 12 | # task_specific_param = ['backbone', 'neck', 'decoder', 'dataset', 'sampler', 'lr_scheduler', 'optimizer'] 13 | tasks: 14 | 0: 15 | name: ParTest 16 | loss_weight: 1.0 # *redundant* 17 | gres_ratio: 1 # int, > 0| world/sum*ratio, *redundant* 18 | dataset: 19 | type: LIPParsingDataset 20 | kwargs: 21 | data_path: sh1424:s3://parsing_public/LIP 22 | data_use_ratio: 1 23 | dataset: val 24 | is_train: False 25 | cfg: 26 | eval_crop_size: [ 480, 480 ] 27 | is_flip: False 28 | is_multi_scale: False 29 | 30 | ignore_value: 255 31 | num_classes: 20 32 | label_list: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] 33 | 34 | sampler: 35 | batch_size: 4 36 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/parsing_test_human36.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source /mnt/lustre/share/platform/env/pavi_env 4 | set -x 5 | 6 | # source /mnt/lustre/share/spring/r0.3.0 7 | ROOT=../../../ 8 | export PYTHONPATH=$ROOT:$PYTHONPATH 9 | 10 | if [[ ! -d "parsing_human36_eval_logs" ]]; then 11 | mkdir parsing_human36_eval_logs 12 | fi 13 | 14 | ################ 15 | gpus=${1-1} 16 | job_name=${2-v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed} 17 | CONFIG=${3-../v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml} 18 | TEST_CONFIG=${4-parsing_test_human36.yaml} 19 | GINFO_INDEX=${5-11} # task index config cherrypick (if necessary) 20 | TEST_MODEL=${6-/mnt/lustre/chencheng1/expr_files/vitruvian/L2_full_setting_joint/checkpoints/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed/ckpt_task${GINFO_INDEX}_iter_newest.pth.tar} 21 | ################ 22 | 23 | g=$((${gpus}<8?${gpus}:8)) 24 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 25 | 26 | 27 | LOG_FILE=parsing_human36_eval_logs/${job_name}.log 28 | now=$(date +"%Y%m%d_%H%M%S") 29 | if [[ -f ${LOG_FILE} ]]; then 30 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 31 | mv ${LOG_FILE} ${LOG_FILE}_${now} 32 | fi 33 | echo 'log file: ' ${LOG_FILE} 34 | 35 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 36 | srun -n${gpus} -p rdbp1_v100_32g --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=spot \ 37 | --job-name=${job_name} --comment wbsR-SC220052.001 --cpus-per-task=5 \ 38 | python -W ignore -u ${ROOT}/test.py \ 39 | --expname ${job_name} \ 40 | --config ${CONFIG} \ 41 | --test_config ${TEST_CONFIG} \ 42 | --spec_ginfo_index ${GINFO_INDEX} \ 43 | --load-path=${TEST_MODEL} \ 44 | 2>&1 | tee ${LOG_FILE} 45 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/parsing_test_human36.yaml: -------------------------------------------------------------------------------- 1 | project_name: parsing_test 2 | 3 | common: 4 | # backbone: 5 | # kwargs: 6 | # test_pos_mode: learnable 7 | tester: 8 | type: TesterMultiTaskDev 9 | use_ceph: True 10 | sync: True 11 | collate: dev 12 | 13 | # task_specific_param = ['backbone', 'neck', 'decoder', 'dataset', 'sampler', 'lr_scheduler', 'optimizer'] 14 | tasks: 15 | 0: 16 | name: ParTest 17 | loss_weight: 1.0 # *redundant* 18 | gres_ratio: 1 # int, > 0| world/sum*ratio, *redundant* 19 | dataset: 20 | type: Human3M6ParsingDataset 21 | kwargs: 22 | data_path: sh1424:s3://parsing_public/human3.6 23 | data_use_ratio: 1 24 | dataset: val 25 | is_train: False 26 | cfg: 27 | eval_crop_size: [ 480, 480 ] 28 | is_flip: False 29 | is_multi_scale: False 30 | 31 | ignore_value: 255 # TODO: duplicated with decoder.kwargs.ignore_value 32 | num_classes: 25 33 | label_list: [ 0, 1, 2, 3, 6, 7, 8, 17, 18, 19, 25, 26, 27, 32, 33, 34, 38, 39, 43, 44, 34 | 46, 49, 50, 56, 58 ] 35 | 36 | sampler: 37 | batch_size: 4 # per card 38 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/pedattr_pa100k_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -x 3 | source /mnt/lustre/share/platform/env/pavi_env 4 | 5 | # source /mnt/lustre/share/spring/r0.3.0 6 | ROOT=../../ 7 | export PYTHONPATH=$ROOT:$PYTHONPATH 8 | 9 | if [[ ! -d "pedattr_pa100k_eval_logs" ]]; then 10 | mkdir pedattr_pa100k_eval_logs 11 | fi 12 | 13 | ################ 14 | gpus=${1-1} 15 | job_name=${2-v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed} 16 | CONFIG=${3-v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml} 17 | TEST_CONFIG=${4-pedattr_pa100k_test.yaml} 18 | GINFO_INDEX=${5-8} # task index config cherrypick (if necessary) 19 | TEST_MODEL=${6-/mnt/lustre/chencheng1/expr_files/vitruvian/L2_full_setting_joint/checkpoints/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed/ckpt_task${GINFO_INDEX}_iter_newest.pth.tar} 20 | ################ 21 | 22 | g=$((${gpus}<8?${gpus}:8)) 23 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 24 | 25 | 26 | LOG_FILE=pedattr_pa100k_eval_logs/${job_name}.log 27 | now=$(date +"%Y%m%d_%H%M%S") 28 | if [[ -f ${LOG_FILE} ]]; then 29 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 30 | mv ${LOG_FILE} ${LOG_FILE}_${now} 31 | fi 32 | echo 'log file: ' ${LOG_FILE} 33 | 34 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 35 | srun -n${gpus} -p rdbp1_v100_32g --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=spot \ 36 | --job-name=${job_name} --comment wbsR-SC220052.001 --cpus-per-task=5 \ 37 | python -W ignore -u ${ROOT}/test.py \ 38 | --expname ${job_name} \ 39 | --config ${CONFIG} \ 40 | --test_config ${TEST_CONFIG} \ 41 | --spec_ginfo_index ${GINFO_INDEX} \ 42 | --load-path=${TEST_MODEL} \ 43 | 2>&1 | tee ${LOG_FILE} 44 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/pedattr_pa100k_test.yaml: -------------------------------------------------------------------------------- 1 | common: 2 | backbone: 3 | kwargs: 4 | test_pos_mode: learnable # simple_interpolate 5 | tester: 6 | type: TesterMultiTaskDev 7 | use_ceph: True 8 | sync: True 9 | collate: dev 10 | 11 | tasks: 12 | 0: 13 | name: pedattrTest 14 | loss_weight: 1.0 15 | gres_ratio: 1 # int, > 0| world/sum*ratio 16 | dataset: 17 | type: AttrDataset 18 | kwargs: 19 | data_use_ratio: 1 20 | task_spec: 21 | dataset: 'PA-100k' 22 | data_path: shlg:s3://pedattr_public/PA-100k/dataset.pkl 23 | root_path: shlg:s3://pedattr_public/PA-100k/data/ 24 | augmentation: 25 | height: 256 26 | width: 192 27 | train: False 28 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/peddet_crowdhuman_eval_logs/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_095632: -------------------------------------------------------------------------------- 1 | phoenix-srun: job 489125 queued and waiting for resources 2 | phoenix-srun: job 489125 has been allocated resources 3 | phoenix-srun: Job 489125 scheduled successfully! 4 | Current QUOTA_TYPE is [reserved], which means the job has occupied quota in RESERVED_TOTAL under your partition. 5 | Current PHX_PRIORITY is normal 6 | 7 | [_init_petrel]- 1 cur: 0.000s, avg(1): 0.000s 8 | Traceback (most recent call last): 9 | File "../../..//test.py", line 9, in 10 | from core.testers import tester_entry 11 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/testers/__init__.py", line 1, in 12 | from .reid_tester import ReIDTester 13 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/testers/reid_tester.py", line 10, in 14 | import core.models.necks as necks 15 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/models/necks/__init__.py", line 3, in 16 | from .ladder_side_attention_fpn import LadderSideAttentionFPN, ResidualLadderSideAttentionFPN 17 | ImportError: cannot import name 'ResidualLadderSideAttentionFPN' 18 | phoenix-srun: error: SH-IDC1-10-198-4-60: task 0: Exited with exit code 1 19 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/peddet_crowdhuman_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source /mnt/lustre/share/platform/env/pavi_env 4 | set -x 5 | 6 | # source /mnt/lustre/share/spring/r0.3.0 7 | ROOT=../../../ 8 | export PYTHONPATH=$ROOT:$PYTHONPATH 9 | 10 | if [[ ! -d "peddet_crowdhuman_eval_logs" ]]; then 11 | mkdir peddet_crowdhuman_eval_logs 12 | fi 13 | 14 | ################ 15 | gpus=${1-1} 16 | job_name=${2-v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed} 17 | CONFIG=${3-../v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml} 18 | TEST_CONFIG=${4-peddet_crowdhuman_test.yaml} 19 | GINFO_INDEX=${5-23} # task index config cherrypick (if necessary) 20 | TEST_MODEL=${6-/mnt/lustre/chencheng1/expr_files/vitruvian/L2_full_setting_joint/checkpoints/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed/ckpt_task${GINFO_INDEX}_iter_newest.pth.tar} 21 | ################ 22 | 23 | g=$((${gpus}<8?${gpus}:8)) 24 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 25 | 26 | 27 | LOG_FILE=peddet_crowdhuman_eval_logs/${job_name}.log 28 | now=$(date +"%Y%m%d_%H%M%S") 29 | if [[ -f ${LOG_FILE} ]]; then 30 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 31 | mv ${LOG_FILE} ${LOG_FILE}_${now} 32 | fi 33 | echo 'log file: ' ${LOG_FILE} 34 | 35 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 36 | srun -n${gpus} -p rdbp1_v100_32g --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=spot \ 37 | --job-name=${job_name} --comment wbsR-SC220052.001 --cpus-per-task=5 \ 38 | python -W ignore -u ${ROOT}/test.py \ 39 | --expname ${job_name} \ 40 | --config ${CONFIG} \ 41 | --test_config ${TEST_CONFIG} \ 42 | --spec_ginfo_index ${GINFO_INDEX} \ 43 | --load-path=${TEST_MODEL} \ 44 | 2>&1 | tee ${LOG_FILE} 45 | 46 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/peddet_crowdhuman_test.yaml: -------------------------------------------------------------------------------- 1 | common: 2 | # backbone: 3 | # kwargs: 4 | # test_pos_mode: learnable_interpolate 5 | tester: 6 | type: TesterMultiTaskDev 7 | kwargs: 8 | pos_thr: 0.05 9 | gt_path: 'CHval.odgt' 10 | 11 | use_ceph: True 12 | sync: True 13 | collate: det 14 | 15 | tasks: 16 | 0: 17 | name: CrowdHumanPeddetTest 18 | loss_weight: 1.0 # *redundant* 19 | gres_ratio: 1 # int, > 0| world/sum*ratio, *redundant* 20 | dataset: 21 | type: PedestrainDetectionDataset 22 | kwargs: 23 | data_use_ratio: 1 24 | task_spec: 25 | img_folder: 26 | - sh1424:s3://peddet_public/CrowdHuman/Images 27 | ann_file: 28 | - sh1424:s3://peddet_public/CrowdHuman/annotations/val.json 29 | return_masks: False 30 | augmentation: {'max_size': 1333} 31 | vit: True 32 | train: False 33 | sampler: 34 | batch_size: 1 35 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/pose_coco_eval_logs/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_095629: -------------------------------------------------------------------------------- 1 | phoenix-srun: job 489123 queued and waiting for resources 2 | phoenix-srun: job 489123 has been allocated resources 3 | phoenix-srun: Job 489123 scheduled successfully! 4 | Current QUOTA_TYPE is [reserved], which means the job has occupied quota in RESERVED_TOTAL under your partition. 5 | Current PHX_PRIORITY is normal 6 | 7 | [_init_petrel]- 1 cur: 0.000s, avg(1): 0.000s 8 | Traceback (most recent call last): 9 | File "../../..//test.py", line 9, in 10 | from core.testers import tester_entry 11 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/testers/__init__.py", line 1, in 12 | from .reid_tester import ReIDTester 13 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/testers/reid_tester.py", line 10, in 14 | import core.models.necks as necks 15 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/models/necks/__init__.py", line 3, in 16 | from .ladder_side_attention_fpn import LadderSideAttentionFPN, ResidualLadderSideAttentionFPN 17 | ImportError: cannot import name 'ResidualLadderSideAttentionFPN' 18 | phoenix-srun: error: SH-IDC1-10-198-4-60: task 0: Exited with exit code 1 19 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/pose_test_coco.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source /mnt/lustre/share/platform/env/pavi_env 4 | set -x 5 | 6 | # source /mnt/lustre/share/spring/r0.3.0 7 | ROOT=../../../ 8 | export PYTHONPATH=$ROOT:$PYTHONPATH 9 | 10 | if [[ ! -d "pose_coco_eval_logs" ]]; then 11 | mkdir pose_coco_eval_logs 12 | fi 13 | 14 | 15 | ################ 16 | gpus=${1-1} 17 | job_name=${2-v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed} 18 | CONFIG=${3-../v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml} 19 | TEST_CONFIG=${4-pose_test_coco.yaml} 20 | GINFO_INDEX=${5-0} # task index config cherrypick (if necessary) 21 | TEST_MODEL=${6-/mnt/lustre/chencheng1/expr_files/vitruvian/L2_full_setting_joint/checkpoints/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed/ckpt_task${GINFO_INDEX}_iter_newest.pth.tar} 22 | ################ 23 | 24 | g=$((${gpus}<8?${gpus}:8)) 25 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 26 | 27 | 28 | LOG_FILE=pose_coco_eval_logs/${job_name}.log 29 | now=$(date +"%Y%m%d_%H%M%S") 30 | if [[ -f ${LOG_FILE} ]]; then 31 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 32 | mv ${LOG_FILE} ${LOG_FILE}_${now} 33 | fi 34 | echo 'log file: ' ${LOG_FILE} 35 | 36 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 37 | srun -n${gpus} -p rdbp1_v100_32g --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=spot \ 38 | --job-name=${job_name} --comment wbsR-SC220052.001 --cpus-per-task=5 \ 39 | python -W ignore -u ${ROOT}/test.py \ 40 | --expname ${job_name} \ 41 | --config ${CONFIG} \ 42 | --test_config ${TEST_CONFIG} \ 43 | --spec_ginfo_index ${GINFO_INDEX} \ 44 | --load-path=${TEST_MODEL} \ 45 | 2>&1 | tee ${LOG_FILE} 46 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/pose_test_coco.yaml: -------------------------------------------------------------------------------- 1 | project_name: pose_test 2 | common: 3 | # backbone: 4 | # kwargs: 5 | # test_pos_mode: learnable # simple_interpolate 6 | tester: 7 | type: TesterMultiTaskDev 8 | use_ceph: True 9 | sync: True 10 | collate: dev_collate 11 | 12 | # task_specific_param = ['backbone', 'neck', 'decoder', 'dataset', 'sampler', 'lr_scheduler', 'optimizer'] 13 | tasks: 14 | 0: 15 | name: COCOPoseTest # deprecated 16 | loss_weight: 1.0 # *redundant* 17 | gres_ratio: 1 # int, > 0| world/sum*ratio, *redundant* 18 | dataset: 19 | type: COCOPosDatasetDev 20 | kwargs: 21 | img_prefix: 'sh1424:s3://pose_public/coco/val2017/' 22 | ann_file: 'sh1424:s3://pose_public/coco/annotations/person_keypoints_val2017.json' 23 | use_dup: True 24 | test_mode: True 25 | data_use_ratio: 1 26 | sampler: 27 | batch_size: 40 # per card 28 | evaluation: 29 | cfg: 30 | interval: 10 31 | metric: mAP 32 | key_indicator: AP 33 | 34 | soft_nms: False 35 | nms_thr: 1.0 36 | oks_thr: 0.9 37 | vis_thr: 0.2 38 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/reid_eval_logs/test_v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_164258: -------------------------------------------------------------------------------- 1 | phoenix-srun: job 486913 queued and waiting for resources 2 | phoenix-srun: job 486913 has been allocated resources 3 | phoenix-srun: Job 486913 scheduled successfully! 4 | Current QUOTA_TYPE is [reserved], which means the job has occupied quota in RESERVED_TOTAL under your partition. 5 | Current PHX_PRIORITY is normal 6 | 7 | /mnt/cache/share/spring/conda_envs/miniconda3/envs/s0.3.4/bin/python: can't open file '../..//test.py': [Errno 2] No such file or directory 8 | phoenix-srun: error: SH-IDC1-10-198-4-246: task 0: Exited with exit code 2 9 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/reid_eval_logs/test_v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221031_164554: -------------------------------------------------------------------------------- 1 | phoenix-srun: job 486920 queued and waiting for resources 2 | phoenix-srun: job 486920 has been allocated resources 3 | phoenix-srun: Job 486920 scheduled successfully! 4 | Current QUOTA_TYPE is [reserved], which means the job has occupied quota in RESERVED_TOTAL under your partition. 5 | Current PHX_PRIORITY is normal 6 | 7 | [_init_petrel]- 1 cur: 0.000s, avg(1): 0.000s 8 | [rank 0000]-[INFO]-[210d]-[2022-10-31 04:43:12]-[/spring/src/linklink/src/core.cc:220]: linklink init: world_size=1, rank=(0,0), device_num=1, thread_pool=1, buffer_pool=-1 9 | Traceback (most recent call last): 10 | File "../../..//test.py", line 99, in 11 | main() 12 | File "../../..//test.py", line 73, in main 13 | C_train = Config(args.config, spec_ginfo_index=args.spec_ginfo_index) 14 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/config.py", line 148, in __init__ 15 | with open(config_file) as f: 16 | FileNotFoundError: [Errno 2] No such file or directory: 'v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml' 17 | Error in system call pthread_mutex_destroy: Device or resource busy 18 | src/mpi/init/initthread.c:242 19 | phoenix-srun: error: SH-IDC1-10-198-4-246: task 0: Segmentation fault 20 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/reid_eval_logs/test_v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.log_20221101_095630: -------------------------------------------------------------------------------- 1 | phoenix-srun: job 489124 queued and waiting for resources 2 | phoenix-srun: job 489124 has been allocated resources 3 | phoenix-srun: Job 489124 scheduled successfully! 4 | Current QUOTA_TYPE is [reserved], which means the job has occupied quota in RESERVED_TOTAL under your partition. 5 | Current PHX_PRIORITY is normal 6 | 7 | [_init_petrel]- 1 cur: 0.000s, avg(1): 0.000s 8 | Traceback (most recent call last): 9 | File "../../..//test.py", line 9, in 10 | from core.testers import tester_entry 11 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/testers/__init__.py", line 1, in 12 | from .reid_tester import ReIDTester 13 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/testers/reid_tester.py", line 10, in 14 | import core.models.necks as necks 15 | File "/mnt/cache/chencheng1/vitruvian/vitruvian-multitask/core/models/necks/__init__.py", line 3, in 16 | from .ladder_side_attention_fpn import LadderSideAttentionFPN, ResidualLadderSideAttentionFPN 17 | ImportError: cannot import name 'ResidualLadderSideAttentionFPN' 18 | phoenix-srun: error: SH-IDC1-10-198-4-60: task 0: Exited with exit code 1 19 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/reid_test_MSMT.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source /mnt/lustre/share/platform/env/pavi_env 4 | set -x 5 | 6 | # source /mnt/lustre/share/spring/r0.3.0 7 | ROOT=../../../ 8 | export PYTHONPATH=$ROOT:$PYTHONPATH 9 | 10 | if [[ ! -d "reid_eval_logs" ]]; then 11 | mkdir reid_eval_logs 12 | fi 13 | 14 | ################ 15 | gpus=${1-1} 16 | job_name=${2-v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed} 17 | CONFIG=${3-../v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml} 18 | TEST_CONFIG=${4-reid_test_MSMT.yaml} 19 | GINFO_INDEX=${5-20} # task index config cherrypick (if necessary) 20 | TEST_MODEL=${6-/mnt/lustre/chencheng1/expr_files/vitruvian/L2_full_setting_joint/checkpoints/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed/ckpt_task${GINFO_INDEX}_iter_newest.pth.tar} 21 | ################ 22 | 23 | g=$((${gpus}<8?${gpus}:8)) 24 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 25 | 26 | 27 | LOG_FILE=reid_eval_logs/test_${job_name}.log 28 | now=$(date +"%Y%m%d_%H%M%S") 29 | if [[ -f ${LOG_FILE} ]]; then 30 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 31 | mv ${LOG_FILE} ${LOG_FILE}_${now} 32 | fi 33 | echo 'log file: ' ${LOG_FILE} 34 | 35 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 36 | srun -n${gpus} -p rdbp1_v100_32g --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=spot \ 37 | --job-name=${job_name} --comment wbsR-SC220052.001 --cpus-per-task=5 \ 38 | python -W ignore -u ${ROOT}/test.py \ 39 | --expname ${job_name} \ 40 | --config ${CONFIG} \ 41 | --test_config ${TEST_CONFIG} \ 42 | --spec_ginfo_index ${GINFO_INDEX} \ 43 | --load-path=${TEST_MODEL} \ 44 | 2>&1 | tee ${LOG_FILE} 45 | 46 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/reid_test_MSMT.yaml: -------------------------------------------------------------------------------- 1 | common: 2 | tester: 3 | type: 'ReIDTester' 4 | test_feature_name: 'feature_nobn' 5 | use_ceph: True 6 | sync: True 7 | 8 | tasks : 9 | 0 : 10 | name : reid_MSMT 11 | loss_weight : 1.0 12 | gres_ratio: 1 13 | dataset: 14 | type: ReIDTestDataset 15 | kwargs: 16 | root_path: sh1424:s3://pedreid_public/ 17 | query_file_path: 18 | - sh1424:s3://pedreid_public/MSMT17_V1/data_list/probe.txt 19 | gallery_file_path: 20 | - sh1424:s3://pedreid_public/MSMT17_V1/data_list/gallery.txt 21 | loader: 'pil' 22 | vit: True -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/reid_test_cuhk03.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source /mnt/lustre/share/platform/env/pavi_env 4 | set -x 5 | 6 | # source /mnt/lustre/share/spring/r0.3.0 7 | ROOT=../../../ 8 | export PYTHONPATH=$ROOT:$PYTHONPATH 9 | 10 | if [[ ! -d "reid_eval_logs" ]]; then 11 | mkdir reid_eval_logs 12 | fi 13 | 14 | ################ 15 | gpus=${1-1} 16 | job_name=${2-v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed} 17 | CONFIG=${3-../v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml} 18 | TEST_CONFIG=${4-reid_test_cuhk03.yaml} 19 | GINFO_INDEX=${5-20} # task index config cherrypick (if necessary) 20 | TEST_MODEL=${6-/mnt/lustre/chencheng1/expr_files/vitruvian/L2_full_setting_joint/checkpoints/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed/ckpt_task${GINFO_INDEX}_iter_newest.pth.tar} 21 | ################ 22 | 23 | g=$((${gpus}<8?${gpus}:8)) 24 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 25 | 26 | 27 | LOG_FILE=reid_eval_logs/test_${job_name}.log 28 | now=$(date +"%Y%m%d_%H%M%S") 29 | if [[ -f ${LOG_FILE} ]]; then 30 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 31 | mv ${LOG_FILE} ${LOG_FILE}_${now} 32 | fi 33 | echo 'log file: ' ${LOG_FILE} 34 | 35 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 36 | srun -n${gpus} -p rdbp1_v100_32g --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=spot \ 37 | --job-name=${job_name} --comment wbsR-SC220052.001 --cpus-per-task=5 \ 38 | python -W ignore -u ${ROOT}/test.py \ 39 | --expname ${job_name} \ 40 | --config ${CONFIG} \ 41 | --test_config ${TEST_CONFIG} \ 42 | --spec_ginfo_index ${GINFO_INDEX} \ 43 | --load-path=${TEST_MODEL} \ 44 | 2>&1 | tee ${LOG_FILE} 45 | 46 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/reid_test_cuhk03.yaml: -------------------------------------------------------------------------------- 1 | common: 2 | tester: 3 | type: 'ReIDTester' 4 | test_feature_name: 'feature_nobn' 5 | use_ceph: True 6 | sync: True 7 | 8 | tasks : 9 | 0 : 10 | name : cuhk03_1 11 | loss_weight : 1.0 12 | gres_ratio: 1 13 | dataset: 14 | type: ReIDTestDataset 15 | kwargs: 16 | root_path: sh1424:s3://pedreid_public/ 17 | query_file_path: 18 | - sh1424:s3://pedreid_public/cuhk03_1/data_list/probe.txt 19 | gallery_file_path: 20 | - sh1424:s3://pedreid_public/cuhk03_1/data_list/gallery.txt 21 | loader: 'pil' 22 | vit: True -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/reid_test_duke.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source /mnt/lustre/share/platform/env/pavi_env 4 | set -x 5 | 6 | # source /mnt/lustre/share/spring/r0.3.0 7 | ROOT=../../../ 8 | export PYTHONPATH=$ROOT:$PYTHONPATH 9 | 10 | if [[ ! -d "reid_eval_logs" ]]; then 11 | mkdir reid_eval_logs 12 | fi 13 | 14 | ################ 15 | gpus=${1-1} 16 | job_name=${2-v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed} 17 | CONFIG=${3-../v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml} 18 | TEST_CONFIG=${4-reid_test_duke.yaml} 19 | GINFO_INDEX=${5-20} # task index config cherrypick (if necessary) 20 | TEST_MODEL=${6-/mnt/lustre/chencheng1/expr_files/vitruvian/L2_full_setting_joint/checkpoints/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed/ckpt_task${GINFO_INDEX}_iter_newest.pth.tar} 21 | ################ 22 | 23 | g=$((${gpus}<8?${gpus}:8)) 24 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 25 | 26 | 27 | LOG_FILE=reid_eval_logs/test_${job_name}.log 28 | now=$(date +"%Y%m%d_%H%M%S") 29 | if [[ -f ${LOG_FILE} ]]; then 30 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 31 | mv ${LOG_FILE} ${LOG_FILE}_${now} 32 | fi 33 | echo 'log file: ' ${LOG_FILE} 34 | 35 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 36 | srun -n${gpus} -p rdbp1_v100_32g --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=spot \ 37 | --job-name=${job_name} --comment wbsR-SC220052.001 --cpus-per-task=5 \ 38 | python -W ignore -u ${ROOT}/test.py \ 39 | --expname ${job_name} \ 40 | --config ${CONFIG} \ 41 | --test_config ${TEST_CONFIG} \ 42 | --spec_ginfo_index ${GINFO_INDEX} \ 43 | --load-path=${TEST_MODEL} \ 44 | 2>&1 | tee ${LOG_FILE} 45 | 46 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/reid_test_duke.yaml: -------------------------------------------------------------------------------- 1 | common: 2 | tester: 3 | type: 'ReIDTester' 4 | test_feature_name: 'feature_nobn' 5 | use_ceph: True 6 | sync: True 7 | 8 | tasks : 9 | 0 : 10 | name : reid_duke 11 | loss_weight : 1.0 12 | gres_ratio: 1 13 | dataset: 14 | type: ReIDTestDataset 15 | kwargs: 16 | root_path: sh1424:s3://pedreid_public/ 17 | query_file_path: 18 | - sh1424:s3://pedreid_public/dukemtmc-reid/data_list/probe.txt 19 | gallery_file_path: 20 | - sh1424:s3://pedreid_public/dukemtmc-reid/data_list/gallery.txt 21 | loader: 'pil' 22 | vit: True -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/reid_test_market.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source /mnt/lustre/share/platform/env/pavi_env 4 | set -x 5 | 6 | # source /mnt/lustre/share/spring/r0.3.0 7 | ROOT=../../../ 8 | export PYTHONPATH=$ROOT:$PYTHONPATH 9 | 10 | if [[ ! -d "reid_eval_logs" ]]; then 11 | mkdir reid_eval_logs 12 | fi 13 | 14 | ################ 15 | gpus=${1-1} 16 | job_name=${2-v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed} 17 | CONFIG=${3-../v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml} 18 | TEST_CONFIG=${4-reid_test_market.yaml} 19 | GINFO_INDEX=${5-20} # task index config cherrypick (if necessary) 20 | TEST_MODEL=${6-/mnt/lustre/chencheng1/expr_files/vitruvian/L2_full_setting_joint/checkpoints/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed/ckpt_task${GINFO_INDEX}_iter_newest.pth.tar} 21 | ################ 22 | 23 | g=$((${gpus}<8?${gpus}:8)) 24 | echo 'start job:' ${job_name} ' config:' ${CONFIG} ' test_config:' ${TEST_CONFIG} 25 | 26 | 27 | LOG_FILE=reid_eval_logs/test_${job_name}.log 28 | now=$(date +"%Y%m%d_%H%M%S") 29 | if [[ -f ${LOG_FILE} ]]; then 30 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 31 | mv ${LOG_FILE} ${LOG_FILE}_${now} 32 | fi 33 | echo 'log file: ' ${LOG_FILE} 34 | 35 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 36 | srun -n${gpus} -p rdbp1_v100_32g --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=spot \ 37 | --job-name=${job_name} --comment wbsR-SC220052.001 --cpus-per-task=5 \ 38 | python -W ignore -u ${ROOT}/test.py \ 39 | --expname ${job_name} \ 40 | --config ${CONFIG} \ 41 | --test_config ${TEST_CONFIG} \ 42 | --spec_ginfo_index ${GINFO_INDEX} \ 43 | --load-path=${TEST_MODEL} \ 44 | 2>&1 | tee ${LOG_FILE} 45 | 46 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/test/reid_test_market.yaml: -------------------------------------------------------------------------------- 1 | common: 2 | tester: 3 | type: 'ReIDTester' 4 | test_feature_name: 'feature_nobn' 5 | use_ceph: True 6 | sync: True 7 | 8 | tasks : 9 | 0 : 10 | name : market1501 11 | loss_weight : 1.0 12 | gres_ratio: 1 13 | dataset: 14 | type: ReIDTestDataset 15 | kwargs: 16 | data_use_ratio: 1 17 | root_path: sh1424:s3://pedreid_public/ 18 | query_file_path: 19 | - sh1424:s3://pedreid_public/market1501/data_list/probe.txt 20 | gallery_file_path: 21 | - sh1424:s3://pedreid_public/market1501/data_list/gallery.txt 22 | loader: 'pil' 23 | vit: True 24 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_joint_v100_32g/train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source /mnt/lustre/share/platform/env/pavi_env 3 | # set -x 4 | 5 | # source /mnt/lustre/share/spring/r0.3.0 6 | ROOT=../../ 7 | export PYTHONPATH=$ROOT:$PYTHONPATH 8 | 9 | if [[ ! -d "train_logs" ]]; then 10 | mkdir train_logs 11 | fi 12 | 13 | ################ 14 | gpus=${1-64} 15 | job_name=${2-v100_32g_vitbase_size480_lr1e3_stepLRx3_bmp1_adafactor_wd005_clip1_layerdecay075_lpe_LSA_reduct8_tbn1_heads2_gate1_SENetAtte_peddetShareDecoder_exp3_setting_SharePosEmbed} 16 | CONFIG=${3-v100_32g_vitbase_size480_lr1e3_stepLRx3_bmp1_adafactor_wd005_clip1_layerdecay075_lpe_LSA_reduct8_tbn1_heads2_gate1_SENetAtte_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml} 17 | ################ 18 | 19 | g=$((${gpus}<8?${gpus}:8)) 20 | echo 'start job:' ${job_name} ' config:' ${CONFIG} 21 | 22 | 23 | LOG_FILE=train_logs/${job_name}.log 24 | now=$(date +"%Y%m%d_%H%M%S") 25 | if [[ -f ${LOG_FILE} ]]; then 26 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 27 | mv ${LOG_FILE} ${LOG_FILE}_${now} 28 | fi 29 | echo 'log file: ' ${LOG_FILE} 30 | 31 | # resume_config='v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed' 32 | # resume_iter=70000 33 | 34 | resume_config='' 35 | resume_iter=0 36 | 37 | 38 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 39 | srun -n${gpus} -p rdbp1_v100_32g --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=reserved \ 40 | --job-name=${job_name} --cpus-per-task=5 --preempt --comment wbsR-SC220052.001 \ 41 | python -W ignore -u ${ROOT}/multitask.py \ 42 | --expname ${job_name} \ 43 | --config ${CONFIG} \ 44 | --auto-resume=checkpoints/${resume_config}/ckpt_task_iter_${resume_iter}.pth.tar \ 45 | 2>&1 | tee ${LOG_FILE} 46 | -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_vit_large_a100_80g/scripts/dataset_specific_sample_weight.py: -------------------------------------------------------------------------------- 1 | def print_dataset_specific_training_info(total_iters, dataset_samples, dataset_sample_weight, dataset_imgs_per_gpu, GPU_per_dataset, data_use_ratio=0.1): 2 | print('total iters: ', total_iters) 3 | datasets = list(dataset_samples.keys()) 4 | 5 | print('############### epoch per dataset ###############') 6 | for i, dataset in enumerate(datasets): 7 | print('{}: {}: {}'.format(i, dataset, (total_iters * dataset_imgs_per_gpu[dataset] * GPU_per_dataset[dataset]) / int(dataset_samples[dataset] * data_use_ratio))) 8 | 9 | print('############### config ###############') 10 | print("\t sw| gpus| bs") 11 | for i, dataset in enumerate(datasets): 12 | print('{}: {}: {}, {}, {}'.format(i, dataset, dataset_sample_weight[dataset] * dataset_imgs_per_gpu[dataset] * GPU_per_dataset[dataset], GPU_per_dataset[dataset], dataset_imgs_per_gpu[dataset])) 13 | 14 | print('############### total GPUs ###############') 15 | count = 0 16 | for per in list(GPU_per_dataset.values()): 17 | count += per 18 | print("GPUs: ", count) 19 | print("nodes: ", count // 8) 20 | 21 | 22 | ## full dataset merge attr dataset 23 | dataset_samples = {'coco_pose': 149813, 'aic_pose': 378352, 'posetrack': 97174, 'jrdb2022': 310035, 'mhp_pose': 41128, 'penn_action': 163839, '3dpw': 74620, 'halpe': 41712,'3dhp': 1031701, 'h36m_pose': 312187, 'AIST': 1015257, 24 | 'h36m_par': 62668, 'lip_par': 30462, 'cihp_par': 28280, 'vip_par': 18469, 'paper_roll': 1035825, 25 | 'deepfashion': 191961, 'modanet': 52245, 26 | 'rap2_pa100k_attr': 67943 + 90000, '5set_attr': 28336 + 16183 + 27482 + 34183 + 12936, 27 | 'reid_4set': 67070, 'LaST_PRCC_DGMarket': 128309 + 71248 + 17896, 'LUperson': 5000000, 28 | 'crowdhuman_det': 15000, '5set_det': 9000+91500+23892+2975+118287} 29 | 30 | dataset_sample_weight = {'coco_pose': 8000, 'aic_pose': 6000, 'posetrack': 6000, 'jrdb2022': 4000, 'mhp_pose': 4000, 'penn_action': 4000, '3dpw': 4000, 'halpe': 2000,'3dhp': 2000, 'h36m_pose': 2000, 'AIST': 2000, 31 | 'h36m_par': 20, 'lip_par': 20, 'cihp_par': 20, 'vip_par': 20, 'paper_roll': 15, 32 | 'deepfashion': 15, 'modanet': 15, 33 | 'rap2_pa100k_attr': 0.1, '5set_attr': 0.1, 34 | 'reid_4set': 5, 'LaST_PRCC_DGMarket': 0.1, 'LUperson': 1, 35 | 'crowdhuman_det': 10, '5set_det': 10} 36 | 37 | dataset_imgs_per_gpu = {'coco_pose': 448, 'aic_pose': 448, 'posetrack': 224, 'jrdb2022': 224, 'mhp_pose': 96, 'penn_action': 128, '3dpw': 128, 'halpe': 64,'3dhp': 128, 'h36m_pose': 128, 'AIST': 128, 38 | 'h36m_par': 64, 'lip_par': 36, 'cihp_par': 48, 'vip_par': 16, 'paper_roll': 48, 39 | 'deepfashion': 64, 'modanet': 32, 40 | 'rap2_pa100k_attr': 128, '5set_attr': 116, 41 | 'reid_4set': 112, 'LaST_PRCC_DGMarket': 96, 'LUperson': 384, 42 | 'crowdhuman_det': 4, '5set_det': 4} 43 | 44 | GPU_per_dataset = {'coco_pose': 1, 'aic_pose': 1, 'posetrack': 1, 'jrdb2022': 1, 'mhp_pose': 1, 'penn_action': 1, '3dpw': 1, 'halpe': 1,'3dhp': 1, 'h36m_pose': 1, 'AIST': 1, 45 | 'h36m_par': 1, 'lip_par': 1, 'cihp_par': 1, 'vip_par': 1, 'paper_roll': 1, 46 | 'deepfashion': 1, 'modanet': 1, 47 | 'rap2_pa100k_attr': 1, '5set_attr': 1, 48 | 'reid_4set': 1, 'LaST_PRCC_DGMarket': 1, 'LUperson': 1, 49 | 'crowdhuman_det': 8, '5set_det': 9} 50 | 51 | 52 | total_iters = 80000 53 | data_use_ratio = 1 54 | print_dataset_specific_training_info(total_iters, dataset_samples, dataset_sample_weight, dataset_imgs_per_gpu, GPU_per_dataset, data_use_ratio=data_use_ratio) -------------------------------------------------------------------------------- /PATH/experiments/L2_full_setting_vit_large_a100_80g/train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source /mnt/lustre/share/platform/env/pavi_env 3 | # set -x 4 | 5 | # source /mnt/lustre/share/spring/r0.3.0 6 | ROOT=../../ 7 | export PYTHONPATH=$ROOT:$PYTHONPATH 8 | 9 | if [[ ! -d "train_logs" ]]; then 10 | mkdir train_logs 11 | fi 12 | 13 | ################ 14 | gpus=${1-64} 15 | job_name=${2-v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed} 16 | CONFIG=${3-v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.yaml} 17 | ################ 18 | 19 | g=$((${gpus}<8?${gpus}:8)) 20 | echo 'start job:' ${job_name} ' config:' ${CONFIG} 21 | 22 | 23 | LOG_FILE=train_logs/${job_name}.log 24 | now=$(date +"%Y%m%d_%H%M%S") 25 | if [[ -f ${LOG_FILE} ]]; then 26 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 27 | mv ${LOG_FILE} ${LOG_FILE}_${now} 28 | fi 29 | echo 'log file: ' ${LOG_FILE} 30 | 31 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 32 | srun -n${gpus} -p rdbp1_v100_32g --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=reserved \ 33 | --job-name=${job_name} --cpus-per-task=5 --preempt --comment wbsR-SC220052.001 -x SH-IDC1-10-198-4-[33,34] \ 34 | python -W ignore -u ${ROOT}/multitask.py \ 35 | --expname ${job_name} \ 36 | --config ${CONFIG} \ 37 | --auto-resume=checkpoints/${job_name}/ckpt_task_iter_newest.pth.tar \ 38 | 2>&1 | tee ${LOG_FILE} 39 | -------------------------------------------------------------------------------- /PATH/experiments/evaluation/attr/full_finetune/pa100k_vitbase_b64_SGD_lr1e2x05_stepLRx2_wd5e4_backboneclip_dpr03_DecoderWd0_30ep.yaml: -------------------------------------------------------------------------------- 1 | out_dir: /mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_pa100k_attr_ablation 2 | 3 | common: # prefix 4 | project_name: L2_pa100k_attr_ablation 5 | 6 | backbone: 7 | type: vit_base_patch16 8 | kwargs: 9 | task_sp_list: ['pos_embed', 'rel_pos_h', 'rel_pos_w'] # wrong list would somehow cause .cuda() stuck without error 10 | pretrained: True 11 | pretrain_path: /mnt/lustre/share/chencheng1/pretrain/L2_final_base/wo_cls_token/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.pth 12 | img_size: [224, 224] # deprecated by simple interpolate 13 | lms_checkpoint_train: fairscale 14 | window: False 15 | test_pos_mode: learnable_simple_interpolate # to_do: ablation 16 | pad_attn_mask: False # to_do: ablation 17 | round_padding: True 18 | learnable_pos: True 19 | drop_path_rate: 0.3 20 | 21 | solver: 22 | type: SolverMultiTaskDev 23 | 24 | lr_scheduler: 25 | type: 'Step' 26 | kwargs: 27 | base_lr: 1.0e-4 28 | warmup_steps: 500 29 | warmup_lr: 1.0e-2 #5.0e-4 30 | lr_mults: [0.1, 0.1] 31 | lr_steps: [31640, 40077] # 75% 95% 32 | 33 | backbone_multiplier: 0.5 34 | optimizer: 35 | type: SGD 36 | kwargs: 37 | weight_decay: 0.0005 38 | nesterov: False 39 | 40 | layer_decay: 41 | # layer decay 42 | num_layers: 12 43 | layer_decay_rate: 0.75 44 | lpe_lr: True 45 | 46 | auto_denan: False 47 | 48 | workers: 2 49 | max_iter: 42187 # (90000 * 30) / 64 50 | 51 | deterministic: True # seed control 52 | cudnn_deterministic: True 53 | worker_rank: True 54 | random_seed: 42 55 | 56 | print_freq: 10 57 | vis_batch: False 58 | save_interval: 60000 59 | # save_iters: [36000] 60 | 61 | use_ceph: True 62 | sync: True 63 | 64 | decoder_wd: 0 65 | 66 | tasks : 67 | 0: 68 | name: pedattr 69 | loss_weight: 1.0 70 | gres_ratio: 1 # int, > 0| world/sum*ratio 71 | dataset: 72 | type: AttrDataset 73 | kwargs: 74 | task_spec: 75 | dataset: 'PA-100k' 76 | data_path: sh1424:s3://pedattr_public/PA-100k/dataset.pkl 77 | root_path: sh1424:s3://pedattr_public/PA-100k/data/ 78 | augmentation: 79 | height: 256 80 | width: 192 81 | use_random_aug: False 82 | sampler: 83 | batch_size: 64 # per card 84 | shuffle_strategy: 1 85 | 86 | neck: 87 | type: DoNothing 88 | kwargs: {} 89 | 90 | decoder: 91 | type: pedattr_cls_vit_A 92 | kwargs: 93 | out_feature: 768 94 | nattr: 26 95 | loss_cfg: 96 | type: CEL_Sigmoid 97 | kwargs: 98 | sample_weight: [0.04354444,0.17997778,0.5834,0.4166,0.04947778,0.15104444, 99 | 0.10775556,0.04191111,0.00472222,0.01688889, 0.03241111, 100 | 0.71171111,0.17344444,0.11484444, 0.006, 101 | 0.185, 0.19273333, 0.1601, 0.00952222, 0.01345556, 102 | 0.92437778, 0.06216667, 0.46044444, 0.35266667, 0.29462222, 103 | 0.35271111] 104 | size_average: True 105 | -------------------------------------------------------------------------------- /PATH/experiments/evaluation/attr/full_finetune/peta_vitbase_b64_adafactor_lr1e3x05_stepLRx2_wd5e4_dpr01_80ep.yaml: -------------------------------------------------------------------------------- 1 | out_dir: /mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_attr_finetune 2 | 3 | common: # prefix 4 | project_name: L2_peta_attr_finetune 5 | 6 | backbone: 7 | type: vit_base_patch16 8 | kwargs: 9 | task_sp_list: ['pos_embed', 'rel_pos_h', 'rel_pos_w'] # wrong list would somehow cause .cuda() stuck without error 10 | pretrained: True 11 | pretrain_path: /mnt/lustre/share/chencheng1/pretrain/L2_final_base/wo_cls_token/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.pth 12 | img_size: [224, 224] # deprecated by simple interpolate 13 | lms_checkpoint_train: fairscale 14 | window: False 15 | test_pos_mode: learnable_simple_interpolate # to_do: ablation 16 | pad_attn_mask: False # to_do: ablation 17 | round_padding: True 18 | learnable_pos: True 19 | drop_path_rate: 0.1 20 | 21 | solver: 22 | type: SolverMultiTaskDev 23 | 24 | lr_scheduler: 25 | type: 'Step' 26 | kwargs: 27 | base_lr: 1.0e-5 28 | warmup_steps: 500 29 | warmup_lr: 1.0e-3 #5.0e-4 30 | lr_mults: [0.1, 0.1] 31 | lr_steps: [10687, 12825] # 75% 90% 32 | 33 | backbone_multiplier: 0.5 34 | 35 | optimizer: 36 | type: Adafactor_dev 37 | kwargs: 38 | beta1: 0.9 39 | clip_beta2: 0.999 40 | clip_threshold: 1. 41 | decay_rate: -0.8 42 | scale_parameter: False 43 | relative_step: False 44 | weight_decay: 0.05 45 | 46 | layer_decay: 47 | # layer decay 48 | num_layers: 12 49 | layer_decay_rate: 0.75 50 | lpe_lr: True 51 | 52 | auto_denan: False 53 | 54 | workers: 2 55 | max_iter: 14250 56 | 57 | deterministic: True # seed control 58 | cudnn_deterministic: True 59 | worker_rank: True 60 | random_seed: 42 61 | 62 | print_freq: 10 63 | vis_batch: False 64 | save_interval: 60000 65 | save_iters: [12000] 66 | 67 | use_ceph: True 68 | sync: True 69 | 70 | 71 | tasks : # prefix 72 | 0: 73 | name: attr_peta 74 | loss_weight: 1.0 75 | gres_ratio: 1 # int, > 0| world/sum*ratio 76 | dataset: 77 | type: AttrDataset 78 | kwargs: 79 | task_spec: 80 | dataset: 'peta' 81 | data_path: sh1424:s3://pedattr_public/peta/dataset.pkl 82 | root_path: sh1424:s3://pedattr_public/peta/images/ 83 | augmentation: 84 | height: 256 85 | width: 192 86 | use_random_aug: False 87 | sampler: 88 | batch_size: 32 # per card 89 | shuffle_strategy: 1 90 | neck: 91 | type: DoNothing 92 | kwargs: {} 93 | 94 | decoder: # todo: coco instance seg config for now 95 | type: pedattr_cls_vit_A 96 | kwargs: 97 | out_feature: 768 98 | nattr: 35 99 | loss_cfg: 100 | type: CEL_Sigmoid 101 | kwargs: 102 | sample_weight: [0.10570175, 0.08438596, 0.74526316, 0.02929825, 0.23763158, 103 | 0.85192982, 0.13491228, 0.06842105, 0.04096491, 0.02649123, 104 | 0.14078947, 0.01754386, 0.08421053, 0.45614035, 0.01263158, 105 | 0.86052632, 0.13763158, 0.30701754, 0.035 , 0.045 , 106 | 0.51210526, 0.29938596, 0.02140351, 0.36210526, 0.21324561, 107 | 0.19631579, 0.19807018, 0.29333333, 0.27649123, 0.07614035, 108 | 0.4922807 , 0.33385965, 0.10219298, 0.06236842, 0.55035088] 109 | size_average: True 110 | -------------------------------------------------------------------------------- /PATH/experiments/evaluation/attr/full_finetune/rap2_vitbase_b64_SGD_lr1e2x1_stepLRx2_wd5e4_dpr02_35ep.yaml: -------------------------------------------------------------------------------- 1 | out_dir: /mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_attr_finetune 2 | 3 | common: # prefix 4 | project_name: L2_rap2_attr_finetune 5 | 6 | backbone: 7 | type: vit_base_patch16 8 | kwargs: 9 | task_sp_list: ['pos_embed', 'rel_pos_h', 'rel_pos_w'] # wrong list would somehow cause .cuda() stuck without error 10 | pretrained: True 11 | pretrain_path: /mnt/lustre/share/chencheng1/pretrain/L2_final_base/wo_cls_token/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.pth 12 | img_size: [224, 224] # deprecated by simple interpolate 13 | lms_checkpoint_train: fairscale 14 | window: False 15 | test_pos_mode: learnable_simple_interpolate # to_do: ablation 16 | pad_attn_mask: False # to_do: ablation 17 | round_padding: True 18 | learnable_pos: True 19 | drop_path_rate: 0.2 20 | 21 | solver: 22 | type: SolverMultiTaskDev 23 | 24 | lr_scheduler: 25 | type: 'Step' 26 | kwargs: 27 | base_lr: 1.0e-4 28 | warmup_steps: 500 29 | warmup_lr: 1.0e-2 #5.0e-4 30 | lr_mults: [0.1, 0.1] 31 | lr_steps: [27867, 33440] # 37156 75% 90% 32 | 33 | backbone_multiplier: 1.0 34 | pos_embed_multiplier: 2.0 35 | 36 | optimizer: 37 | type: SGD 38 | kwargs: 39 | weight_decay: 0.0005 40 | nesterov: False 41 | 42 | layer_decay: 43 | # layer decay 44 | num_layers: 12 45 | layer_decay_rate: 0.75 46 | lpe_lr: True 47 | 48 | auto_denan: False 49 | 50 | workers: 2 51 | max_iter: 37156 # 35ep (67943 * 35) / 64 52 | 53 | deterministic: True # seed control 54 | cudnn_deterministic: True 55 | worker_rank: True 56 | random_seed: 42 57 | 58 | print_freq: 10 59 | vis_batch: False 60 | save_interval: 60000 61 | save_iters: [32000] 62 | 63 | use_ceph: True 64 | sync: True 65 | 66 | 67 | tasks : # prefix 68 | 0: 69 | name: attr_peta 70 | loss_weight: 1.0 71 | gres_ratio: 1 # int, > 0| world/sum*ratio 72 | dataset: 73 | type: AttrDataset 74 | kwargs: 75 | task_spec: 76 | dataset: 'rap2' 77 | data_path: sh1424:s3://pedattr_public/rap2/dataset.pkl 78 | root_path: sh1424:s3://pedattr_public/rap2/RAP_dataset/ 79 | augmentation: 80 | height: 256 81 | width: 192 82 | use_random_aug: False 83 | sampler: 84 | batch_size: 32 # per card 85 | shuffle_strategy: 1 86 | neck: 87 | type: DoNothing 88 | kwargs: {} 89 | 90 | decoder: 91 | type: pedattr_cls_vit_A 92 | kwargs: 93 | out_feature: 768 94 | nattr: 54 95 | loss_cfg: 96 | type: CEL_Sigmoid 97 | kwargs: 98 | sample_weight: [0.00575482, 0.19323551, 0.93186936, 0.01533638, 0.0663203 , 99 | 0.21637255, 0.07765333, 0.04739267, 0.23145872, 0.11599429, 100 | 0.28473868, 0.03042256, 0.04175559, 0.09656624, 0.02725814, 101 | 0.57574732, 0.02970137, 0.02045833, 0.02796462, 0.26612013, 102 | 0.11776048, 0.26311761, 0.20243439, 0.0844973 , 0.01432083, 103 | 0.22655756, 0.08448258, 0.0213267 , 0.0690726 , 0.02636033, 104 | 0.03813491, 0.0274642 , 0.01036163, 0.02444696, 0.296631 , 105 | 0.00887509, 0.4031026 , 0.54734115, 0.03529429, 0.31651531, 106 | 0.13645261, 0.77788735, 0.07419455, 0.93875749, 0.05350073, 107 | 0.03379303, 0.02666941, 0.04840822, 0.02328422, 0.01050881, 108 | 0.01789736, 0.0254478 , 0.13287609, 0.01022916, 109 | ] 110 | size_average: True 111 | -------------------------------------------------------------------------------- /PATH/experiments/evaluation/attr/head_finetune/pa100k_vitbase_b64_SGD_lr1e1_stepLRx2_backboneclip_dpr03_30ep_FixBackbone.yaml: -------------------------------------------------------------------------------- 1 | out_dir: /mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_attr_finetune 2 | 3 | common: # prefix 4 | project_name: L2_pa100k_attr_finetune 5 | 6 | backbone: 7 | type: vit_base_patch16 8 | kwargs: 9 | task_sp_list: ['pos_embed', 'rel_pos_h', 'rel_pos_w'] # wrong list would somehow cause .cuda() stuck without error 10 | pretrained: True 11 | pretrain_path: /mnt/lustre/share/chencheng1/pretrain/L2_final_base/wo_cls_token/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.pth 12 | img_size: [224, 224] # deprecated by simple interpolate 13 | lms_checkpoint_train: fairscale 14 | window: False 15 | test_pos_mode: learnable_simple_interpolate # to_do: ablation 16 | pad_attn_mask: False # to_do: ablation 17 | round_padding: True 18 | learnable_pos: True 19 | drop_path_rate: 0.3 20 | 21 | solver: 22 | type: SolverMultiTaskDev 23 | 24 | lr_scheduler: 25 | type: 'Step' 26 | kwargs: 27 | base_lr: 1.0e-4 28 | warmup_steps: 500 29 | warmup_lr: 1.0e-1 #5.0e-4 30 | lr_mults: [0.1, 0.1] 31 | lr_steps: [31640, 40077] # 75% 95% 32 | 33 | backbone_multiplier: 1.0 34 | optimizer: 35 | type: SGD 36 | kwargs: 37 | weight_decay: 0 38 | nesterov: False 39 | 40 | layer_decay: 41 | # layer decay 42 | num_layers: 12 43 | layer_decay_rate: 0.75 44 | lpe_lr: True 45 | 46 | auto_denan: False 47 | 48 | workers: 2 49 | max_iter: 42187 # (90000 * 30) / 64 50 | 51 | deterministic: True # seed control 52 | cudnn_deterministic: True 53 | worker_rank: True 54 | random_seed: 42 55 | 56 | print_freq: 10 57 | vis_batch: False 58 | save_interval: 60000 59 | save_iters: [36000] 60 | 61 | use_ceph: True 62 | sync: True 63 | 64 | fix_backbone: True 65 | 66 | tasks : 67 | 0: 68 | name: pedattr 69 | loss_weight: 1.0 70 | gres_ratio: 1 # int, > 0| world/sum*ratio 71 | dataset: 72 | type: AttrDataset 73 | kwargs: 74 | task_spec: 75 | dataset: 'PA-100k' 76 | data_path: sh1424:s3://pedattr_public/PA-100k/dataset.pkl 77 | root_path: sh1424:s3://pedattr_public/PA-100k/data/ 78 | augmentation: 79 | height: 256 80 | width: 192 81 | use_random_aug: False 82 | sampler: 83 | batch_size: 32 # per card 84 | shuffle_strategy: 1 85 | 86 | neck: 87 | type: DoNothing 88 | kwargs: {} 89 | 90 | decoder: 91 | type: pedattr_cls_vit_A 92 | kwargs: 93 | out_feature: 768 94 | nattr: 26 95 | loss_cfg: 96 | type: CEL_Sigmoid 97 | kwargs: 98 | sample_weight: [0.04354444,0.17997778,0.5834,0.4166,0.04947778,0.15104444, 99 | 0.10775556,0.04191111,0.00472222,0.01688889, 0.03241111, 100 | 0.71171111,0.17344444,0.11484444, 0.006, 101 | 0.185, 0.19273333, 0.1601, 0.00952222, 0.01345556, 102 | 0.92437778, 0.06216667, 0.46044444, 0.35266667, 0.29462222, 103 | 0.35271111] 104 | size_average: True 105 | -------------------------------------------------------------------------------- /PATH/experiments/evaluation/attr/head_finetune/peta_vitbase_b64_adafactor_lr1e1_stepLRx2_wd5e4_dpr01_80ep_FixBackbone.yaml: -------------------------------------------------------------------------------- 1 | out_dir: /mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_attr_finetune 2 | 3 | common: # prefix 4 | project_name: L2_peta_attr_finetune 5 | 6 | backbone: 7 | type: vit_base_patch16 8 | kwargs: 9 | task_sp_list: ['pos_embed', 'rel_pos_h', 'rel_pos_w'] # wrong list would somehow cause .cuda() stuck without error 10 | pretrained: True 11 | pretrain_path: /mnt/lustre/share/chencheng1/pretrain/L2_final_base/wo_cls_token/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.pth 12 | img_size: [224, 224] # deprecated by simple interpolate 13 | lms_checkpoint_train: fairscale 14 | window: False 15 | test_pos_mode: learnable_simple_interpolate # to_do: ablation 16 | pad_attn_mask: False # to_do: ablation 17 | round_padding: True 18 | learnable_pos: True 19 | drop_path_rate: 0.1 20 | 21 | solver: 22 | type: SolverMultiTaskDev 23 | 24 | lr_scheduler: 25 | type: 'Step' 26 | kwargs: 27 | base_lr: 1.0e-5 28 | warmup_steps: 500 29 | warmup_lr: 1.0e-1 #5.0e-4 30 | lr_mults: [0.1, 0.1] 31 | lr_steps: [10687, 12825] # 75% 90% 32 | 33 | backbone_multiplier: 1.0 34 | 35 | optimizer: 36 | type: Adafactor_dev 37 | kwargs: 38 | beta1: 0.9 39 | clip_beta2: 0.999 40 | clip_threshold: 1. 41 | decay_rate: -0.8 42 | scale_parameter: False 43 | relative_step: False 44 | weight_decay: 0 45 | 46 | layer_decay: 47 | # layer decay 48 | num_layers: 12 49 | layer_decay_rate: 0.75 50 | lpe_lr: True 51 | 52 | auto_denan: False 53 | 54 | workers: 2 55 | max_iter: 14250 56 | 57 | deterministic: True # seed control 58 | cudnn_deterministic: True 59 | worker_rank: True 60 | random_seed: 42 61 | 62 | print_freq: 10 63 | vis_batch: False 64 | save_interval: 60000 65 | save_iters: [12000] 66 | 67 | use_ceph: True 68 | sync: True 69 | 70 | fix_backbone: True 71 | 72 | tasks : # prefix 73 | 0: 74 | name: attr_peta 75 | loss_weight: 1.0 76 | gres_ratio: 1 # int, > 0| world/sum*ratio 77 | dataset: 78 | type: AttrDataset 79 | kwargs: 80 | task_spec: 81 | dataset: 'peta' 82 | data_path: sh1424:s3://pedattr_public/peta/dataset.pkl 83 | root_path: sh1424:s3://pedattr_public/peta/images/ 84 | augmentation: 85 | height: 256 86 | width: 192 87 | use_random_aug: False 88 | sampler: 89 | batch_size: 32 # per card 90 | shuffle_strategy: 1 91 | neck: 92 | type: DoNothing 93 | kwargs: {} 94 | 95 | decoder: # todo: coco instance seg config for now 96 | type: pedattr_cls_vit_A 97 | kwargs: 98 | out_feature: 768 99 | nattr: 35 100 | loss_cfg: 101 | type: CEL_Sigmoid 102 | kwargs: 103 | sample_weight: [0.10570175, 0.08438596, 0.74526316, 0.02929825, 0.23763158, 104 | 0.85192982, 0.13491228, 0.06842105, 0.04096491, 0.02649123, 105 | 0.14078947, 0.01754386, 0.08421053, 0.45614035, 0.01263158, 106 | 0.86052632, 0.13763158, 0.30701754, 0.035 , 0.045 , 107 | 0.51210526, 0.29938596, 0.02140351, 0.36210526, 0.21324561, 108 | 0.19631579, 0.19807018, 0.29333333, 0.27649123, 0.07614035, 109 | 0.4922807 , 0.33385965, 0.10219298, 0.06236842, 0.55035088] 110 | size_average: True 111 | -------------------------------------------------------------------------------- /PATH/experiments/evaluation/attr/partial_finetune/pa100k_vitbase_b64_SGD_lr1e2_stepLRx2_wd0_backboneclip_dpr01_30ep_PartialFT_OpenLast2_OpenNorm.yaml: -------------------------------------------------------------------------------- 1 | out_dir: /mnt/lustrenew/chencheng1/expr_files/vitruvian/devL2/L2_attr_finetune 2 | 3 | common: # prefix 4 | project_name: L2_pa100k_attr_finetune 5 | 6 | backbone: 7 | type: vit_base_patch16 8 | kwargs: 9 | task_sp_list: ['pos_embed', 'rel_pos_h', 'rel_pos_w'] # wrong list would somehow cause .cuda() stuck without error 10 | pretrained: True 11 | pretrain_path: /mnt/lustre/share/chencheng1/pretrain/L2_pretrain_75000_iter/wo_cls_token/v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_clip05_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed.pth 12 | img_size: [224, 224] # deprecated by simple interpolate 13 | lms_checkpoint_train: fairscale 14 | window: False 15 | test_pos_mode: learnable_simple_interpolate # to_do: ablation 16 | pad_attn_mask: False # to_do: ablation 17 | round_padding: True 18 | learnable_pos: True 19 | drop_path_rate: 0.1 20 | 21 | solver: 22 | type: SolverMultiTaskDev 23 | 24 | lr_scheduler: 25 | type: 'Step' 26 | kwargs: 27 | base_lr: 1.0e-4 28 | warmup_steps: 500 29 | warmup_lr: 1.0e-2 #5.0e-4 30 | lr_mults: [0.1, 0.1] 31 | lr_steps: [31640, 40077] # 75% 95% 32 | 33 | backbone_multiplier: 1.0 34 | optimizer: 35 | type: SGD 36 | kwargs: 37 | weight_decay: 0. 38 | nesterov: False 39 | 40 | layer_decay: 41 | # layer decay 42 | num_layers: 12 43 | layer_decay_rate: 0.75 44 | lpe_lr: True 45 | 46 | auto_denan: False 47 | 48 | workers: 2 49 | max_iter: 42187 # (90000 * 30) / 64 50 | 51 | deterministic: True # seed control 52 | cudnn_deterministic: True 53 | worker_rank: True 54 | random_seed: 42 55 | 56 | print_freq: 10 57 | vis_batch: False 58 | save_interval: 60000 59 | save_iters: [28000] 60 | 61 | use_ceph: True 62 | sync: True 63 | 64 | fix_backbone_partial_layers: ['backbone_module.cls_token', 'backbone_module.pos_embed', 'backbone_module.patch_embed.proj.weight', 'backbone_module.patch_embed.proj.bias', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] 65 | partialFT_open_norm: True 66 | 67 | tasks : 68 | 0: 69 | name: pedattr 70 | loss_weight: 1.0 71 | gres_ratio: 1 # int, > 0| world/sum*ratio 72 | dataset: 73 | type: AttrDataset 74 | kwargs: 75 | task_spec: 76 | dataset: 'PA-100k' 77 | data_path: sh1424:s3://pedattr_public/PA-100k/dataset.pkl 78 | root_path: sh1424:s3://pedattr_public/PA-100k/data/ 79 | augmentation: 80 | height: 256 81 | width: 192 82 | use_random_aug: False 83 | sampler: 84 | batch_size: 32 # per card 85 | shuffle_strategy: 1 86 | 87 | neck: 88 | type: DoNothing 89 | kwargs: {} 90 | 91 | decoder: 92 | type: pedattr_cls_vit_A 93 | kwargs: 94 | out_feature: 768 95 | nattr: 26 96 | loss_cfg: 97 | type: CEL_Sigmoid 98 | kwargs: 99 | sample_weight: [0.04354444,0.17997778,0.5834,0.4166,0.04947778,0.15104444, 100 | 0.10775556,0.04191111,0.00472222,0.01688889, 0.03241111, 101 | 0.71171111,0.17344444,0.11484444, 0.006, 102 | 0.185, 0.19273333, 0.1601, 0.00952222, 0.01345556, 103 | 0.92437778, 0.06216667, 0.46044444, 0.35266667, 0.29462222, 104 | 0.35271111] 105 | size_average: True 106 | -------------------------------------------------------------------------------- /PATH/experiments/release_debug/train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source /mnt/lustre/share/platform/env/pavi_env 3 | # set -x 4 | 5 | # source /mnt/lustre/share/spring/r0.3.0 6 | ROOT=../../ 7 | export PYTHONPATH=$ROOT:$PYTHONPATH 8 | 9 | if [[ ! -d "train_logs" ]]; then 10 | mkdir train_logs 11 | fi 12 | 13 | ################ 14 | gpus=${1-8} 15 | job_name=${2-pedattr_debug} 16 | CONFIG=${3-pedattr_debug.yaml} 17 | ################ 18 | 19 | g=$((${gpus}<8?${gpus}:8)) 20 | echo 'start job:' ${job_name} ' config:' ${CONFIG} 21 | 22 | 23 | LOG_FILE=train_logs/${job_name}.log 24 | now=$(date +"%Y%m%d_%H%M%S") 25 | if [[ -f ${LOG_FILE} ]]; then 26 | echo 'log_file exists. mv: ' ${LOG_FILE} ' =>' ${LOG_FILE}_${now}.log 27 | mv ${LOG_FILE} ${LOG_FILE}_${now} 28 | fi 29 | echo 'log file: ' ${LOG_FILE} 30 | 31 | # resume_config='v100_32g_vitbase_size224_lr1e3_stepLRx3_bmp1_adafactor_wd01_layerdecay075_lpe_peddet_citypersons_LSA_reduct8_tbn1_heads2_gate1_peddetShareDecoder_exp3_setting_SharePosEmbed' 32 | # resume_iter=70000 33 | 34 | resume_config='' 35 | resume_iter=0 36 | 37 | 38 | LINKLINK_FUSED_BUFFER_LOG2_MB=-1 GLOG_vmodule=MemcachedClient=-1 MKL_SERVICE_FORCE_INTEL=1 \ 39 | srun -n${gpus} -p rdbp1_1080ti --gres=gpu:${g} --ntasks-per-node=${g} --mpi=pmi2 --quotatype=reserved \ 40 | --job-name=${job_name} --cpus-per-task=5 --preempt --comment wbsR-SC220052.001 \ 41 | python -W ignore -u ${ROOT}/multitask.py \ 42 | --expname ${job_name} \ 43 | --config ${CONFIG} \ 44 | --auto-resume=checkpoints/${resume_config}/ckpt_task_iter_${resume_iter}.pth.tar \ 45 | 2>&1 | tee ${LOG_FILE} 46 | -------------------------------------------------------------------------------- /PATH/helper/align.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | from skimage import transform as trans 4 | 5 | def affine_align(img, landmark=None, **kwargs): 6 | M = None 7 | src = np.array([ 8 | [38.2946, 51.6963], 9 | [73.5318, 51.5014], 10 | [56.0252, 71.7366], 11 | [41.5493, 92.3655], 12 | [70.7299, 92.2041] ], dtype=np.float32 ) 13 | # src=src * 224 / 112 14 | 15 | dst = landmark.astype(np.float32) 16 | tform = trans.SimilarityTransform() 17 | tform.estimate(dst, src) 18 | M = tform.params[0:2,:] 19 | warped = cv2.warpAffine(img, M, (112, 112), borderValue = 0.0) 20 | return warped 21 | 22 | 23 | def kestrel_get_similar_matrix(src_points, dst_points): 24 | if src_points.size != dst_points.size: 25 | print("error: the size of src_points and dst_points must be same", 26 | "which is {0} vs. {1}".format(src_points.size, dst_points.size)) 27 | exit(-1) 28 | 29 | dst_points = dst_points.T.reshape(-1) 30 | 31 | point_num = src_points.shape[0] 32 | new_src_points = np.zeros((point_num * 2, 4)) 33 | new_src_points[:point_num, :2] = src_points 34 | new_src_points[:point_num, 2] = 1 35 | new_src_points[:point_num, 3] = 0 36 | 37 | new_src_points[point_num:, 0] = src_points[:, 1] 38 | new_src_points[point_num:, 1] = -src_points[:, 0] 39 | new_src_points[point_num:, 2] = 0 40 | new_src_points[point_num:, 3] = 1 41 | 42 | min_square_solution = np.linalg.lstsq(new_src_points, dst_points, 43 | rcond=-1)[0] 44 | 45 | trans_matrix = np.array([ 46 | [ min_square_solution[0], -min_square_solution[1], 0 ], 47 | [ min_square_solution[1], min_square_solution[0], 0 ], 48 | [ min_square_solution[2], min_square_solution[3], 1 ], 49 | ]) 50 | 51 | return trans_matrix.T[:2] 52 | 53 | def transform(pts, M): 54 | dst = np.matmul(pts, M[:, :2].T) 55 | dst[:, 0] += M[0, 2] 56 | dst[:, 1] += M[1, 2] 57 | return dst 58 | 59 | 60 | def affine_alignSDK(img, landmark=None, borderMode=cv2.BORDER_REPLICATE, flags=cv2.INTER_LINEAR): 61 | M = None 62 | dst_points = np.array([[70.745156, 111.9996875], [108.23625, 111.9996875], [89.700875, 153.514375]], dtype=np.float32) 63 | default_shape = (178,218) 64 | lmk = landmark.astype(np.float32) 65 | src_points = np.array([ 66 | lmk[0], lmk[1], 67 | (lmk[3] + lmk[4]) / 2 68 | ], dtype=np.float32) 69 | # src_points = get_trans_points(landmarks) 70 | trans_matrix = kestrel_get_similar_matrix(src_points, dst_points) 71 | trans_matrix = np.concatenate((trans_matrix, [[0, 0, 1]]), axis=0) 72 | # print(rotate_points_106) 73 | return cv2.warpPerspective(img, trans_matrix, default_shape, borderMode, flags=flags), trans_matrix 74 | -------------------------------------------------------------------------------- /PATH/helper/multitask_schedule.py: -------------------------------------------------------------------------------- 1 | def cat_dataset(batch_size, iters, dataset_size, imgs_per_gpu, sample_weight): 2 | print(f"====> dataset_size:\t{dataset_size}") 3 | print(f"====> sample_weight:\t{sample_weight}") 4 | print(f"====> iters:\t{iters}") 5 | print(f"initial batch_size:\t{batch_size}") 6 | total = sum(dataset_size.values()) 7 | t_wise_batchsize = {k: v / total * batch_size for k, v in dataset_size.items()} 8 | t_wise_gpuse = {k: v / imgs_per_gpu[k] for k, v in t_wise_batchsize.items()} 9 | 10 | print(f"-----------------------rounded-----------------------") 11 | gpus = 1 12 | while gpus % 8 != 0: 13 | t_wise_batchsize = {k: round(v / total * batch_size / imgs_per_gpu[k]) * imgs_per_gpu[k] for k, v in 14 | dataset_size.items()} 15 | t_wise_gpuse = {k: v // imgs_per_gpu[k] for k, v in t_wise_batchsize.items()} 16 | t_wise_epochs = {k: iters * t_wise_batchsize[k] / v for k, v in dataset_size.items()} 17 | batch_size += 1 18 | gpus = sum(t_wise_gpuse.values()) 19 | loss_weights = {k: v * t_wise_batchsize[k] for k, v in sample_weight.items()} 20 | print(f"rounded batch_size:\t{sum(t_wise_batchsize.values())}") 21 | print(f"task-wise batchsize:\t{t_wise_batchsize}") 22 | print(f"task-wise epoch:\t{t_wise_epochs}\t avg apoch: {sum(t_wise_epochs.values()) / len(t_wise_epochs)}") 23 | print(f"loss weights:\t{loss_weights}") 24 | 25 | print(f"task-wise gpus:\t{t_wise_gpuse}\ngpus:\t{gpus} ({gpus // 8} nodes)") 26 | 27 | 28 | # example usage 29 | cat_dataset(batch_size=600, 30 | iters=10000, 31 | dataset_size={'reid':118063, 'pose': 149813, 32 | 'h36_parse': 62668, 'LIP': 30462, 'CIHP': 28280}, 33 | imgs_per_gpu={'reid':96, 'pose': 16, 34 | 'h36_parse': 7, 'LIP': 7, 'CIHP': 7}, 35 | sample_weight={'reid': 2, 'pose':8000, 36 | 'h36_parse': 1, 37 | 'LIP': 1, 38 | 'CIHP': 1,}) 39 | # output: 40 | # ====> dataset_size: {'reid': 118063, 'pose': 149813, 'h36_parse': 62668, 'LIP': 30462, 'CIHP': 28280} 41 | # ====> sample_weight: {'reid': 2, 'pose': 8000, 'h36_parse': 1, 'LIP': 1, 'CIHP': 1} 42 | # ====> iters: 10000 43 | # initial batch_size: 600 44 | # -----------------------rounded----------------------- 45 | # rounded batch_size: 658 46 | # task-wise batchsize: {'reid': 192, 'pose': 256, 'h36_parse': 105, 'LIP': 56, 'CIHP': 49} 47 | # task-wise epoch: {'reid': 16.262503917400032, 'pose': 17.087969668853837, 'h36_parse': 16.75496266036893, 'LIP': 18.383559845052854, 'CIHP': 17.326732673267326} avg apoch: 17.163145752988598 48 | # loss weights: {'reid': 384, 'pose': 2048000, 'h36_parse': 105, 'LIP': 56, 'CIHP': 49} 49 | # task-wise gpus: {'reid': 2, 'pose': 16, 'h36_parse': 15, 'LIP': 8, 'CIHP': 7} 50 | # gpus: 48 (6 nodes) -------------------------------------------------------------------------------- /PATH/multitask.py: -------------------------------------------------------------------------------- 1 | import shutil 2 | import os 3 | import multiprocessing as mp 4 | if mp.get_start_method(allow_none=True) != 'spawn': 5 | mp.set_start_method('spawn') 6 | import argparse 7 | from core.distributed_utils import dist_init 8 | from core.config import Config 9 | from core.solvers import solver_entry 10 | import torch 11 | 12 | parser = argparse.ArgumentParser(description='Multi-Task Training Framework') 13 | parser.add_argument('--load-path', default='', type=str) 14 | parser.add_argument('--ignore', nargs='+', default=[], type=str) 15 | parser.add_argument('--recover', action='store_true') 16 | parser.add_argument('--load-single', action='store_true') 17 | parser.add_argument('--port', default='23456', type=str) 18 | parser.add_argument('--config', default='', type=str) 19 | parser.add_argument('--expname', type=str, default=None, help='experiment name, output folder') 20 | parser.add_argument('--auto-resume', type=str, default=None, help='jobs auto resume from the pattern_path or the folder') 21 | parser.add_argument('--forwardbn', action='store_true', help='just forward for re-calcuating bn values') 22 | parser.add_argument('--finetune',action='store_true') 23 | 24 | 25 | def main(): 26 | args = parser.parse_args() 27 | 28 | dist_init() 29 | 30 | C = Config(args.config) 31 | if args.expname is not None: 32 | C.config['expname'] = args.expname 33 | 34 | S = solver_entry(C) 35 | config_save_to = os.path.join(S.ckpt_path, 'config.yaml') 36 | 37 | # auto resume strategy for spring.submit arun 38 | if args.auto_resume is not None: 39 | args.auto_resume = os.path.join(S.out_dir, args.auto_resume) 40 | if os.path.isdir(args.auto_resume): 41 | max_iter = 0 42 | filename = os.listdir(args.auto_resume) 43 | for file in filename: 44 | if file.startswith('ckpt_task0') and file.endswith('.pth.tar'): 45 | cur_iter = int(file.split('_')[-1].split('.')[0]) 46 | max_iter = max(max_iter, cur_iter) 47 | if max_iter > 0: 48 | args.load_path = os.path.join(args.auto_resume, 49 | 'ckpt_task_iter_{}.pth.tar'.format(str(max_iter))) 50 | args.recover = True 51 | args.ignore = [] 52 | print('auto-resume from: {}'.format(args.load_path)) 53 | elif args.auto_resume.endswith('.pth.tar'): 54 | tmpl = args.auto_resume.replace('ckpt_task_', 'ckpt_task*_') 55 | import glob 56 | ckpt = glob.glob(tmpl) 57 | if len(ckpt) > 0: 58 | args.load_path = args.auto_resume 59 | args.recover = True 60 | args.ignore = [] 61 | print('auto-resume from: {}'.format(args.load_path)) 62 | else: 63 | print('auto-resume not work:{}'.format(args.auto_resume)) 64 | 65 | #tmp = torch.Tensor(1).cuda() 66 | if not os.path.exists(config_save_to): 67 | shutil.copy(args.config, config_save_to) 68 | 69 | S.initialize(args) 70 | 71 | S.run() 72 | 73 | 74 | if __name__ == '__main__': 75 | main() 76 | -------------------------------------------------------------------------------- /PATH/requirements.txt: -------------------------------------------------------------------------------- 1 | dict_recursive_update==1.0.1 2 | easydict==1.9 3 | json_tricks==3.15.5 4 | numpy==1.19.5 5 | opencv_python==4.1.1.26 6 | pycocotools_fix==2.0.0.9 7 | scikit_image==0.16.2 8 | scipy==1.3.1 9 | Shapely==1.8.1.post1 10 | timm==0.6.7 11 | torch==1.8.1+cuda90.cudnn7.6.5 12 | torchvision==0.8.0a0+2f40a48 13 | tqdm==4.37.0 14 | xtcocotools==1.12 15 | -------------------------------------------------------------------------------- /PATH/test.py: -------------------------------------------------------------------------------- 1 | import shutil 2 | import os 3 | import multiprocessing as mp 4 | if mp.get_start_method(allow_none=True) != 'spawn': 5 | mp.set_start_method('spawn') 6 | import argparse 7 | from core.distributed_utils import dist_init 8 | from core.config import Config 9 | from core.testers import tester_entry 10 | import torch 11 | import yaml 12 | import re 13 | 14 | parser = argparse.ArgumentParser(description='Multi-Task Training Framework') 15 | parser.add_argument('--spec_ginfo_index', type=int, required=True) 16 | parser.add_argument('--load-path', default='', type=str) 17 | parser.add_argument('--ignore', nargs='+', default=[], type=str) 18 | parser.add_argument('--recover', action='store_true') 19 | parser.add_argument('--load-single', action='store_true') 20 | parser.add_argument('--port', default='23456', type=str) 21 | parser.add_argument('--config', default='', type=str) 22 | parser.add_argument('--test_config', default='', type=str) 23 | parser.add_argument('--expname', type=str, default=None, help='experiment name, output folder') 24 | parser.add_argument('--auto-resume', type=str, default=None, help='jobs auto resume from the pattern_path or the folder') 25 | 26 | loader = yaml.SafeLoader 27 | loader.add_implicit_resolver( 28 | u'tag:yaml.org,2002:float', 29 | re.compile(u'''^(?: 30 | [-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+]?[0-9]+)? 31 | |[-+]?(?:[0-9][0-9_]*)(?:[eE][-+]?[0-9]+) 32 | |\\.[0-9_]+(?:[eE][-+][0-9]+)? 33 | |[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]* 34 | |[-+]?\\.(?:inf|Inf|INF) 35 | |\\.(?:nan|NaN|NAN))$''', re.X), 36 | list(u'-+0123456789.')) 37 | 38 | def main(): 39 | args = parser.parse_args() 40 | dist_init() 41 | 42 | # auto resume strategy for spring.submit arun 43 | if args.auto_resume is not None: 44 | if os.path.isdir(args.auto_resume): 45 | max_iter = 0 46 | filename = os.listdir(args.auto_resume) 47 | for file in filename: 48 | if file.startswith('ckpt_task0') and file.endswith('.pth.tar'): 49 | cur_iter = int(file.split('_')[-1].split('.')[0]) 50 | max_iter = max(max_iter, cur_iter) 51 | if max_iter > 0: 52 | args.load_path = os.path.join(args.auto_resume, 53 | 'ckpt_task_iter_{}.pth.tar'.format(str(max_iter))) 54 | args.recover = True 55 | args.ignore = [] 56 | print('auto-resume from: {}'.format(args.load_path)) 57 | elif args.auto_resume.endswith('.pth.tar'): 58 | tmpl = args.auto_resume.replace('ckpt_task_', 'ckpt_task*_') 59 | import glob 60 | ckpt = glob.glob(tmpl) 61 | if len(ckpt) > 0: 62 | args.load_path = args.auto_resume 63 | args.recover = True 64 | args.ignore = [] 65 | print('auto-resume from: {}'.format(args.load_path)) 66 | else: 67 | print('auto-resume not work:{}'.format(args.auto_resume)) 68 | 69 | #tmp = torch.Tensor(1).cuda() 70 | C_train = Config(args.config, spec_ginfo_index=args.spec_ginfo_index) 71 | 72 | with open(args.test_config) as f: 73 | test_config = yaml.load(f, Loader=loader) 74 | num_test_tasks = len(test_config['tasks']) 75 | 76 | for test_spec_ginfo_index in range(num_test_tasks): 77 | C_test = Config(args.test_config, spec_ginfo_index=test_spec_ginfo_index) 78 | if args.expname is not None: 79 | C_train.config['expname'] = args.expname 80 | 81 | S = tester_entry(C_train, C_test) 82 | config_save_to = os.path.join(S.ckpt_path, 'config.yaml') 83 | test_config_save_to = os.path.join(S.ckpt_path, 'test_config_task{}.yaml'.format(test_spec_ginfo_index)) 84 | if not os.path.exists(config_save_to): 85 | shutil.copy(args.config, config_save_to) 86 | shutil.copy(args.test_config, test_config_save_to) 87 | 88 | S.initialize(args) 89 | 90 | S.run() 91 | 92 | 93 | if __name__ == '__main__': 94 | main() 95 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 |

HumanBench: Towards Human-Centric Foundation Models

4 | 5 | 6 |
7 | 8 | --- 9 | 10 | 11 | 12 | 13 | - [**HumanBench**](PATH) (CVPR 2023) - HumanBench: Towards General Human-centric Perception with Projector Assisted Pretraining 14 | 15 | - [**UniHCP**](https://github.com/OpenGVLab/UniHCP/tree/cf8d7c300fc7ef3f7c005132ccb0fa19b43295e0) (CVPR 2023) - UniHCP: A Unified Model for Human-Centric Perceptions 16 | 17 | 18 | ## News 19 | - 2023.4 Code of PATH is available. 20 | - 2023.3 Code of UniHCP is available. 21 | 22 | ## Contact 23 | - **We are hiring** at all levels at Shanghai Artificial Labolotory, including full-time researchers, engineers and interns. 24 | If you are interested in working with us on **human-centric foundation model and human-centric AIGC driven by foundation model**, please contact [tangshixiang](`tangshixiang2016@gmail.com`). 25 | 26 | 27 | 28 | ## License 29 | 30 | The content of this project itself is licensed under [LICENSE](LICENSE). 31 | 32 | ## Citation 33 | 34 | ``` 35 | @article{tang2023humanbench, 36 | title={HumanBench: Towards General Human-centric Perception with Projector Assisted Pretraining}, 37 | author={Tang, Shixiang and Chen, Cheng and Xie, Qingsong and Chen, Meilin and Wang, Yizhou and Ci, Yuanzheng and Bai, Lei and Zhu, Feng and Yang, Haiyang and Yi, Li and others}, 38 | journal={arXiv preprint arXiv:2303.05675}, 39 | year={2023} 40 | } 41 | 42 | @article{ci2023unihcp, 43 | title={UniHCP: A Unified Model for Human-Centric Perceptions}, 44 | author={Ci, Yuanzheng and Wang, Yizhou and Chen, Meilin and Tang, Shixiang and Bai, Lei and Zhu, Feng and Zhao, Rui and Yu, Fengwei and Qi, Donglian and Ouyang, Wanli}, 45 | journal={arXiv preprint arXiv:2303.02936}, 46 | year={2023} 47 | } 48 | ``` 49 | 50 | -------------------------------------------------------------------------------- /asset/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/asset/.DS_Store -------------------------------------------------------------------------------- /asset/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/asset/cover.png -------------------------------------------------------------------------------- /asset/teaser.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/HumanBench/f3fd3b380ebd5240f177883aca49c79c21ae4ada/asset/teaser.jpg --------------------------------------------------------------------------------