├── .gitignore ├── INSTALL.md ├── LICENSE ├── README.md ├── README_CN.md ├── app.py ├── assets ├── arch1.png ├── audio │ ├── bird_audio.wav │ ├── cat.wav │ ├── dog_audio.wav │ ├── rain.wav │ └── wave.wav ├── demo2.gif ├── demo3.gif ├── demo4.gif ├── demo5.gif ├── demo6.jpg ├── demo_short.gif ├── gvlab_logo.png ├── images │ ├── IMG3584.jpeg │ ├── IMG3585.jpeg │ ├── IMG3588.jpeg │ ├── IMG3589.jpeg │ ├── dog_image.jpg │ ├── ultrakun.jpeg │ └── workspace.jpeg ├── thermal │ ├── 030419.jpg │ └── 030444.jpg └── videos │ └── iKun.mp4 ├── configs ├── big_lama_config.yaml ├── med_config.json ├── q2l_config.json ├── swin │ ├── config_swinB_224.json │ ├── config_swinB_384.json │ ├── config_swinB_480.json │ ├── config_swinB_576.json │ └── config_swinB_608.json └── tag2text_caption.yaml ├── docker ├── Dockerfile ├── DragGAN │ ├── Dockerfile │ └── docker-compose.yml ├── InternGPT_CN │ ├── Dockerfile │ └── docker-compose.yml └── docker-compose.yml ├── iGPT ├── __init__.py ├── controllers │ ├── ConversationBot.py │ └── __init__.py └── models │ ├── __init__.py │ ├── anything2image.py │ ├── drag_gan.py │ ├── drag_gan_src │ ├── __init__.py │ ├── drag_gan.py │ └── stylegan2 │ │ ├── _init__.py │ │ ├── model.py │ │ └── op │ │ ├── __init__.py │ │ ├── conv2d_gradfix.py │ │ ├── fused_act.py │ │ ├── fused_bias_act.cpp │ │ ├── fused_bias_act_kernel.cu │ │ ├── upfirdn2d.cpp │ │ ├── upfirdn2d.py │ │ └── upfirdn2d_kernel.cu │ ├── grit_model.py │ ├── grit_src │ ├── configs │ │ ├── Base.yaml │ │ ├── GRiT_B_DenseCap.yaml │ │ ├── GRiT_B_DenseCap_ObjectDet.yaml │ │ ├── GRiT_B_ObjectDet.yaml │ │ ├── GRiT_H_ObjectDet.yaml │ │ └── GRiT_L_ObjectDet.yaml │ ├── grit │ │ ├── __init__.py │ │ ├── config.py │ │ ├── custom_solver.py │ │ ├── data │ │ │ ├── custom_build_augmentation.py │ │ │ ├── custom_dataset_dataloader.py │ │ │ ├── custom_dataset_mapper.py │ │ │ ├── datasets │ │ │ │ ├── grit_coco.py │ │ │ │ ├── object365.py │ │ │ │ └── vg.py │ │ │ └── transforms │ │ │ │ ├── custom_augmentation_impl.py │ │ │ │ └── custom_transform.py │ │ ├── evaluation │ │ │ └── eval.py │ │ ├── modeling │ │ │ ├── backbone │ │ │ │ ├── utils.py │ │ │ │ └── vit.py │ │ │ ├── meta_arch │ │ │ │ └── grit.py │ │ │ ├── roi_heads │ │ │ │ ├── grit_fast_rcnn.py │ │ │ │ └── grit_roi_heads.py │ │ │ ├── soft_nms.py │ │ │ └── text │ │ │ │ ├── file_utils.py │ │ │ │ ├── load_text_token.py │ │ │ │ ├── modeling_bert.py │ │ │ │ └── text_decoder.py │ │ └── predictor.py │ ├── image_dense_captions.py │ └── third_party │ │ └── CenterNet2 │ │ ├── .circleci │ │ └── config.yml │ │ ├── .clang-format │ │ ├── .flake8 │ │ ├── .gitignore │ │ ├── GETTING_STARTED.md │ │ ├── INSTALL.md │ │ ├── LICENSE │ │ ├── MODEL_ZOO.md │ │ ├── README.md │ │ ├── README_D2.md │ │ ├── configs │ │ ├── Base-RCNN-C4.yaml │ │ ├── Base-RCNN-DilatedC5.yaml │ │ ├── Base-RCNN-FPN.yaml │ │ ├── Base-RetinaNet.yaml │ │ ├── COCO-Detection │ │ │ ├── fast_rcnn_R_50_FPN_1x.yaml │ │ │ ├── faster_rcnn_R_101_C4_3x.yaml │ │ │ ├── faster_rcnn_R_101_DC5_3x.yaml │ │ │ ├── faster_rcnn_R_101_FPN_3x.yaml │ │ │ ├── faster_rcnn_R_50_C4_1x.yaml │ │ │ ├── faster_rcnn_R_50_C4_3x.yaml │ │ │ ├── faster_rcnn_R_50_DC5_1x.yaml │ │ │ ├── faster_rcnn_R_50_DC5_3x.yaml │ │ │ ├── faster_rcnn_R_50_FPN_1x.yaml │ │ │ ├── faster_rcnn_R_50_FPN_3x.yaml │ │ │ ├── faster_rcnn_X_101_32x8d_FPN_3x.yaml │ │ │ ├── fcos_R_50_FPN_1x.py │ │ │ ├── retinanet_R_101_FPN_3x.yaml │ │ │ ├── retinanet_R_50_FPN_1x.py │ │ │ ├── retinanet_R_50_FPN_1x.yaml │ │ │ ├── retinanet_R_50_FPN_3x.yaml │ │ │ ├── rpn_R_50_C4_1x.yaml │ │ │ └── rpn_R_50_FPN_1x.yaml │ │ ├── COCO-InstanceSegmentation │ │ │ ├── mask_rcnn_R_101_C4_3x.yaml │ │ │ ├── mask_rcnn_R_101_DC5_3x.yaml │ │ │ ├── mask_rcnn_R_101_FPN_3x.yaml │ │ │ ├── mask_rcnn_R_50_C4_1x.py │ │ │ ├── mask_rcnn_R_50_C4_1x.yaml │ │ │ ├── mask_rcnn_R_50_C4_3x.yaml │ │ │ ├── mask_rcnn_R_50_DC5_1x.yaml │ │ │ ├── mask_rcnn_R_50_DC5_3x.yaml │ │ │ ├── mask_rcnn_R_50_FPN_1x.py │ │ │ ├── mask_rcnn_R_50_FPN_1x.yaml │ │ │ ├── mask_rcnn_R_50_FPN_1x_giou.yaml │ │ │ ├── mask_rcnn_R_50_FPN_3x.yaml │ │ │ ├── mask_rcnn_X_101_32x8d_FPN_3x.yaml │ │ │ ├── mask_rcnn_regnetx_4gf_dds_fpn_1x.py │ │ │ └── mask_rcnn_regnety_4gf_dds_fpn_1x.py │ │ ├── COCO-Keypoints │ │ │ ├── Base-Keypoint-RCNN-FPN.yaml │ │ │ ├── keypoint_rcnn_R_101_FPN_3x.yaml │ │ │ ├── keypoint_rcnn_R_50_FPN_1x.py │ │ │ ├── keypoint_rcnn_R_50_FPN_1x.yaml │ │ │ ├── keypoint_rcnn_R_50_FPN_3x.yaml │ │ │ └── keypoint_rcnn_X_101_32x8d_FPN_3x.yaml │ │ ├── COCO-PanopticSegmentation │ │ │ ├── Base-Panoptic-FPN.yaml │ │ │ ├── panoptic_fpn_R_101_3x.yaml │ │ │ ├── panoptic_fpn_R_50_1x.py │ │ │ ├── panoptic_fpn_R_50_1x.yaml │ │ │ └── panoptic_fpn_R_50_3x.yaml │ │ ├── Cityscapes │ │ │ └── mask_rcnn_R_50_FPN.yaml │ │ ├── Detectron1-Comparisons │ │ │ ├── README.md │ │ │ ├── faster_rcnn_R_50_FPN_noaug_1x.yaml │ │ │ ├── keypoint_rcnn_R_50_FPN_1x.yaml │ │ │ └── mask_rcnn_R_50_FPN_noaug_1x.yaml │ │ ├── LVISv0.5-InstanceSegmentation │ │ │ ├── mask_rcnn_R_101_FPN_1x.yaml │ │ │ ├── mask_rcnn_R_50_FPN_1x.yaml │ │ │ └── mask_rcnn_X_101_32x8d_FPN_1x.yaml │ │ ├── LVISv1-InstanceSegmentation │ │ │ ├── mask_rcnn_R_101_FPN_1x.yaml │ │ │ ├── mask_rcnn_R_50_FPN_1x.yaml │ │ │ └── mask_rcnn_X_101_32x8d_FPN_1x.yaml │ │ ├── Misc │ │ │ ├── cascade_mask_rcnn_R_50_FPN_1x.yaml │ │ │ ├── cascade_mask_rcnn_R_50_FPN_3x.yaml │ │ │ ├── cascade_mask_rcnn_X_152_32x8d_FPN_IN5k_gn_dconv.yaml │ │ │ ├── mask_rcnn_R_50_FPN_1x_cls_agnostic.yaml │ │ │ ├── mask_rcnn_R_50_FPN_1x_dconv_c3-c5.yaml │ │ │ ├── mask_rcnn_R_50_FPN_3x_dconv_c3-c5.yaml │ │ │ ├── mask_rcnn_R_50_FPN_3x_gn.yaml │ │ │ ├── mask_rcnn_R_50_FPN_3x_syncbn.yaml │ │ │ ├── mmdet_mask_rcnn_R_50_FPN_1x.py │ │ │ ├── panoptic_fpn_R_101_dconv_cascade_gn_3x.yaml │ │ │ ├── scratch_mask_rcnn_R_50_FPN_3x_gn.yaml │ │ │ ├── scratch_mask_rcnn_R_50_FPN_9x_gn.yaml │ │ │ ├── scratch_mask_rcnn_R_50_FPN_9x_syncbn.yaml │ │ │ ├── semantic_R_50_FPN_1x.yaml │ │ │ └── torchvision_imagenet_R_50.py │ │ ├── PascalVOC-Detection │ │ │ ├── faster_rcnn_R_50_C4.yaml │ │ │ └── faster_rcnn_R_50_FPN.yaml │ │ ├── common │ │ │ ├── README.md │ │ │ ├── coco_schedule.py │ │ │ ├── data │ │ │ │ ├── coco.py │ │ │ │ ├── coco_keypoint.py │ │ │ │ └── coco_panoptic_separated.py │ │ │ ├── models │ │ │ │ ├── cascade_rcnn.py │ │ │ │ ├── fcos.py │ │ │ │ ├── keypoint_rcnn_fpn.py │ │ │ │ ├── mask_rcnn_c4.py │ │ │ │ ├── mask_rcnn_fpn.py │ │ │ │ ├── panoptic_fpn.py │ │ │ │ └── retinanet.py │ │ │ ├── optim.py │ │ │ └── train.py │ │ ├── new_baselines │ │ │ ├── mask_rcnn_R_101_FPN_100ep_LSJ.py │ │ │ ├── mask_rcnn_R_101_FPN_200ep_LSJ.py │ │ │ ├── mask_rcnn_R_101_FPN_400ep_LSJ.py │ │ │ ├── mask_rcnn_R_50_FPN_100ep_LSJ.py │ │ │ ├── mask_rcnn_R_50_FPN_200ep_LSJ.py │ │ │ ├── mask_rcnn_R_50_FPN_400ep_LSJ.py │ │ │ ├── mask_rcnn_R_50_FPN_50ep_LSJ.py │ │ │ ├── mask_rcnn_regnetx_4gf_dds_FPN_100ep_LSJ.py │ │ │ ├── mask_rcnn_regnetx_4gf_dds_FPN_200ep_LSJ.py │ │ │ ├── mask_rcnn_regnetx_4gf_dds_FPN_400ep_LSJ.py │ │ │ ├── mask_rcnn_regnety_4gf_dds_FPN_100ep_LSJ.py │ │ │ ├── mask_rcnn_regnety_4gf_dds_FPN_200ep_LSJ.py │ │ │ └── mask_rcnn_regnety_4gf_dds_FPN_400ep_LSJ.py │ │ └── quick_schedules │ │ │ ├── README.md │ │ │ ├── cascade_mask_rcnn_R_50_FPN_inference_acc_test.yaml │ │ │ ├── cascade_mask_rcnn_R_50_FPN_instant_test.yaml │ │ │ ├── fast_rcnn_R_50_FPN_inference_acc_test.yaml │ │ │ ├── fast_rcnn_R_50_FPN_instant_test.yaml │ │ │ ├── keypoint_rcnn_R_50_FPN_inference_acc_test.yaml │ │ │ ├── keypoint_rcnn_R_50_FPN_instant_test.yaml │ │ │ ├── keypoint_rcnn_R_50_FPN_normalized_training_acc_test.yaml │ │ │ ├── keypoint_rcnn_R_50_FPN_training_acc_test.yaml │ │ │ ├── mask_rcnn_R_50_C4_GCV_instant_test.yaml │ │ │ ├── mask_rcnn_R_50_C4_inference_acc_test.yaml │ │ │ ├── mask_rcnn_R_50_C4_instant_test.yaml │ │ │ ├── mask_rcnn_R_50_C4_training_acc_test.yaml │ │ │ ├── mask_rcnn_R_50_DC5_inference_acc_test.yaml │ │ │ ├── mask_rcnn_R_50_FPN_inference_acc_test.yaml │ │ │ ├── mask_rcnn_R_50_FPN_instant_test.yaml │ │ │ ├── mask_rcnn_R_50_FPN_pred_boxes_training_acc_test.yaml │ │ │ ├── mask_rcnn_R_50_FPN_training_acc_test.yaml │ │ │ ├── panoptic_fpn_R_50_inference_acc_test.yaml │ │ │ ├── panoptic_fpn_R_50_instant_test.yaml │ │ │ ├── panoptic_fpn_R_50_training_acc_test.yaml │ │ │ ├── retinanet_R_50_FPN_inference_acc_test.yaml │ │ │ ├── retinanet_R_50_FPN_instant_test.yaml │ │ │ ├── rpn_R_50_FPN_inference_acc_test.yaml │ │ │ ├── rpn_R_50_FPN_instant_test.yaml │ │ │ ├── semantic_R_50_FPN_inference_acc_test.yaml │ │ │ ├── semantic_R_50_FPN_instant_test.yaml │ │ │ └── semantic_R_50_FPN_training_acc_test.yaml │ │ ├── datasets │ │ ├── README.md │ │ ├── lvis │ │ │ └── lvis_v1_train_cat_info.json │ │ ├── prepare_ade20k_sem_seg.py │ │ ├── prepare_cocofied_lvis.py │ │ ├── prepare_for_tests.sh │ │ └── prepare_panoptic_fpn.py │ │ ├── demo │ │ ├── README.md │ │ ├── demo.py │ │ └── predictor.py │ │ ├── detectron2 │ │ ├── __init__.py │ │ ├── checkpoint │ │ │ ├── __init__.py │ │ │ ├── c2_model_loading.py │ │ │ ├── catalog.py │ │ │ └── detection_checkpoint.py │ │ ├── config │ │ │ ├── __init__.py │ │ │ ├── compat.py │ │ │ ├── config.py │ │ │ ├── defaults.py │ │ │ ├── instantiate.py │ │ │ └── lazy.py │ │ ├── data │ │ │ ├── __init__.py │ │ │ ├── benchmark.py │ │ │ ├── build.py │ │ │ ├── catalog.py │ │ │ ├── common.py │ │ │ ├── dataset_mapper.py │ │ │ ├── datasets │ │ │ │ ├── README.md │ │ │ │ ├── __init__.py │ │ │ │ ├── builtin.py │ │ │ │ ├── builtin_meta.py │ │ │ │ ├── cityscapes.py │ │ │ │ ├── cityscapes_panoptic.py │ │ │ │ ├── coco.py │ │ │ │ ├── coco_panoptic.py │ │ │ │ ├── lvis.py │ │ │ │ ├── lvis_v0_5_categories.py │ │ │ │ ├── lvis_v1_categories.py │ │ │ │ ├── pascal_voc.py │ │ │ │ └── register_coco.py │ │ │ ├── detection_utils.py │ │ │ ├── samplers │ │ │ │ ├── __init__.py │ │ │ │ ├── distributed_sampler.py │ │ │ │ └── grouped_batch_sampler.py │ │ │ └── transforms │ │ │ │ ├── __init__.py │ │ │ │ ├── augmentation.py │ │ │ │ ├── augmentation_impl.py │ │ │ │ └── transform.py │ │ ├── engine │ │ │ ├── __init__.py │ │ │ ├── defaults.py │ │ │ ├── hooks.py │ │ │ ├── launch.py │ │ │ └── train_loop.py │ │ ├── evaluation │ │ │ ├── __init__.py │ │ │ ├── cityscapes_evaluation.py │ │ │ ├── coco_evaluation.py │ │ │ ├── evaluator.py │ │ │ ├── fast_eval_api.py │ │ │ ├── lvis_evaluation.py │ │ │ ├── panoptic_evaluation.py │ │ │ ├── pascal_voc_evaluation.py │ │ │ ├── rotated_coco_evaluation.py │ │ │ ├── sem_seg_evaluation.py │ │ │ └── testing.py │ │ ├── export │ │ │ ├── README.md │ │ │ ├── __init__.py │ │ │ ├── api.py │ │ │ ├── c10.py │ │ │ ├── caffe2_export.py │ │ │ ├── caffe2_inference.py │ │ │ ├── caffe2_modeling.py │ │ │ ├── caffe2_patch.py │ │ │ ├── flatten.py │ │ │ ├── shared.py │ │ │ ├── torchscript.py │ │ │ └── torchscript_patch.py │ │ ├── layers │ │ │ ├── __init__.py │ │ │ ├── aspp.py │ │ │ ├── batch_norm.py │ │ │ ├── blocks.py │ │ │ ├── csrc │ │ │ │ ├── README.md │ │ │ │ ├── ROIAlignRotated │ │ │ │ │ ├── ROIAlignRotated.h │ │ │ │ │ ├── ROIAlignRotated_cpu.cpp │ │ │ │ │ └── ROIAlignRotated_cuda.cu │ │ │ │ ├── box_iou_rotated │ │ │ │ │ ├── box_iou_rotated.h │ │ │ │ │ ├── box_iou_rotated_cpu.cpp │ │ │ │ │ ├── box_iou_rotated_cuda.cu │ │ │ │ │ └── box_iou_rotated_utils.h │ │ │ │ ├── cocoeval │ │ │ │ │ ├── cocoeval.cpp │ │ │ │ │ └── cocoeval.h │ │ │ │ ├── cuda_version.cu │ │ │ │ ├── deformable │ │ │ │ │ ├── deform_conv.h │ │ │ │ │ ├── deform_conv_cuda.cu │ │ │ │ │ └── deform_conv_cuda_kernel.cu │ │ │ │ ├── nms_rotated │ │ │ │ │ ├── nms_rotated.h │ │ │ │ │ ├── nms_rotated_cpu.cpp │ │ │ │ │ └── nms_rotated_cuda.cu │ │ │ │ └── vision.cpp │ │ │ ├── deform_conv.py │ │ │ ├── losses.py │ │ │ ├── mask_ops.py │ │ │ ├── nms.py │ │ │ ├── roi_align.py │ │ │ ├── roi_align_rotated.py │ │ │ ├── rotated_boxes.py │ │ │ ├── shape_spec.py │ │ │ └── wrappers.py │ │ ├── modeling │ │ │ ├── __init__.py │ │ │ ├── anchor_generator.py │ │ │ ├── backbone │ │ │ │ ├── __init__.py │ │ │ │ ├── backbone.py │ │ │ │ ├── build.py │ │ │ │ ├── fpn.py │ │ │ │ ├── regnet.py │ │ │ │ └── resnet.py │ │ │ ├── box_regression.py │ │ │ ├── matcher.py │ │ │ ├── meta_arch │ │ │ │ ├── __init__.py │ │ │ │ ├── build.py │ │ │ │ ├── dense_detector.py │ │ │ │ ├── fcos.py │ │ │ │ ├── panoptic_fpn.py │ │ │ │ ├── rcnn.py │ │ │ │ ├── retinanet.py │ │ │ │ └── semantic_seg.py │ │ │ ├── mmdet_wrapper.py │ │ │ ├── poolers.py │ │ │ ├── postprocessing.py │ │ │ ├── proposal_generator │ │ │ │ ├── __init__.py │ │ │ │ ├── build.py │ │ │ │ ├── proposal_utils.py │ │ │ │ ├── rpn.py │ │ │ │ └── rrpn.py │ │ │ ├── roi_heads │ │ │ │ ├── __init__.py │ │ │ │ ├── box_head.py │ │ │ │ ├── cascade_rcnn.py │ │ │ │ ├── fast_rcnn.py │ │ │ │ ├── keypoint_head.py │ │ │ │ ├── mask_head.py │ │ │ │ ├── roi_heads.py │ │ │ │ └── rotated_fast_rcnn.py │ │ │ ├── sampling.py │ │ │ └── test_time_augmentation.py │ │ ├── projects │ │ │ ├── README.md │ │ │ └── __init__.py │ │ ├── solver │ │ │ ├── __init__.py │ │ │ ├── build.py │ │ │ └── lr_scheduler.py │ │ ├── structures │ │ │ ├── __init__.py │ │ │ ├── boxes.py │ │ │ ├── image_list.py │ │ │ ├── instances.py │ │ │ ├── keypoints.py │ │ │ ├── masks.py │ │ │ └── rotated_boxes.py │ │ └── utils │ │ │ ├── README.md │ │ │ ├── __init__.py │ │ │ ├── analysis.py │ │ │ ├── collect_env.py │ │ │ ├── colormap.py │ │ │ ├── comm.py │ │ │ ├── env.py │ │ │ ├── events.py │ │ │ ├── file_io.py │ │ │ ├── logger.py │ │ │ ├── memory.py │ │ │ ├── registry.py │ │ │ ├── serialize.py │ │ │ ├── testing.py │ │ │ ├── video_visualizer.py │ │ │ └── visualizer.py │ │ ├── dev │ │ ├── README.md │ │ ├── linter.sh │ │ ├── packaging │ │ │ ├── README.md │ │ │ ├── build_all_wheels.sh │ │ │ ├── build_wheel.sh │ │ │ ├── gen_install_table.py │ │ │ ├── gen_wheel_index.sh │ │ │ └── pkg_helpers.bash │ │ ├── parse_results.sh │ │ ├── run_inference_tests.sh │ │ └── run_instant_tests.sh │ │ ├── docker │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── deploy.Dockerfile │ │ └── docker-compose.yml │ │ ├── docs │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ ├── _static │ │ │ └── css │ │ │ │ └── custom.css │ │ ├── conf.py │ │ ├── index.rst │ │ ├── modules │ │ │ ├── checkpoint.rst │ │ │ ├── config.rst │ │ │ ├── data.rst │ │ │ ├── data_transforms.rst │ │ │ ├── engine.rst │ │ │ ├── evaluation.rst │ │ │ ├── export.rst │ │ │ ├── fvcore.rst │ │ │ ├── index.rst │ │ │ ├── layers.rst │ │ │ ├── model_zoo.rst │ │ │ ├── modeling.rst │ │ │ ├── solver.rst │ │ │ ├── structures.rst │ │ │ └── utils.rst │ │ ├── notes │ │ │ ├── benchmarks.md │ │ │ ├── changelog.md │ │ │ ├── compatibility.md │ │ │ ├── contributing.md │ │ │ └── index.rst │ │ ├── requirements.txt │ │ └── tutorials │ │ │ ├── README.md │ │ │ ├── augmentation.md │ │ │ ├── builtin_datasets.md │ │ │ ├── configs.md │ │ │ ├── data_loading.md │ │ │ ├── datasets.md │ │ │ ├── deployment.md │ │ │ ├── evaluation.md │ │ │ ├── extend.md │ │ │ ├── getting_started.md │ │ │ ├── index.rst │ │ │ ├── install.md │ │ │ ├── lazyconfigs.md │ │ │ ├── models.md │ │ │ ├── training.md │ │ │ └── write-models.md │ │ ├── projects │ │ └── CenterNet2 │ │ │ ├── .gitignore │ │ │ ├── centernet │ │ │ ├── __init__.py │ │ │ ├── config.py │ │ │ ├── data │ │ │ │ ├── custom_build_augmentation.py │ │ │ │ ├── custom_dataset_dataloader.py │ │ │ │ ├── datasets │ │ │ │ │ ├── coco.py │ │ │ │ │ ├── nuimages.py │ │ │ │ │ └── objects365.py │ │ │ │ └── transforms │ │ │ │ │ ├── custom_augmentation_impl.py │ │ │ │ │ └── custom_transform.py │ │ │ └── modeling │ │ │ │ ├── backbone │ │ │ │ ├── bifpn.py │ │ │ │ ├── bifpn_fcos.py │ │ │ │ ├── dla.py │ │ │ │ ├── dlafpn.py │ │ │ │ ├── fpn_p5.py │ │ │ │ └── res2net.py │ │ │ │ ├── debug.py │ │ │ │ ├── dense_heads │ │ │ │ ├── centernet.py │ │ │ │ ├── centernet_head.py │ │ │ │ └── utils.py │ │ │ │ ├── layers │ │ │ │ ├── deform_conv.py │ │ │ │ ├── heatmap_focal_loss.py │ │ │ │ ├── iou_loss.py │ │ │ │ └── ml_nms.py │ │ │ │ ├── meta_arch │ │ │ │ └── centernet_detector.py │ │ │ │ └── roi_heads │ │ │ │ ├── custom_fast_rcnn.py │ │ │ │ ├── custom_roi_heads.py │ │ │ │ └── fed_loss.py │ │ │ ├── centernet2_docs │ │ │ └── MODEL_ZOO.md │ │ │ ├── configs │ │ │ ├── Base-CenterNet-FPN.yaml │ │ │ ├── Base-CenterNet2.yaml │ │ │ ├── Base_S4_DLA.yaml │ │ │ ├── CenterNet-FPN_R50_1x.yaml │ │ │ ├── CenterNet-S4_DLA_8x.yaml │ │ │ ├── CenterNet2-F_R50_1x.yaml │ │ │ ├── CenterNet2_DLA-BiFPN-P3_24x.yaml │ │ │ ├── CenterNet2_DLA-BiFPN-P3_4x.yaml │ │ │ ├── CenterNet2_DLA-BiFPN-P5_640_16x.yaml │ │ │ ├── CenterNet2_DLA-BiFPN-P5_640_16x_ST.yaml │ │ │ ├── CenterNet2_DLA-fcosBiFPN-P5_640_16x_ST.yaml │ │ │ ├── CenterNet2_R2-101-DCN-BiFPN_1280_4x.yaml │ │ │ ├── CenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST.yaml │ │ │ ├── CenterNet2_R2-101-DCN_896_4x.yaml │ │ │ ├── CenterNet2_R50_1x.yaml │ │ │ ├── CenterNet2_X101-DCN_2x.yaml │ │ │ ├── LVIS_CenterNet2_R50_1x.yaml │ │ │ ├── LVIS_CenterNet2_R50_Fed_1x.yaml │ │ │ ├── O365_CenterNet2_R50_1x.yaml │ │ │ └── nuImages_CenterNet2_DLA_640_8x.yaml │ │ │ ├── demo.py │ │ │ ├── predictor.py │ │ │ └── train_net.py │ │ ├── setup.cfg │ │ ├── setup.py │ │ ├── tests │ │ ├── README.md │ │ ├── __init__.py │ │ ├── config │ │ │ ├── dir1 │ │ │ │ ├── dir1_a.py │ │ │ │ └── dir1_b.py │ │ │ ├── root_cfg.py │ │ │ ├── test_instantiate_config.py │ │ │ ├── test_lazy_config.py │ │ │ └── test_yacs_config.py │ │ ├── data │ │ │ ├── __init__.py │ │ │ ├── test_coco.py │ │ │ ├── test_coco_evaluation.py │ │ │ ├── test_dataset.py │ │ │ ├── test_detection_utils.py │ │ │ ├── test_rotation_transform.py │ │ │ ├── test_sampler.py │ │ │ └── test_transforms.py │ │ ├── layers │ │ │ ├── __init__.py │ │ │ ├── test_blocks.py │ │ │ ├── test_deformable.py │ │ │ ├── test_losses.py │ │ │ ├── test_mask_ops.py │ │ │ ├── test_nms.py │ │ │ ├── test_nms_rotated.py │ │ │ ├── test_roi_align.py │ │ │ └── test_roi_align_rotated.py │ │ ├── modeling │ │ │ ├── __init__.py │ │ │ ├── test_anchor_generator.py │ │ │ ├── test_backbone.py │ │ │ ├── test_box2box_transform.py │ │ │ ├── test_fast_rcnn.py │ │ │ ├── test_matcher.py │ │ │ ├── test_mmdet.py │ │ │ ├── test_model_e2e.py │ │ │ ├── test_roi_heads.py │ │ │ ├── test_roi_pooler.py │ │ │ └── test_rpn.py │ │ ├── structures │ │ │ ├── __init__.py │ │ │ ├── test_boxes.py │ │ │ ├── test_imagelist.py │ │ │ ├── test_instances.py │ │ │ ├── test_keypoints.py │ │ │ ├── test_masks.py │ │ │ └── test_rotated_boxes.py │ │ ├── test_checkpoint.py │ │ ├── test_engine.py │ │ ├── test_events.py │ │ ├── test_export_caffe2.py │ │ ├── test_export_torchscript.py │ │ ├── test_model_analysis.py │ │ ├── test_model_zoo.py │ │ ├── test_packaging.py │ │ ├── test_registry.py │ │ ├── test_scheduler.py │ │ ├── test_solver.py │ │ └── test_visualizer.py │ │ └── tools │ │ ├── README.md │ │ ├── __init__.py │ │ ├── analyze_model.py │ │ ├── benchmark.py │ │ ├── convert-torchvision-to-d2.py │ │ ├── deploy │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── export_model.py │ │ └── torchscript_mask_rcnn.cpp │ │ ├── lazyconfig_train_net.py │ │ ├── lightning_train_net.py │ │ ├── plain_train_net.py │ │ ├── train_net.py │ │ ├── visualize_data.py │ │ └── visualize_json_results.py │ ├── husky.py │ ├── husky_src │ ├── compression.py │ ├── conversation.py │ ├── convert_llama_weights_to_hf.py │ ├── husky_chat.py │ └── load_ckpt.py │ ├── image.py │ ├── imagebind │ ├── __init__.py │ ├── bpe │ │ └── bpe_simple_vocab_16e6.txt.gz │ ├── data.py │ └── models │ │ ├── __init__.py │ │ ├── helpers.py │ │ ├── imagebind_model.py │ │ ├── multimodal_preprocessors.py │ │ └── transformer.py │ ├── inpainting.py │ ├── inpainting_src │ ├── __init__.py │ └── ldm_inpainting │ │ ├── __init__.py │ │ ├── config.yaml │ │ ├── ldm │ │ ├── __init__.py │ │ ├── lr_scheduler.py │ │ ├── models │ │ │ ├── __init__.py │ │ │ ├── autoencoder.py │ │ │ ├── diffusion │ │ │ │ ├── __init__.py │ │ │ │ ├── classifier.py │ │ │ │ ├── ddim.py │ │ │ │ ├── ddpm.py │ │ │ │ └── plms.py │ │ │ └── quantize.py │ │ ├── modules │ │ │ ├── __init__.py │ │ │ ├── attention.py │ │ │ ├── diffusionmodules │ │ │ │ ├── __init__.py │ │ │ │ ├── model.py │ │ │ │ ├── openaimodel.py │ │ │ │ └── util.py │ │ │ ├── distributions │ │ │ │ ├── __init__.py │ │ │ │ └── distributions.py │ │ │ ├── ema.py │ │ │ ├── encoders │ │ │ │ ├── __init__.py │ │ │ │ └── modules.py │ │ │ ├── image_degradation │ │ │ │ ├── __init__.py │ │ │ │ ├── bsrgan.py │ │ │ │ ├── bsrgan_light.py │ │ │ │ ├── utils │ │ │ │ │ └── test.png │ │ │ │ └── utils_image.py │ │ │ ├── losses │ │ │ │ └── __init__.py │ │ │ └── x_transformer.py │ │ └── util.py │ │ └── wrapper.py │ ├── intern_action.py │ ├── lang.py │ ├── load_internvideo.py │ ├── med.py │ ├── processing.py │ ├── sam_preditor.py │ ├── swin_transformer.py │ ├── tag2text.py │ ├── utils.py │ ├── video.py │ └── vit.py ├── requirements.txt ├── tests └── test_anything2image.py └── third-party ├── lama ├── LICENSE ├── README.md ├── bin │ ├── analyze_errors.py │ ├── blur_predicts.py │ ├── calc_dataset_stats.py │ ├── debug │ │ └── analyze_overlapping_masks.sh │ ├── evaluate_predicts.py │ ├── evaluator_example.py │ ├── extract_masks.py │ ├── filter_sharded_dataset.py │ ├── gen_debug_mask_dataset.py │ ├── gen_mask_dataset.py │ ├── gen_mask_dataset_hydra.py │ ├── gen_outpainting_dataset.py │ ├── make_checkpoint.py │ ├── mask_example.py │ ├── models │ │ ├── ade20k │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── color150.mat │ │ │ ├── mobilenet.py │ │ │ ├── object150_info.csv │ │ │ ├── resnet.py │ │ │ ├── segm_lib │ │ │ │ ├── nn │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── modules │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ ├── batchnorm.py │ │ │ │ │ │ ├── comm.py │ │ │ │ │ │ ├── replicate.py │ │ │ │ │ │ ├── tests │ │ │ │ │ │ │ ├── test_numeric_batchnorm.py │ │ │ │ │ │ │ └── test_sync_batchnorm.py │ │ │ │ │ │ └── unittest.py │ │ │ │ │ └── parallel │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ └── data_parallel.py │ │ │ │ └── utils │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── data │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── dataloader.py │ │ │ │ │ ├── dataset.py │ │ │ │ │ ├── distributed.py │ │ │ │ │ └── sampler.py │ │ │ │ │ └── th.py │ │ │ └── utils.py │ │ └── lpips_models │ │ │ ├── alex.pth │ │ │ ├── squeeze.pth │ │ │ └── vgg.pth │ ├── paper_runfiles │ │ ├── blur_tests.sh │ │ ├── env.sh │ │ ├── find_best_checkpoint.py │ │ ├── generate_test_celeba-hq.sh │ │ ├── generate_test_ffhq.sh │ │ ├── generate_test_paris.sh │ │ ├── generate_test_paris_256.sh │ │ ├── generate_val_test.sh │ │ ├── predict_inner_features.sh │ │ └── update_test_data_stats.sh │ ├── predict.py │ ├── predict_inner_features.py │ ├── report_from_tb.py │ ├── saicinpainting │ │ ├── __init__.py │ │ ├── evaluation │ │ │ ├── __init__.py │ │ │ ├── data.py │ │ │ ├── evaluator.py │ │ │ ├── losses │ │ │ │ ├── __init__.py │ │ │ │ ├── base_loss.py │ │ │ │ ├── fid │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── fid_score.py │ │ │ │ │ └── inception.py │ │ │ │ ├── lpips.py │ │ │ │ └── ssim.py │ │ │ ├── masks │ │ │ │ ├── README.md │ │ │ │ ├── __init__.py │ │ │ │ ├── countless │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── README.md │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── countless2d.py │ │ │ │ │ ├── countless3d.py │ │ │ │ │ ├── images │ │ │ │ │ │ ├── gcim.jpg │ │ │ │ │ │ ├── gray_segmentation.png │ │ │ │ │ │ ├── segmentation.png │ │ │ │ │ │ └── sparse.png │ │ │ │ │ ├── memprof │ │ │ │ │ │ ├── countless2d_gcim_N_1000.png │ │ │ │ │ │ ├── countless2d_quick_gcim_N_1000.png │ │ │ │ │ │ ├── countless3d.png │ │ │ │ │ │ ├── countless3d_dynamic.png │ │ │ │ │ │ ├── countless3d_dynamic_generalized.png │ │ │ │ │ │ └── countless3d_generalized.png │ │ │ │ │ ├── requirements.txt │ │ │ │ │ └── test.py │ │ │ │ └── mask.py │ │ │ ├── refinement.py │ │ │ ├── utils.py │ │ │ └── vis.py │ │ ├── training │ │ │ ├── __init__.py │ │ │ ├── data │ │ │ │ ├── __init__.py │ │ │ │ ├── aug.py │ │ │ │ ├── datasets.py │ │ │ │ └── masks.py │ │ │ ├── losses │ │ │ │ ├── __init__.py │ │ │ │ ├── adversarial.py │ │ │ │ ├── constants.py │ │ │ │ ├── distance_weighting.py │ │ │ │ ├── feature_matching.py │ │ │ │ ├── perceptual.py │ │ │ │ ├── segmentation.py │ │ │ │ └── style_loss.py │ │ │ ├── modules │ │ │ │ ├── __init__.py │ │ │ │ ├── base.py │ │ │ │ ├── depthwise_sep_conv.py │ │ │ │ ├── fake_fakes.py │ │ │ │ ├── ffc.py │ │ │ │ ├── multidilated_conv.py │ │ │ │ ├── multiscale.py │ │ │ │ ├── pix2pixhd.py │ │ │ │ ├── spatial_transform.py │ │ │ │ └── squeeze_excitation.py │ │ │ ├── trainers │ │ │ │ ├── __init__.py │ │ │ │ ├── base.py │ │ │ │ └── default.py │ │ │ └── visualizers │ │ │ │ ├── __init__.py │ │ │ │ ├── base.py │ │ │ │ ├── colors.py │ │ │ │ ├── directory.py │ │ │ │ └── noop.py │ │ └── utils.py │ ├── sample_from_dataset.py │ ├── side_by_side.py │ ├── split_tar.py │ ├── to_jit.py │ └── train.py ├── colab │ └── LaMa_inpainting.ipynb ├── conda_env.yml ├── configs │ ├── analyze_mask_errors.yaml │ ├── data_gen │ │ ├── random_medium_256.yaml │ │ ├── random_medium_512.yaml │ │ ├── random_thick_256.yaml │ │ ├── random_thick_512.yaml │ │ ├── random_thin_256.yaml │ │ └── random_thin_512.yaml │ ├── debug_mask_gen.yaml │ ├── eval1.yaml │ ├── eval2.yaml │ ├── eval2_cpu.yaml │ ├── eval2_gpu.yaml │ ├── eval2_jpg.yaml │ ├── eval2_segm.yaml │ ├── eval2_segm_test.yaml │ ├── eval2_test.yaml │ ├── places2-categories_157.txt │ ├── prediction │ │ └── default.yaml │ ├── test_large_30k.lst │ └── training │ │ ├── ablv2_work.yaml │ │ ├── ablv2_work_ffc075.yaml │ │ ├── ablv2_work_md.yaml │ │ ├── ablv2_work_no_fm.yaml │ │ ├── ablv2_work_no_segmpl.yaml │ │ ├── ablv2_work_no_segmpl_csdilirpl.yaml │ │ ├── ablv2_work_no_segmpl_csdilirpl_celeba_csdilirpl1_new.yaml │ │ ├── ablv2_work_no_segmpl_csirpl.yaml │ │ ├── ablv2_work_no_segmpl_csirpl_celeba_csirpl03_new.yaml │ │ ├── ablv2_work_no_segmpl_vgg.yaml │ │ ├── ablv2_work_no_segmpl_vgg_celeba_l2_vgg003_new.yaml │ │ ├── ablv2_work_nodil_segmpl.yaml │ │ ├── ablv2_work_small_holes.yaml │ │ ├── big-lama-celeba.yaml │ │ ├── big-lama-regular-celeba.yaml │ │ ├── big-lama-regular.yaml │ │ ├── big-lama.yaml │ │ ├── data │ │ ├── abl-02-thin-bb.yaml │ │ ├── abl-04-256-mh-dist-celeba.yaml │ │ ├── abl-04-256-mh-dist-web.yaml │ │ └── abl-04-256-mh-dist.yaml │ │ ├── discriminator │ │ └── pix2pixhd_nlayer.yaml │ │ ├── evaluator │ │ └── default_inpainted.yaml │ │ ├── generator │ │ ├── ffc_resnet_075.yaml │ │ ├── pix2pixhd_global.yaml │ │ ├── pix2pixhd_global_sigmoid.yaml │ │ └── pix2pixhd_multidilated_catin_4dil_9b.yaml │ │ ├── hydra │ │ ├── no_time.yaml │ │ └── overrides.yaml │ │ ├── lama-fourier-celeba.yaml │ │ ├── lama-fourier.yaml │ │ ├── lama-regular-celeba.yaml │ │ ├── lama-regular.yaml │ │ ├── lama_small_train_masks.yaml │ │ ├── location │ │ ├── celeba_example.yaml │ │ ├── docker.yaml │ │ └── places_example.yaml │ │ ├── optimizers │ │ └── default_optimizers.yaml │ │ ├── trainer │ │ ├── any_gpu_large_ssim_ddp_final.yaml │ │ ├── any_gpu_large_ssim_ddp_final_benchmark.yaml │ │ └── any_gpu_large_ssim_ddp_final_celeba.yaml │ │ └── visualizer │ │ └── directory.yaml ├── docker │ ├── 1_generate_masks_from_raw_images.sh │ ├── 2_predict.sh │ ├── 3_evaluate.sh │ ├── Dockerfile │ ├── Dockerfile-cuda111 │ ├── build-cuda111.sh │ ├── build.sh │ └── entrypoint.sh ├── fetch_data │ ├── celebahq_dataset_prepare.sh │ ├── celebahq_gen_masks.sh │ ├── eval_sampler.py │ ├── places_challenge_train_download.sh │ ├── places_standard_evaluation_prepare_data.sh │ ├── places_standard_test_val_gen_masks.sh │ ├── places_standard_test_val_prepare.sh │ ├── places_standard_test_val_sample.sh │ ├── places_standard_train_prepare.sh │ ├── sampler.py │ ├── train_shuffled.flist │ └── val_shuffled.flist ├── models │ ├── ade20k │ │ ├── __init__.py │ │ ├── base.py │ │ ├── color150.mat │ │ ├── mobilenet.py │ │ ├── object150_info.csv │ │ ├── resnet.py │ │ ├── segm_lib │ │ │ ├── nn │ │ │ │ ├── __init__.py │ │ │ │ ├── modules │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── batchnorm.py │ │ │ │ │ ├── comm.py │ │ │ │ │ ├── replicate.py │ │ │ │ │ ├── tests │ │ │ │ │ │ ├── test_numeric_batchnorm.py │ │ │ │ │ │ └── test_sync_batchnorm.py │ │ │ │ │ └── unittest.py │ │ │ │ └── parallel │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── data_parallel.py │ │ │ └── utils │ │ │ │ ├── __init__.py │ │ │ │ ├── data │ │ │ │ ├── __init__.py │ │ │ │ ├── dataloader.py │ │ │ │ ├── dataset.py │ │ │ │ ├── distributed.py │ │ │ │ └── sampler.py │ │ │ │ └── th.py │ │ └── utils.py │ └── lpips_models │ │ ├── alex.pth │ │ ├── squeeze.pth │ │ └── vgg.pth ├── requirements.txt └── saicinpainting │ ├── __init__.py │ ├── evaluation │ ├── __init__.py │ ├── data.py │ ├── evaluator.py │ ├── losses │ │ ├── __init__.py │ │ ├── base_loss.py │ │ ├── fid │ │ │ ├── __init__.py │ │ │ ├── fid_score.py │ │ │ └── inception.py │ │ ├── lpips.py │ │ └── ssim.py │ ├── masks │ │ ├── README.md │ │ ├── __init__.py │ │ ├── countless │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── __init__.py │ │ │ ├── countless2d.py │ │ │ ├── countless3d.py │ │ │ ├── images │ │ │ │ ├── gcim.jpg │ │ │ │ ├── gray_segmentation.png │ │ │ │ ├── segmentation.png │ │ │ │ └── sparse.png │ │ │ ├── memprof │ │ │ │ ├── countless2d_gcim_N_1000.png │ │ │ │ ├── countless2d_quick_gcim_N_1000.png │ │ │ │ ├── countless3d.png │ │ │ │ ├── countless3d_dynamic.png │ │ │ │ ├── countless3d_dynamic_generalized.png │ │ │ │ └── countless3d_generalized.png │ │ │ ├── requirements.txt │ │ │ └── test.py │ │ └── mask.py │ ├── refinement.py │ ├── utils.py │ └── vis.py │ ├── training │ ├── __init__.py │ ├── data │ │ ├── __init__.py │ │ ├── aug.py │ │ ├── datasets.py │ │ └── masks.py │ ├── losses │ │ ├── __init__.py │ │ ├── adversarial.py │ │ ├── constants.py │ │ ├── distance_weighting.py │ │ ├── feature_matching.py │ │ ├── perceptual.py │ │ ├── segmentation.py │ │ └── style_loss.py │ ├── modules │ │ ├── __init__.py │ │ ├── base.py │ │ ├── depthwise_sep_conv.py │ │ ├── fake_fakes.py │ │ ├── ffc.py │ │ ├── multidilated_conv.py │ │ ├── multiscale.py │ │ ├── pix2pixhd.py │ │ ├── spatial_transform.py │ │ └── squeeze_excitation.py │ ├── trainers │ │ ├── __init__.py │ │ ├── base.py │ │ └── default.py │ └── visualizers │ │ ├── __init__.py │ │ ├── base.py │ │ ├── colors.py │ │ ├── directory.py │ │ └── noop.py │ └── utils.py └── llama_download.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # compilation and distribution 2 | __pycache__ 3 | _ext 4 | *.pyc 5 | *.pyd 6 | *.so 7 | *.dll 8 | *.egg-info/ 9 | build/ 10 | dist/ 11 | wheels/ 12 | 13 | # Editor temporaries 14 | *.swn 15 | *.swo 16 | *.swp 17 | *~ 18 | 19 | # editor settings 20 | .idea 21 | .vscode 22 | _darcs 23 | 24 | # custom files 25 | ./image/ 26 | tmp_files/ 27 | .DS_Store 28 | 29 | # model files 30 | model_zoo 31 | shells/ 32 | certificate/ 33 | image/ 34 | -------------------------------------------------------------------------------- /assets/arch1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/arch1.png -------------------------------------------------------------------------------- /assets/audio/bird_audio.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/audio/bird_audio.wav -------------------------------------------------------------------------------- /assets/audio/cat.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/audio/cat.wav -------------------------------------------------------------------------------- /assets/audio/dog_audio.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/audio/dog_audio.wav -------------------------------------------------------------------------------- /assets/audio/rain.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/audio/rain.wav -------------------------------------------------------------------------------- /assets/audio/wave.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/audio/wave.wav -------------------------------------------------------------------------------- /assets/demo2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/demo2.gif -------------------------------------------------------------------------------- /assets/demo3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/demo3.gif -------------------------------------------------------------------------------- /assets/demo4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/demo4.gif -------------------------------------------------------------------------------- /assets/demo5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/demo5.gif -------------------------------------------------------------------------------- /assets/demo6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/demo6.jpg -------------------------------------------------------------------------------- /assets/demo_short.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/demo_short.gif -------------------------------------------------------------------------------- /assets/gvlab_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/gvlab_logo.png -------------------------------------------------------------------------------- /assets/images/IMG3584.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/images/IMG3584.jpeg -------------------------------------------------------------------------------- /assets/images/IMG3585.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/images/IMG3585.jpeg -------------------------------------------------------------------------------- /assets/images/IMG3588.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/images/IMG3588.jpeg -------------------------------------------------------------------------------- /assets/images/IMG3589.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/images/IMG3589.jpeg -------------------------------------------------------------------------------- /assets/images/dog_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/images/dog_image.jpg -------------------------------------------------------------------------------- /assets/images/ultrakun.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/images/ultrakun.jpeg -------------------------------------------------------------------------------- /assets/images/workspace.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/images/workspace.jpeg -------------------------------------------------------------------------------- /assets/thermal/030419.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/thermal/030419.jpg -------------------------------------------------------------------------------- /assets/thermal/030444.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/thermal/030444.jpg -------------------------------------------------------------------------------- /assets/videos/iKun.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/assets/videos/iKun.mp4 -------------------------------------------------------------------------------- /configs/med_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "architectures": [ 3 | "BertModel" 4 | ], 5 | "attention_probs_dropout_prob": 0.1, 6 | "hidden_act": "gelu", 7 | "hidden_dropout_prob": 0.1, 8 | "hidden_size": 768, 9 | "initializer_range": 0.02, 10 | "intermediate_size": 3072, 11 | "layer_norm_eps": 1e-12, 12 | "max_position_embeddings": 512, 13 | "model_type": "bert", 14 | "num_attention_heads": 12, 15 | "num_hidden_layers": 12, 16 | "pad_token_id": 0, 17 | "type_vocab_size": 2, 18 | "vocab_size": 30524, 19 | "encoder_width": 768, 20 | "add_cross_attention": true 21 | } 22 | -------------------------------------------------------------------------------- /configs/q2l_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "architectures": [ 3 | "BertModel" 4 | ], 5 | "attention_probs_dropout_prob": 0.1, 6 | "hidden_act": "gelu", 7 | "hidden_dropout_prob": 0.1, 8 | "hidden_size": 768, 9 | "initializer_range": 0.02, 10 | "intermediate_size": 3072, 11 | "layer_norm_eps": 1e-12, 12 | "max_position_embeddings": 512, 13 | "model_type": "bert", 14 | "num_attention_heads": 4, 15 | "num_hidden_layers": 2, 16 | "pad_token_id": 0, 17 | "type_vocab_size": 2, 18 | "vocab_size": 30522, 19 | "encoder_width": 768, 20 | "add_cross_attention": true, 21 | "add_tag_cross_attention": false 22 | } 23 | -------------------------------------------------------------------------------- /configs/swin/config_swinB_224.json: -------------------------------------------------------------------------------- 1 | { 2 | "ckpt": "pretrain_model/swin_base_patch4_window7_224_22k.pth", 3 | "vision_width": 1024, 4 | "image_res": 224, 5 | "window_size": 7, 6 | "embed_dim": 128, 7 | "depths": [ 2, 2, 18, 2 ], 8 | "num_heads": [ 4, 8, 16, 32 ] 9 | } 10 | -------------------------------------------------------------------------------- /configs/swin/config_swinB_384.json: -------------------------------------------------------------------------------- 1 | { 2 | "ckpt": "pretrain_model/swin_base_patch4_window7_224_22k.pth", 3 | "vision_width": 1024, 4 | "image_res": 384, 5 | "window_size": 12, 6 | "embed_dim": 128, 7 | "depths": [ 2, 2, 18, 2 ], 8 | "num_heads": [ 4, 8, 16, 32 ] 9 | } 10 | -------------------------------------------------------------------------------- /configs/swin/config_swinB_480.json: -------------------------------------------------------------------------------- 1 | { 2 | "ckpt": "pretrain_model/swin_base_patch4_window7_224_22k.pth", 3 | "vision_width": 1024, 4 | "image_res": 480, 5 | "window_size": 15, 6 | "embed_dim": 128, 7 | "depths": [ 2, 2, 18, 2 ], 8 | "num_heads": [ 4, 8, 16, 32 ] 9 | } -------------------------------------------------------------------------------- /configs/swin/config_swinB_576.json: -------------------------------------------------------------------------------- 1 | { 2 | "ckpt": "pretrain_model/swin_base_patch4_window7_224_22k.pth", 3 | "vision_width": 1024, 4 | "image_res": 576, 5 | "window_size": 18, 6 | "embed_dim": 128, 7 | "depths": [ 2, 2, 18, 2 ], 8 | "num_heads": [ 4, 8, 16, 32 ] 9 | } -------------------------------------------------------------------------------- /configs/swin/config_swinB_608.json: -------------------------------------------------------------------------------- 1 | { 2 | "ckpt": "pretrain_model/swin_base_patch4_window7_224_22k.pth", 3 | "vision_width": 1024, 4 | "image_res": 608, 5 | "window_size": 19, 6 | "embed_dim": 128, 7 | "depths": [ 2, 2, 18, 2 ], 8 | "num_heads": [ 4, 8, 16, 32 ] 9 | } -------------------------------------------------------------------------------- /configs/tag2text_caption.yaml: -------------------------------------------------------------------------------- 1 | image_root: '/home/notebook/data/group/projects/tagging/caption/datasets/public/coco/' 2 | 3 | ann_root: 'dataset/caption_dataset' 4 | coco_gt_root: 'dataset/caption_dataset' 5 | 6 | pretrained: '/home/notebook/code/personal/S9049611/BLIP/output/pretrain_caption_tagtotext_v2_bert_asl' 7 | 8 | # size of vit model; base or large 9 | vit: 'swin_b' 10 | vit_grad_ckpt: False 11 | vit_ckpt_layer: 0 12 | 13 | batch_size: 35 14 | init_lr: 5e-6 15 | 16 | image_size: 384 17 | 18 | # generation configs 19 | max_length: 20 20 | min_length: 5 21 | num_beams: 3 22 | prompt: 'a picture of ' 23 | 24 | # optimizer 25 | weight_decay: 0.05 26 | min_lr: 0 27 | max_epoch: 10 28 | 29 | text_pretrain: 'bert' 30 | 31 | class_num: 3429 32 | threshold: 0.7 33 | 34 | -------------------------------------------------------------------------------- /docker/DragGAN/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM continuumio/anaconda3 2 | 3 | SHELL ["/bin/bash", "-c"] 4 | RUN conda init bash 5 | RUN source "/opt/conda/bin/activate" 6 | RUN conda create -n draggan python=3.7 7 | RUN source activate draggan 8 | RUN conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia 9 | RUN pip install draggan==1.1.0b2 10 | 11 | EXPOSE 7860 12 | 13 | ENTRYPOINT ["python", "-m", "draggan.web", "--ip", "0.0.0.0"] 14 | -------------------------------------------------------------------------------- /docker/DragGAN/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | draggan: 3 | image: "draggan" 4 | container_name: "draggan" 5 | restart: "unless-stopped" 6 | ports: 7 | - "7861:7860" 8 | volumes: 9 | - /home/ubuntu/dragGAN/checkpoints:/root/draggan/checkpoints 10 | deploy: 11 | resources: 12 | reservations: 13 | devices: 14 | - driver: nvidia 15 | count: 1 16 | capabilities: [gpu] 17 | -------------------------------------------------------------------------------- /docker/InternGPT_CN/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | igpt: 3 | build: . 4 | image: "igpt_cn" 5 | container_name: "igpt_cn" 6 | restart: "unless-stopped" 7 | ports: 8 | - "7862:7862" 9 | volumes: 10 | - /path/to/InternGPT:/root/InternGPT 11 | entrypoint: "python" 12 | deploy: 13 | resources: 14 | reservations: 15 | devices: 16 | - driver: nvidia 17 | count: 1 18 | capabilities: [gpu] 19 | command: 20 | - "-u" 21 | - "app.py" 22 | - "--port" 23 | - "7862" 24 | - "--load" 25 | - "StyleGAN_cuda:0" 26 | - "--tab" 27 | - "DragGAN" 28 | - "--https" 29 | -------------------------------------------------------------------------------- /docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | igpt: 3 | build: . 4 | image: "igpt" 5 | container_name: "igpt" 6 | restart: "unless-stopped" 7 | ports: 8 | - "7862:7862" 9 | volumes: 10 | - /path/to/model_zoo:/InternGPT/model_zoo 11 | - /path/to/certificate:/InternGPT/certificate 12 | entrypoint: "python" 13 | deploy: 14 | resources: 15 | reservations: 16 | devices: 17 | - driver: nvidia 18 | count: 1 19 | capabilities: [gpu] 20 | command: 21 | - "-u" 22 | - "app.py" 23 | - "--load" 24 | - "StyleGAN_cuda:0" 25 | - "--tab" 26 | - "DragGAN" 27 | - "--https" 28 | -------------------------------------------------------------------------------- /iGPT/__init__.py: -------------------------------------------------------------------------------- 1 | from .models import * 2 | -------------------------------------------------------------------------------- /iGPT/controllers/__init__.py: -------------------------------------------------------------------------------- 1 | from .ConversationBot import ConversationBot 2 | 3 | 4 | __all__ = [ 5 | 'ConversationBot', 6 | ] 7 | -------------------------------------------------------------------------------- /iGPT/models/drag_gan_src/__init__.py: -------------------------------------------------------------------------------- 1 | from .drag_gan import * -------------------------------------------------------------------------------- /iGPT/models/drag_gan_src/stylegan2/_init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/drag_gan_src/stylegan2/_init__.py -------------------------------------------------------------------------------- /iGPT/models/drag_gan_src/stylegan2/op/__init__.py: -------------------------------------------------------------------------------- 1 | from .fused_act import FusedLeakyReLU, fused_leaky_relu 2 | from .upfirdn2d import upfirdn2d 3 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/configs/GRiT_B_DenseCap.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base.yaml" 2 | MODEL: 3 | TRAIN_TASK: ["DenseCap"] 4 | TEST_TASK: "DenseCap" 5 | MASK_ON: False 6 | ROI_HEADS: 7 | SOFT_NMS_ENABLED: False 8 | BEAM_SIZE: 1 9 | WEIGHTS: "detectron2://ImageNetPretrained/MAE/mae_pretrain_vit_base.pth" 10 | BACKBONE: 11 | NAME: build_vit_fpn_backbone 12 | VIT_LAYERS: 12 13 | SOLVER: 14 | VIT_LAYER_DECAY_RATE: 0.7 15 | DATASETS: 16 | TRAIN: ("vg_train",) 17 | TEST: ("vg_test",) 18 | DATALOADER: 19 | DATASET_BS: 2 20 | OUTPUT_DIR: "./output/GRiT_B_DenseCap" -------------------------------------------------------------------------------- /iGPT/models/grit_src/configs/GRiT_B_DenseCap_ObjectDet.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base.yaml" 2 | MODEL: 3 | TRAIN_TASK: ["ObjectDet", "DenseCap"] 4 | TEST_TASK: "DenseCap" # DenseCap or ObjectDet: Choose one for testing 5 | MASK_ON: True 6 | ROI_HEADS: 7 | SOFT_NMS_ENABLED: False 8 | BEAM_SIZE: 1 9 | WEIGHTS: "detectron2://ImageNetPretrained/MAE/mae_pretrain_vit_base.pth" 10 | BACKBONE: 11 | NAME: build_vit_fpn_backbone 12 | VIT_LAYERS: 12 13 | SOLVER: 14 | VIT_LAYER_DECAY_RATE: 0.7 15 | DATASETS: 16 | TRAIN: ("GRiT_coco2017_train", "vg_train") 17 | TEST: ("coco_2017_test-dev",) 18 | DATALOADER: 19 | DATASET_RATIO: [1, 1] 20 | DATASET_BS: 2 21 | DATASET_INPUT_SIZE: [1024, 1024] 22 | DATASET_INPUT_SCALE: [[0.1, 2.0], [0.1, 2.0]] 23 | OUTPUT_DIR: "./output/GRiT_B_DenseCap_ObjectDet" -------------------------------------------------------------------------------- /iGPT/models/grit_src/configs/GRiT_B_ObjectDet.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base.yaml" 2 | MODEL: 3 | TRAIN_TASK: ["ObjectDet"] 4 | TEST_TASK: "ObjectDet" 5 | MASK_ON: True 6 | ROI_HEADS: 7 | SOFT_NMS_ENABLED: True 8 | BEAM_SIZE: 3 9 | WEIGHTS: "detectron2://ImageNetPretrained/MAE/mae_pretrain_vit_base.pth" 10 | BACKBONE: 11 | NAME: build_vit_fpn_backbone 12 | VIT_LAYERS: 12 13 | SOLVER: 14 | VIT_LAYER_DECAY_RATE: 0.7 15 | DATASETS: 16 | TRAIN: ("GRiT_coco2017_train",) 17 | TEST: ("coco_2017_val",) 18 | DATALOADER: 19 | DATASET_BS: 2 20 | OUTPUT_DIR: "./output/GRiT_B_ObjectDet" -------------------------------------------------------------------------------- /iGPT/models/grit_src/configs/GRiT_H_ObjectDet.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base.yaml" 2 | MODEL: 3 | TRAIN_TASK: ["ObjectDet"] 4 | TEST_TASK: "ObjectDet" 5 | MASK_ON: True 6 | ROI_HEADS: 7 | SOFT_NMS_ENABLED: True 8 | BEAM_SIZE: 3 9 | WEIGHTS: "detectron2://ImageNetPretrained/MAE/mae_pretrain_vit_huge_p14to16.pth" 10 | BACKBONE: 11 | NAME: build_vit_fpn_backbone_huge 12 | VIT_LAYERS: 32 13 | SOLVER: 14 | MAX_ITER: 135000 15 | VIT_LAYER_DECAY_RATE: 0.9 16 | DATASETS: 17 | TRAIN: ("GRiT_coco2017_train",) 18 | TEST: ("coco_2017_val",) 19 | DATALOADER: 20 | DATASET_BS: 1 21 | OUTPUT_DIR: "./output/GRiT_H_ObjectDet" -------------------------------------------------------------------------------- /iGPT/models/grit_src/configs/GRiT_L_ObjectDet.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base.yaml" 2 | MODEL: 3 | TRAIN_TASK: ["ObjectDet"] 4 | TEST_TASK: "ObjectDet" 5 | MASK_ON: True 6 | ROI_HEADS: 7 | SOFT_NMS_ENABLED: True 8 | BEAM_SIZE: 3 9 | WEIGHTS: "detectron2://ImageNetPretrained/MAE/mae_pretrain_vit_large.pth" 10 | BACKBONE: 11 | NAME: build_vit_fpn_backbone_large 12 | VIT_LAYERS: 24 13 | SOLVER: 14 | VIT_LAYER_DECAY_RATE: 0.8 15 | DATASETS: 16 | TRAIN: ("GRiT_coco2017_train",) 17 | TEST: ("coco_2017_val",) 18 | DATALOADER: 19 | DATASET_BS: 1 20 | OUTPUT_DIR: "./output/GRiT_L_ObjectDet" -------------------------------------------------------------------------------- /iGPT/models/grit_src/grit/__init__.py: -------------------------------------------------------------------------------- 1 | from .modeling.meta_arch import grit 2 | from .modeling.roi_heads import grit_roi_heads 3 | from .modeling.backbone import vit 4 | 5 | from .data.datasets import object365 6 | from .data.datasets import vg 7 | from .data.datasets import grit_coco -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/.flake8: -------------------------------------------------------------------------------- 1 | # This is an example .flake8 config, used when developing *Black* itself. 2 | # Keep in sync with setup.cfg which is used for source packages. 3 | 4 | [flake8] 5 | ignore = W503, E203, E221, C901, C408, E741, C407, B017 6 | max-line-length = 100 7 | max-complexity = 18 8 | select = B,C,E,F,W,T4,B9 9 | exclude = build 10 | per-file-ignores = 11 | **/__init__.py:F401,F403,E402 12 | **/configs/**.py:F401,E402 13 | configs/**.py:F401,E402 14 | **/tests/config/**.py:F401,E402 15 | tests/config/**.py:F401,E402 16 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/.gitignore: -------------------------------------------------------------------------------- 1 | slurm* 2 | # output dir 3 | output 4 | instant_test_output 5 | inference_test_output 6 | 7 | 8 | *.png 9 | *.json 10 | *.diff 11 | # *.jpg 12 | !/projects/DensePose/doc/images/*.jpg 13 | 14 | # compilation and distribution 15 | __pycache__ 16 | _ext 17 | *.pyc 18 | *.pyd 19 | *.so 20 | *.dll 21 | *.egg-info/ 22 | build/ 23 | dist/ 24 | wheels/ 25 | 26 | # pytorch/python/numpy formats 27 | *.pth 28 | *.pkl 29 | *.npy 30 | *.ts 31 | model_ts*.txt 32 | 33 | # ipython/jupyter notebooks 34 | *.ipynb 35 | **/.ipynb_checkpoints/ 36 | 37 | # Editor temporaries 38 | *.swn 39 | *.swo 40 | *.swp 41 | *~ 42 | 43 | # editor settings 44 | .idea 45 | .vscode 46 | _darcs 47 | 48 | # project dirs 49 | /detectron2/model_zoo/configs 50 | /datasets/* 51 | !/datasets/*.* 52 | !/datasets/lvis/ 53 | /datasets/lvis/* 54 | !/datasets/lvis/lvis_v1_train_cat_info.json 55 | /projects/*/datasets 56 | /models 57 | /snippet 58 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Base-RCNN-C4.yaml: -------------------------------------------------------------------------------- 1 | MODEL: 2 | META_ARCHITECTURE: "GeneralizedRCNN" 3 | RPN: 4 | PRE_NMS_TOPK_TEST: 6000 5 | POST_NMS_TOPK_TEST: 1000 6 | ROI_HEADS: 7 | NAME: "Res5ROIHeads" 8 | DATASETS: 9 | TRAIN: ("coco_2017_train",) 10 | TEST: ("coco_2017_val",) 11 | SOLVER: 12 | IMS_PER_BATCH: 16 13 | BASE_LR: 0.02 14 | STEPS: (60000, 80000) 15 | MAX_ITER: 90000 16 | INPUT: 17 | MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) 18 | VERSION: 2 19 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Base-RCNN-DilatedC5.yaml: -------------------------------------------------------------------------------- 1 | MODEL: 2 | META_ARCHITECTURE: "GeneralizedRCNN" 3 | RESNETS: 4 | OUT_FEATURES: ["res5"] 5 | RES5_DILATION: 2 6 | RPN: 7 | IN_FEATURES: ["res5"] 8 | PRE_NMS_TOPK_TEST: 6000 9 | POST_NMS_TOPK_TEST: 1000 10 | ROI_HEADS: 11 | NAME: "StandardROIHeads" 12 | IN_FEATURES: ["res5"] 13 | ROI_BOX_HEAD: 14 | NAME: "FastRCNNConvFCHead" 15 | NUM_FC: 2 16 | POOLER_RESOLUTION: 7 17 | ROI_MASK_HEAD: 18 | NAME: "MaskRCNNConvUpsampleHead" 19 | NUM_CONV: 4 20 | POOLER_RESOLUTION: 14 21 | DATASETS: 22 | TRAIN: ("coco_2017_train",) 23 | TEST: ("coco_2017_val",) 24 | SOLVER: 25 | IMS_PER_BATCH: 16 26 | BASE_LR: 0.02 27 | STEPS: (60000, 80000) 28 | MAX_ITER: 90000 29 | INPUT: 30 | MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) 31 | VERSION: 2 32 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Base-RetinaNet.yaml: -------------------------------------------------------------------------------- 1 | MODEL: 2 | META_ARCHITECTURE: "RetinaNet" 3 | BACKBONE: 4 | NAME: "build_retinanet_resnet_fpn_backbone" 5 | RESNETS: 6 | OUT_FEATURES: ["res3", "res4", "res5"] 7 | ANCHOR_GENERATOR: 8 | SIZES: !!python/object/apply:eval ["[[x, x * 2**(1.0/3), x * 2**(2.0/3) ] for x in [32, 64, 128, 256, 512 ]]"] 9 | FPN: 10 | IN_FEATURES: ["res3", "res4", "res5"] 11 | RETINANET: 12 | IOU_THRESHOLDS: [0.4, 0.5] 13 | IOU_LABELS: [0, -1, 1] 14 | SMOOTH_L1_LOSS_BETA: 0.0 15 | DATASETS: 16 | TRAIN: ("coco_2017_train",) 17 | TEST: ("coco_2017_val",) 18 | SOLVER: 19 | IMS_PER_BATCH: 16 20 | BASE_LR: 0.01 # Note that RetinaNet uses a different default learning rate 21 | STEPS: (60000, 80000) 22 | MAX_ITER: 90000 23 | INPUT: 24 | MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) 25 | VERSION: 2 26 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/fast_rcnn_R_50_FPN_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: False 5 | LOAD_PROPOSALS: True 6 | RESNETS: 7 | DEPTH: 50 8 | PROPOSAL_GENERATOR: 9 | NAME: "PrecomputedProposals" 10 | DATASETS: 11 | TRAIN: ("coco_2017_train",) 12 | PROPOSAL_FILES_TRAIN: ("detectron2://COCO-Detection/rpn_R_50_FPN_1x/137258492/coco_2017_train_box_proposals_21bc3a.pkl", ) 13 | TEST: ("coco_2017_val",) 14 | PROPOSAL_FILES_TEST: ("detectron2://COCO-Detection/rpn_R_50_FPN_1x/137258492/coco_2017_val_box_proposals_ee0dad.pkl", ) 15 | DATALOADER: 16 | # proposals are part of the dataset_dicts, and take a lot of RAM 17 | NUM_WORKERS: 2 18 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/faster_rcnn_R_101_C4_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-C4.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" 4 | MASK_ON: False 5 | RESNETS: 6 | DEPTH: 101 7 | SOLVER: 8 | STEPS: (210000, 250000) 9 | MAX_ITER: 270000 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/faster_rcnn_R_101_DC5_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-DilatedC5.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" 4 | MASK_ON: False 5 | RESNETS: 6 | DEPTH: 101 7 | SOLVER: 8 | STEPS: (210000, 250000) 9 | MAX_ITER: 270000 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/faster_rcnn_R_101_FPN_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" 4 | MASK_ON: False 5 | RESNETS: 6 | DEPTH: 101 7 | SOLVER: 8 | STEPS: (210000, 250000) 9 | MAX_ITER: 270000 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/faster_rcnn_R_50_C4_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-C4.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: False 5 | RESNETS: 6 | DEPTH: 50 7 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/faster_rcnn_R_50_C4_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-C4.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: False 5 | RESNETS: 6 | DEPTH: 50 7 | SOLVER: 8 | STEPS: (210000, 250000) 9 | MAX_ITER: 270000 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/faster_rcnn_R_50_DC5_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-DilatedC5.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: False 5 | RESNETS: 6 | DEPTH: 50 7 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/faster_rcnn_R_50_DC5_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-DilatedC5.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: False 5 | RESNETS: 6 | DEPTH: 50 7 | SOLVER: 8 | STEPS: (210000, 250000) 9 | MAX_ITER: 270000 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/faster_rcnn_R_50_FPN_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: False 5 | RESNETS: 6 | DEPTH: 50 7 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: False 5 | RESNETS: 6 | DEPTH: 50 7 | SOLVER: 8 | STEPS: (210000, 250000) 9 | MAX_ITER: 270000 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/faster_rcnn_X_101_32x8d_FPN_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | MASK_ON: False 4 | WEIGHTS: "detectron2://ImageNetPretrained/FAIR/X-101-32x8d.pkl" 5 | PIXEL_STD: [57.375, 57.120, 58.395] 6 | RESNETS: 7 | STRIDE_IN_1X1: False # this is a C2 model 8 | NUM_GROUPS: 32 9 | WIDTH_PER_GROUP: 8 10 | DEPTH: 101 11 | SOLVER: 12 | STEPS: (210000, 250000) 13 | MAX_ITER: 270000 14 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/fcos_R_50_FPN_1x.py: -------------------------------------------------------------------------------- 1 | from ..common.optim import SGD as optimizer 2 | from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier 3 | from ..common.data.coco import dataloader 4 | from ..common.models.fcos import model 5 | from ..common.train import train 6 | 7 | dataloader.train.mapper.use_instance_mask = False 8 | optimizer.lr = 0.01 9 | 10 | model.backbone.bottom_up.freeze_at = 2 11 | train.init_checkpoint = "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 12 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/retinanet_R_101_FPN_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RetinaNet.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" 4 | RESNETS: 5 | DEPTH: 101 6 | SOLVER: 7 | STEPS: (210000, 250000) 8 | MAX_ITER: 270000 9 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/retinanet_R_50_FPN_1x.py: -------------------------------------------------------------------------------- 1 | from ..common.optim import SGD as optimizer 2 | from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier 3 | from ..common.data.coco import dataloader 4 | from ..common.models.retinanet import model 5 | from ..common.train import train 6 | 7 | dataloader.train.mapper.use_instance_mask = False 8 | model.backbone.bottom_up.freeze_at = 2 9 | optimizer.lr = 0.01 10 | 11 | train.init_checkpoint = "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 12 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/retinanet_R_50_FPN_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RetinaNet.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | RESNETS: 5 | DEPTH: 50 6 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/retinanet_R_50_FPN_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RetinaNet.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | RESNETS: 5 | DEPTH: 50 6 | SOLVER: 7 | STEPS: (210000, 250000) 8 | MAX_ITER: 270000 9 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/rpn_R_50_C4_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-C4.yaml" 2 | MODEL: 3 | META_ARCHITECTURE: "ProposalNetwork" 4 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 5 | MASK_ON: False 6 | RESNETS: 7 | DEPTH: 50 8 | RPN: 9 | PRE_NMS_TOPK_TEST: 12000 10 | POST_NMS_TOPK_TEST: 2000 11 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Detection/rpn_R_50_FPN_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | META_ARCHITECTURE: "ProposalNetwork" 4 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 5 | MASK_ON: False 6 | RESNETS: 7 | DEPTH: 50 8 | RPN: 9 | POST_NMS_TOPK_TEST: 2000 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-InstanceSegmentation/mask_rcnn_R_101_C4_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-C4.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 101 7 | SOLVER: 8 | STEPS: (210000, 250000) 9 | MAX_ITER: 270000 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-InstanceSegmentation/mask_rcnn_R_101_DC5_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-DilatedC5.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 101 7 | SOLVER: 8 | STEPS: (210000, 250000) 9 | MAX_ITER: 270000 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-InstanceSegmentation/mask_rcnn_R_101_FPN_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 101 7 | SOLVER: 8 | STEPS: (210000, 250000) 9 | MAX_ITER: 270000 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x.py: -------------------------------------------------------------------------------- 1 | from ..common.train import train 2 | from ..common.optim import SGD as optimizer 3 | from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier 4 | from ..common.data.coco import dataloader 5 | from ..common.models.mask_rcnn_c4 import model 6 | 7 | model.backbone.freeze_at = 2 8 | train.init_checkpoint = "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 9 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-C4.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-C4.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | SOLVER: 8 | STEPS: (210000, 250000) 9 | MAX_ITER: 270000 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-DilatedC5.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-DilatedC5.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | SOLVER: 8 | STEPS: (210000, 250000) 9 | MAX_ITER: 270000 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.py: -------------------------------------------------------------------------------- 1 | from ..common.optim import SGD as optimizer 2 | from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier 3 | from ..common.data.coco import dataloader 4 | from ..common.models.mask_rcnn_fpn import model 5 | from ..common.train import train 6 | 7 | model.backbone.bottom_up.freeze_at = 2 8 | train.init_checkpoint = "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 9 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x_giou.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | RPN: 8 | BBOX_REG_LOSS_TYPE: "giou" 9 | BBOX_REG_LOSS_WEIGHT: 2.0 10 | ROI_BOX_HEAD: 11 | BBOX_REG_LOSS_TYPE: "giou" 12 | BBOX_REG_LOSS_WEIGHT: 10.0 13 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | SOLVER: 8 | STEPS: (210000, 250000) 9 | MAX_ITER: 270000 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | MASK_ON: True 4 | WEIGHTS: "detectron2://ImageNetPretrained/FAIR/X-101-32x8d.pkl" 5 | PIXEL_STD: [57.375, 57.120, 58.395] 6 | RESNETS: 7 | STRIDE_IN_1X1: False # this is a C2 model 8 | NUM_GROUPS: 32 9 | WIDTH_PER_GROUP: 8 10 | DEPTH: 101 11 | SOLVER: 12 | STEPS: (210000, 250000) 13 | MAX_ITER: 270000 14 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Keypoints/Base-Keypoint-RCNN-FPN.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | KEYPOINT_ON: True 4 | ROI_HEADS: 5 | NUM_CLASSES: 1 6 | ROI_BOX_HEAD: 7 | SMOOTH_L1_BETA: 0.5 # Keypoint AP degrades (though box AP improves) when using plain L1 loss 8 | RPN: 9 | # Detectron1 uses 2000 proposals per-batch, but this option is per-image in detectron2. 10 | # 1000 proposals per-image is found to hurt box AP. 11 | # Therefore we increase it to 1500 per-image. 12 | POST_NMS_TOPK_TRAIN: 1500 13 | DATASETS: 14 | TRAIN: ("keypoints_coco_2017_train",) 15 | TEST: ("keypoints_coco_2017_val",) 16 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Keypoints/keypoint_rcnn_R_101_FPN_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-Keypoint-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" 4 | RESNETS: 5 | DEPTH: 101 6 | SOLVER: 7 | STEPS: (210000, 250000) 8 | MAX_ITER: 270000 9 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_1x.py: -------------------------------------------------------------------------------- 1 | from ..common.optim import SGD as optimizer 2 | from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier 3 | from ..common.data.coco_keypoint import dataloader 4 | from ..common.models.keypoint_rcnn_fpn import model 5 | from ..common.train import train 6 | 7 | model.backbone.bottom_up.freeze_at = 2 8 | train.init_checkpoint = "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 9 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-Keypoint-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | RESNETS: 5 | DEPTH: 50 6 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-Keypoint-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | RESNETS: 5 | DEPTH: 50 6 | SOLVER: 7 | STEPS: (210000, 250000) 8 | MAX_ITER: 270000 9 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-Keypoints/keypoint_rcnn_X_101_32x8d_FPN_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-Keypoint-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/FAIR/X-101-32x8d.pkl" 4 | PIXEL_STD: [57.375, 57.120, 58.395] 5 | RESNETS: 6 | STRIDE_IN_1X1: False # this is a C2 model 7 | NUM_GROUPS: 32 8 | WIDTH_PER_GROUP: 8 9 | DEPTH: 101 10 | SOLVER: 11 | STEPS: (210000, 250000) 12 | MAX_ITER: 270000 13 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-PanopticSegmentation/Base-Panoptic-FPN.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | META_ARCHITECTURE: "PanopticFPN" 4 | MASK_ON: True 5 | SEM_SEG_HEAD: 6 | LOSS_WEIGHT: 0.5 7 | DATASETS: 8 | TRAIN: ("coco_2017_train_panoptic_separated",) 9 | TEST: ("coco_2017_val_panoptic_separated",) 10 | DATALOADER: 11 | FILTER_EMPTY_ANNOTATIONS: False 12 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-PanopticSegmentation/panoptic_fpn_R_101_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-Panoptic-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" 4 | RESNETS: 5 | DEPTH: 101 6 | SOLVER: 7 | STEPS: (210000, 250000) 8 | MAX_ITER: 270000 9 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.py: -------------------------------------------------------------------------------- 1 | from ..common.optim import SGD as optimizer 2 | from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier 3 | from ..common.data.coco_panoptic_separated import dataloader 4 | from ..common.models.panoptic_fpn import model 5 | from ..common.train import train 6 | 7 | model.backbone.bottom_up.freeze_at = 2 8 | train.init_checkpoint = "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 9 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-Panoptic-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | RESNETS: 5 | DEPTH: 50 6 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-Panoptic-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | RESNETS: 5 | DEPTH: 50 6 | SOLVER: 7 | STEPS: (210000, 250000) 8 | MAX_ITER: 270000 9 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Detectron1-Comparisons/faster_rcnn_R_50_FPN_noaug_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: False 5 | RESNETS: 6 | DEPTH: 50 7 | # Detectron1 uses smooth L1 loss with some magic beta values. 8 | # The defaults are changed to L1 loss in Detectron2. 9 | RPN: 10 | SMOOTH_L1_BETA: 0.1111 11 | ROI_BOX_HEAD: 12 | SMOOTH_L1_BETA: 1.0 13 | POOLER_SAMPLING_RATIO: 2 14 | POOLER_TYPE: "ROIAlign" 15 | INPUT: 16 | # no scale augmentation 17 | MIN_SIZE_TRAIN: (800, ) 18 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Detectron1-Comparisons/mask_rcnn_R_50_FPN_noaug_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | # Detectron1 uses smooth L1 loss with some magic beta values. 8 | # The defaults are changed to L1 loss in Detectron2. 9 | RPN: 10 | SMOOTH_L1_BETA: 0.1111 11 | ROI_BOX_HEAD: 12 | SMOOTH_L1_BETA: 1.0 13 | POOLER_SAMPLING_RATIO: 2 14 | POOLER_TYPE: "ROIAlign" 15 | ROI_MASK_HEAD: 16 | POOLER_SAMPLING_RATIO: 2 17 | POOLER_TYPE: "ROIAlign" 18 | INPUT: 19 | # no scale augmentation 20 | MIN_SIZE_TRAIN: (800, ) 21 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/LVISv0.5-InstanceSegmentation/mask_rcnn_R_101_FPN_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 101 7 | ROI_HEADS: 8 | NUM_CLASSES: 1230 9 | SCORE_THRESH_TEST: 0.0001 10 | INPUT: 11 | MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) 12 | DATASETS: 13 | TRAIN: ("lvis_v0.5_train",) 14 | TEST: ("lvis_v0.5_val",) 15 | TEST: 16 | DETECTIONS_PER_IMAGE: 300 # LVIS allows up to 300 17 | DATALOADER: 18 | SAMPLER_TRAIN: "RepeatFactorTrainingSampler" 19 | REPEAT_THRESHOLD: 0.001 20 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/LVISv0.5-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | ROI_HEADS: 8 | NUM_CLASSES: 1230 9 | SCORE_THRESH_TEST: 0.0001 10 | INPUT: 11 | MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) 12 | DATASETS: 13 | TRAIN: ("lvis_v0.5_train",) 14 | TEST: ("lvis_v0.5_val",) 15 | TEST: 16 | DETECTIONS_PER_IMAGE: 300 # LVIS allows up to 300 17 | DATALOADER: 18 | SAMPLER_TRAIN: "RepeatFactorTrainingSampler" 19 | REPEAT_THRESHOLD: 0.001 20 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/LVISv0.5-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/FAIR/X-101-32x8d.pkl" 4 | PIXEL_STD: [57.375, 57.120, 58.395] 5 | MASK_ON: True 6 | RESNETS: 7 | STRIDE_IN_1X1: False # this is a C2 model 8 | NUM_GROUPS: 32 9 | WIDTH_PER_GROUP: 8 10 | DEPTH: 101 11 | ROI_HEADS: 12 | NUM_CLASSES: 1230 13 | SCORE_THRESH_TEST: 0.0001 14 | INPUT: 15 | MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) 16 | DATASETS: 17 | TRAIN: ("lvis_v0.5_train",) 18 | TEST: ("lvis_v0.5_val",) 19 | TEST: 20 | DETECTIONS_PER_IMAGE: 300 # LVIS allows up to 300 21 | DATALOADER: 22 | SAMPLER_TRAIN: "RepeatFactorTrainingSampler" 23 | REPEAT_THRESHOLD: 0.001 24 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/LVISv1-InstanceSegmentation/mask_rcnn_R_101_FPN_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 101 7 | ROI_HEADS: 8 | NUM_CLASSES: 1203 9 | SCORE_THRESH_TEST: 0.0001 10 | INPUT: 11 | MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) 12 | DATASETS: 13 | TRAIN: ("lvis_v1_train",) 14 | TEST: ("lvis_v1_val",) 15 | TEST: 16 | DETECTIONS_PER_IMAGE: 300 # LVIS allows up to 300 17 | SOLVER: 18 | STEPS: (120000, 160000) 19 | MAX_ITER: 180000 # 180000 * 16 / 100000 ~ 28.8 epochs 20 | DATALOADER: 21 | SAMPLER_TRAIN: "RepeatFactorTrainingSampler" 22 | REPEAT_THRESHOLD: 0.001 23 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/LVISv1-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | ROI_HEADS: 8 | NUM_CLASSES: 1203 9 | SCORE_THRESH_TEST: 0.0001 10 | INPUT: 11 | MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) 12 | DATASETS: 13 | TRAIN: ("lvis_v1_train",) 14 | TEST: ("lvis_v1_val",) 15 | TEST: 16 | DETECTIONS_PER_IMAGE: 300 # LVIS allows up to 300 17 | SOLVER: 18 | STEPS: (120000, 160000) 19 | MAX_ITER: 180000 # 180000 * 16 / 100000 ~ 28.8 epochs 20 | DATALOADER: 21 | SAMPLER_TRAIN: "RepeatFactorTrainingSampler" 22 | REPEAT_THRESHOLD: 0.001 23 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/LVISv1-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/FAIR/X-101-32x8d.pkl" 4 | PIXEL_STD: [57.375, 57.120, 58.395] 5 | MASK_ON: True 6 | RESNETS: 7 | STRIDE_IN_1X1: False # this is a C2 model 8 | NUM_GROUPS: 32 9 | WIDTH_PER_GROUP: 8 10 | DEPTH: 101 11 | ROI_HEADS: 12 | NUM_CLASSES: 1203 13 | SCORE_THRESH_TEST: 0.0001 14 | INPUT: 15 | MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) 16 | DATASETS: 17 | TRAIN: ("lvis_v1_train",) 18 | TEST: ("lvis_v1_val",) 19 | SOLVER: 20 | STEPS: (120000, 160000) 21 | MAX_ITER: 180000 # 180000 * 16 / 100000 ~ 28.8 epochs 22 | TEST: 23 | DETECTIONS_PER_IMAGE: 300 # LVIS allows up to 300 24 | DATALOADER: 25 | SAMPLER_TRAIN: "RepeatFactorTrainingSampler" 26 | REPEAT_THRESHOLD: 0.001 27 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Misc/cascade_mask_rcnn_R_50_FPN_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | ROI_HEADS: 8 | NAME: CascadeROIHeads 9 | ROI_BOX_HEAD: 10 | CLS_AGNOSTIC_BBOX_REG: True 11 | RPN: 12 | POST_NMS_TOPK_TRAIN: 2000 13 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Misc/cascade_mask_rcnn_R_50_FPN_3x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | ROI_HEADS: 8 | NAME: CascadeROIHeads 9 | ROI_BOX_HEAD: 10 | CLS_AGNOSTIC_BBOX_REG: True 11 | RPN: 12 | POST_NMS_TOPK_TRAIN: 2000 13 | SOLVER: 14 | STEPS: (210000, 250000) 15 | MAX_ITER: 270000 16 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Misc/mask_rcnn_R_50_FPN_1x_cls_agnostic.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | ROI_BOX_HEAD: 8 | CLS_AGNOSTIC_BBOX_REG: True 9 | ROI_MASK_HEAD: 10 | CLS_AGNOSTIC_MASK: True 11 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Misc/mask_rcnn_R_50_FPN_1x_dconv_c3-c5.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | DEFORM_ON_PER_STAGE: [False, True, True, True] # on Res3,Res4,Res5 8 | DEFORM_MODULATED: False 9 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Misc/mask_rcnn_R_50_FPN_3x_dconv_c3-c5.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | DEFORM_ON_PER_STAGE: [False, True, True, True] # on Res3,Res4,Res5 8 | DEFORM_MODULATED: False 9 | SOLVER: 10 | STEPS: (210000, 250000) 11 | MAX_ITER: 270000 12 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Misc/mask_rcnn_R_50_FPN_3x_gn.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "catalog://ImageNetPretrained/FAIR/R-50-GN" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | NORM: "GN" 8 | STRIDE_IN_1X1: False 9 | FPN: 10 | NORM: "GN" 11 | ROI_BOX_HEAD: 12 | NAME: "FastRCNNConvFCHead" 13 | NUM_CONV: 4 14 | NUM_FC: 1 15 | NORM: "GN" 16 | ROI_MASK_HEAD: 17 | NORM: "GN" 18 | SOLVER: 19 | # 3x schedule 20 | STEPS: (210000, 250000) 21 | MAX_ITER: 270000 22 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Misc/mask_rcnn_R_50_FPN_3x_syncbn.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | NORM: "SyncBN" 8 | STRIDE_IN_1X1: True 9 | FPN: 10 | NORM: "SyncBN" 11 | ROI_BOX_HEAD: 12 | NAME: "FastRCNNConvFCHead" 13 | NUM_CONV: 4 14 | NUM_FC: 1 15 | NORM: "SyncBN" 16 | ROI_MASK_HEAD: 17 | NORM: "SyncBN" 18 | SOLVER: 19 | # 3x schedule 20 | STEPS: (210000, 250000) 21 | MAX_ITER: 270000 22 | TEST: 23 | PRECISE_BN: 24 | ENABLED: True 25 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Misc/panoptic_fpn_R_101_dconv_cascade_gn_3x.yaml: -------------------------------------------------------------------------------- 1 | # A large PanopticFPN for demo purposes. 2 | # Use GN on backbone to support semantic seg. 3 | # Use Cascade + Deform Conv to improve localization. 4 | _BASE_: "../COCO-PanopticSegmentation/Base-Panoptic-FPN.yaml" 5 | MODEL: 6 | WEIGHTS: "catalog://ImageNetPretrained/FAIR/R-101-GN" 7 | RESNETS: 8 | DEPTH: 101 9 | NORM: "GN" 10 | DEFORM_ON_PER_STAGE: [False, True, True, True] 11 | STRIDE_IN_1X1: False 12 | FPN: 13 | NORM: "GN" 14 | ROI_HEADS: 15 | NAME: CascadeROIHeads 16 | ROI_BOX_HEAD: 17 | CLS_AGNOSTIC_BBOX_REG: True 18 | ROI_MASK_HEAD: 19 | NORM: "GN" 20 | RPN: 21 | POST_NMS_TOPK_TRAIN: 2000 22 | SOLVER: 23 | STEPS: (105000, 125000) 24 | MAX_ITER: 135000 25 | IMS_PER_BATCH: 32 26 | BASE_LR: 0.04 27 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Misc/scratch_mask_rcnn_R_50_FPN_3x_gn.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "mask_rcnn_R_50_FPN_3x_gn.yaml" 2 | MODEL: 3 | # Train from random initialization. 4 | WEIGHTS: "" 5 | # It makes sense to divide by STD when training from scratch 6 | # But it seems to make no difference on the results and C2's models didn't do this. 7 | # So we keep things consistent with C2. 8 | # PIXEL_STD: [57.375, 57.12, 58.395] 9 | MASK_ON: True 10 | BACKBONE: 11 | FREEZE_AT: 0 12 | # NOTE: Please refer to Rethinking ImageNet Pre-training https://arxiv.org/abs/1811.08883 13 | # to learn what you need for training from scratch. 14 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Misc/scratch_mask_rcnn_R_50_FPN_9x_gn.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "mask_rcnn_R_50_FPN_3x_gn.yaml" 2 | MODEL: 3 | PIXEL_STD: [57.375, 57.12, 58.395] 4 | WEIGHTS: "" 5 | MASK_ON: True 6 | RESNETS: 7 | STRIDE_IN_1X1: False 8 | BACKBONE: 9 | FREEZE_AT: 0 10 | SOLVER: 11 | # 9x schedule 12 | IMS_PER_BATCH: 64 # 4x the standard 13 | STEPS: (187500, 197500) # last 60/4==15k and last 20/4==5k 14 | MAX_ITER: 202500 # 90k * 9 / 4 15 | BASE_LR: 0.08 16 | TEST: 17 | EVAL_PERIOD: 2500 18 | # NOTE: Please refer to Rethinking ImageNet Pre-training https://arxiv.org/abs/1811.08883 19 | # to learn what you need for training from scratch. 20 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Misc/scratch_mask_rcnn_R_50_FPN_9x_syncbn.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "mask_rcnn_R_50_FPN_3x_syncbn.yaml" 2 | MODEL: 3 | PIXEL_STD: [57.375, 57.12, 58.395] 4 | WEIGHTS: "" 5 | MASK_ON: True 6 | RESNETS: 7 | STRIDE_IN_1X1: False 8 | BACKBONE: 9 | FREEZE_AT: 0 10 | SOLVER: 11 | # 9x schedule 12 | IMS_PER_BATCH: 64 # 4x the standard 13 | STEPS: (187500, 197500) # last 60/4==15k and last 20/4==5k 14 | MAX_ITER: 202500 # 90k * 9 / 4 15 | BASE_LR: 0.08 16 | TEST: 17 | EVAL_PERIOD: 2500 18 | # NOTE: Please refer to Rethinking ImageNet Pre-training https://arxiv.org/abs/1811.08883 19 | # to learn what you need for training from scratch. 20 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/Misc/semantic_R_50_FPN_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | META_ARCHITECTURE: "SemanticSegmentor" 4 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 5 | RESNETS: 6 | DEPTH: 50 7 | DATASETS: 8 | TRAIN: ("coco_2017_train_panoptic_stuffonly",) 9 | TEST: ("coco_2017_val_panoptic_stuffonly",) 10 | INPUT: 11 | MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) 12 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/PascalVOC-Detection/faster_rcnn_R_50_C4.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-C4.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: False 5 | RESNETS: 6 | DEPTH: 50 7 | ROI_HEADS: 8 | NUM_CLASSES: 20 9 | INPUT: 10 | MIN_SIZE_TRAIN: (480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800) 11 | MIN_SIZE_TEST: 800 12 | DATASETS: 13 | TRAIN: ('voc_2007_trainval', 'voc_2012_trainval') 14 | TEST: ('voc_2007_test',) 15 | SOLVER: 16 | STEPS: (12000, 16000) 17 | MAX_ITER: 18000 # 17.4 epochs 18 | WARMUP_ITERS: 100 19 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/PascalVOC-Detection/faster_rcnn_R_50_FPN.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: False 5 | RESNETS: 6 | DEPTH: 50 7 | ROI_HEADS: 8 | NUM_CLASSES: 20 9 | INPUT: 10 | MIN_SIZE_TRAIN: (480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800) 11 | MIN_SIZE_TEST: 800 12 | DATASETS: 13 | TRAIN: ('voc_2007_trainval', 'voc_2012_trainval') 14 | TEST: ('voc_2007_test',) 15 | SOLVER: 16 | STEPS: (12000, 16000) 17 | MAX_ITER: 18000 # 17.4 epochs 18 | WARMUP_ITERS: 100 19 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/common/README.md: -------------------------------------------------------------------------------- 1 | This directory provides definitions for a few common models, dataloaders, scheduler, 2 | and optimizers that are often used in training. 3 | The definition of these objects are provided in the form of lazy instantiation: 4 | their arguments can be edited by users before constructing the objects. 5 | 6 | They can be imported, or loaded by `model_zoo.get_config` API in users' own configs. 7 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/common/data/coco_keypoint.py: -------------------------------------------------------------------------------- 1 | from detectron2.data.detection_utils import create_keypoint_hflip_indices 2 | 3 | from .coco import dataloader 4 | 5 | dataloader.train.dataset.min_keypoints = 1 6 | dataloader.train.dataset.names = "keypoints_coco_2017_train" 7 | dataloader.test.dataset.names = "keypoints_coco_2017_val" 8 | 9 | dataloader.train.mapper.update( 10 | use_instance_mask=False, 11 | use_keypoint=True, 12 | keypoint_hflip_indices=create_keypoint_hflip_indices(dataloader.train.dataset.names), 13 | ) 14 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/common/data/coco_panoptic_separated.py: -------------------------------------------------------------------------------- 1 | from detectron2.config import LazyCall as L 2 | from detectron2.evaluation import ( 3 | COCOEvaluator, 4 | COCOPanopticEvaluator, 5 | DatasetEvaluators, 6 | SemSegEvaluator, 7 | ) 8 | 9 | from .coco import dataloader 10 | 11 | dataloader.train.dataset.names = "coco_2017_train_panoptic_separated" 12 | dataloader.train.dataset.filter_empty = False 13 | dataloader.test.dataset.names = "coco_2017_val_panoptic_separated" 14 | 15 | 16 | dataloader.evaluator = [ 17 | L(COCOEvaluator)( 18 | dataset_name="${...test.dataset.names}", 19 | ), 20 | L(SemSegEvaluator)( 21 | dataset_name="${...test.dataset.names}", 22 | ), 23 | L(COCOPanopticEvaluator)( 24 | dataset_name="${...test.dataset.names}", 25 | ), 26 | ] 27 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/common/models/fcos.py: -------------------------------------------------------------------------------- 1 | from detectron2.modeling.meta_arch.fcos import FCOS, FCOSHead 2 | 3 | from .retinanet import model 4 | 5 | model._target_ = FCOS 6 | 7 | del model.anchor_generator 8 | del model.box2box_transform 9 | del model.anchor_matcher 10 | del model.input_format 11 | 12 | # Use P5 instead of C5 to compute P6/P7 13 | # (Sec 2.2 of https://arxiv.org/abs/2006.09214) 14 | model.backbone.top_block.in_feature = "p5" 15 | model.backbone.top_block.in_channels = 256 16 | 17 | # New score threshold determined based on sqrt(cls_score * centerness) 18 | model.test_score_thresh = 0.2 19 | model.test_nms_thresh = 0.6 20 | 21 | model.head._target_ = FCOSHead 22 | del model.head.num_anchors 23 | model.head.norm = "GN" 24 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/common/models/panoptic_fpn.py: -------------------------------------------------------------------------------- 1 | from detectron2.config import LazyCall as L 2 | from detectron2.layers import ShapeSpec 3 | from detectron2.modeling import PanopticFPN 4 | from detectron2.modeling.meta_arch.semantic_seg import SemSegFPNHead 5 | 6 | from .mask_rcnn_fpn import model 7 | 8 | model._target_ = PanopticFPN 9 | model.sem_seg_head = L(SemSegFPNHead)( 10 | input_shape={ 11 | f: L(ShapeSpec)(stride=s, channels="${....backbone.out_channels}") 12 | for f, s in zip(["p2", "p3", "p4", "p5"], [4, 8, 16, 32]) 13 | }, 14 | ignore_value=255, 15 | num_classes=54, # COCO stuff + 1 16 | conv_dims=128, 17 | common_stride=4, 18 | loss_weight=0.5, 19 | norm="GN", 20 | ) 21 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/common/optim.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | from detectron2.config import LazyCall as L 4 | from detectron2.solver.build import get_default_optimizer_params 5 | 6 | SGD = L(torch.optim.SGD)( 7 | params=L(get_default_optimizer_params)( 8 | # params.model is meant to be set to the model object, before instantiating 9 | # the optimizer. 10 | weight_decay_norm=0.0 11 | ), 12 | lr=0.02, 13 | momentum=0.9, 14 | weight_decay=1e-4, 15 | ) 16 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/common/train.py: -------------------------------------------------------------------------------- 1 | # Common training-related configs that are designed for "tools/lazyconfig_train_net.py" 2 | # You can use your own instead, together with your own train_net.py 3 | train = dict( 4 | output_dir="./output", 5 | init_checkpoint="", 6 | max_iter=90000, 7 | amp=dict(enabled=False), # options for Automatic Mixed Precision 8 | ddp=dict( # options for DistributedDataParallel 9 | broadcast_buffers=False, 10 | find_unused_parameters=False, 11 | fp16_compression=False, 12 | ), 13 | checkpointer=dict(period=5000, max_to_keep=100), # options for PeriodicCheckpointer 14 | eval_period=5000, 15 | log_period=20, 16 | device="cuda" 17 | # ... 18 | ) 19 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/new_baselines/mask_rcnn_R_101_FPN_100ep_LSJ.py: -------------------------------------------------------------------------------- 1 | from .mask_rcnn_R_50_FPN_100ep_LSJ import ( 2 | dataloader, 3 | lr_multiplier, 4 | model, 5 | optimizer, 6 | train, 7 | ) 8 | 9 | model.backbone.bottom_up.stages.depth = 101 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/new_baselines/mask_rcnn_R_101_FPN_200ep_LSJ.py: -------------------------------------------------------------------------------- 1 | from .mask_rcnn_R_101_FPN_100ep_LSJ import ( 2 | dataloader, 3 | lr_multiplier, 4 | model, 5 | optimizer, 6 | train, 7 | ) 8 | 9 | train.max_iter *= 2 # 100ep -> 200ep 10 | 11 | lr_multiplier.scheduler.milestones = [ 12 | milestone * 2 for milestone in lr_multiplier.scheduler.milestones 13 | ] 14 | lr_multiplier.scheduler.num_updates = train.max_iter 15 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/new_baselines/mask_rcnn_R_101_FPN_400ep_LSJ.py: -------------------------------------------------------------------------------- 1 | from .mask_rcnn_R_101_FPN_100ep_LSJ import ( 2 | dataloader, 3 | lr_multiplier, 4 | model, 5 | optimizer, 6 | train, 7 | ) 8 | 9 | train.max_iter *= 4 # 100ep -> 400ep 10 | 11 | lr_multiplier.scheduler.milestones = [ 12 | milestone * 4 for milestone in lr_multiplier.scheduler.milestones 13 | ] 14 | lr_multiplier.scheduler.num_updates = train.max_iter 15 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/new_baselines/mask_rcnn_R_50_FPN_200ep_LSJ.py: -------------------------------------------------------------------------------- 1 | from .mask_rcnn_R_50_FPN_100ep_LSJ import ( 2 | dataloader, 3 | lr_multiplier, 4 | model, 5 | optimizer, 6 | train, 7 | ) 8 | 9 | train.max_iter *= 2 # 100ep -> 200ep 10 | 11 | lr_multiplier.scheduler.milestones = [ 12 | milestone * 2 for milestone in lr_multiplier.scheduler.milestones 13 | ] 14 | lr_multiplier.scheduler.num_updates = train.max_iter 15 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/new_baselines/mask_rcnn_R_50_FPN_400ep_LSJ.py: -------------------------------------------------------------------------------- 1 | from .mask_rcnn_R_50_FPN_100ep_LSJ import ( 2 | dataloader, 3 | lr_multiplier, 4 | model, 5 | optimizer, 6 | train, 7 | ) 8 | 9 | train.max_iter *= 4 # 100ep -> 400ep 10 | 11 | lr_multiplier.scheduler.milestones = [ 12 | milestone * 4 for milestone in lr_multiplier.scheduler.milestones 13 | ] 14 | lr_multiplier.scheduler.num_updates = train.max_iter 15 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/new_baselines/mask_rcnn_R_50_FPN_50ep_LSJ.py: -------------------------------------------------------------------------------- 1 | from .mask_rcnn_R_50_FPN_100ep_LSJ import ( 2 | dataloader, 3 | lr_multiplier, 4 | model, 5 | optimizer, 6 | train, 7 | ) 8 | 9 | train.max_iter //= 2 # 100ep -> 50ep 10 | 11 | lr_multiplier.scheduler.milestones = [ 12 | milestone // 2 for milestone in lr_multiplier.scheduler.milestones 13 | ] 14 | lr_multiplier.scheduler.num_updates = train.max_iter 15 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_200ep_LSJ.py: -------------------------------------------------------------------------------- 1 | from .mask_rcnn_regnetx_4gf_dds_FPN_100ep_LSJ import ( 2 | dataloader, 3 | lr_multiplier, 4 | model, 5 | optimizer, 6 | train, 7 | ) 8 | 9 | train.max_iter *= 2 # 100ep -> 200ep 10 | 11 | lr_multiplier.scheduler.milestones = [ 12 | milestone * 2 for milestone in lr_multiplier.scheduler.milestones 13 | ] 14 | lr_multiplier.scheduler.num_updates = train.max_iter 15 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_400ep_LSJ.py: -------------------------------------------------------------------------------- 1 | from .mask_rcnn_regnetx_4gf_dds_FPN_100ep_LSJ import ( 2 | dataloader, 3 | lr_multiplier, 4 | model, 5 | optimizer, 6 | train, 7 | ) 8 | 9 | train.max_iter *= 4 # 100ep -> 400ep 10 | 11 | lr_multiplier.scheduler.milestones = [ 12 | milestone * 4 for milestone in lr_multiplier.scheduler.milestones 13 | ] 14 | lr_multiplier.scheduler.num_updates = train.max_iter 15 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/new_baselines/mask_rcnn_regnety_4gf_dds_FPN_200ep_LSJ.py: -------------------------------------------------------------------------------- 1 | from .mask_rcnn_regnety_4gf_dds_FPN_100ep_LSJ import ( 2 | dataloader, 3 | lr_multiplier, 4 | model, 5 | optimizer, 6 | train, 7 | ) 8 | 9 | train.max_iter *= 2 # 100ep -> 200ep 10 | 11 | lr_multiplier.scheduler.milestones = [ 12 | milestone * 2 for milestone in lr_multiplier.scheduler.milestones 13 | ] 14 | lr_multiplier.scheduler.num_updates = train.max_iter 15 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/new_baselines/mask_rcnn_regnety_4gf_dds_FPN_400ep_LSJ.py: -------------------------------------------------------------------------------- 1 | from .mask_rcnn_regnety_4gf_dds_FPN_100ep_LSJ import ( 2 | dataloader, 3 | lr_multiplier, 4 | model, 5 | optimizer, 6 | train, 7 | ) 8 | 9 | train.max_iter *= 4 # 100ep -> 400ep 10 | 11 | lr_multiplier.scheduler.milestones = [ 12 | milestone * 4 for milestone in lr_multiplier.scheduler.milestones 13 | ] 14 | lr_multiplier.scheduler.num_updates = train.max_iter 15 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/README.md: -------------------------------------------------------------------------------- 1 | These are quick configs for performance or accuracy regression tracking purposes. 2 | 3 | * `*instance_test.yaml`: can train on 2 GPUs. They are used to test whether the training can 4 | successfully finish. They are not expected to produce reasonable training results. 5 | * `*inference_acc_test.yaml`: They should be run using `--eval-only`. They run inference using pre-trained models and verify 6 | the results are as expected. 7 | * `*training_acc_test.yaml`: They should be trained on 8 GPUs. They finish in about an hour and verify the training accuracy 8 | is within the normal range. 9 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/cascade_mask_rcnn_R_50_FPN_inference_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Misc/cascade_mask_rcnn_R_50_FPN_3x.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://Misc/cascade_mask_rcnn_R_50_FPN_3x/144998488/model_final_480dd8.pkl" 4 | DATASETS: 5 | TEST: ("coco_2017_val_100",) 6 | TEST: 7 | EXPECTED_RESULTS: [["bbox", "AP", 50.18, 0.02], ["segm", "AP", 43.87, 0.02]] 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/cascade_mask_rcnn_R_50_FPN_instant_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Misc/cascade_mask_rcnn_R_50_FPN_3x.yaml" 2 | DATASETS: 3 | TRAIN: ("coco_2017_val_100",) 4 | TEST: ("coco_2017_val_100",) 5 | SOLVER: 6 | BASE_LR: 0.005 7 | STEPS: (30,) 8 | MAX_ITER: 40 9 | IMS_PER_BATCH: 4 10 | DATALOADER: 11 | NUM_WORKERS: 2 12 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/fast_rcnn_R_50_FPN_inference_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../COCO-Detection/fast_rcnn_R_50_FPN_1x.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://COCO-Detection/fast_rcnn_R_50_FPN_1x/137635226/model_final_e5f7ce.pkl" 4 | DATASETS: 5 | TEST: ("coco_2017_val_100",) 6 | TEST: 7 | EXPECTED_RESULTS: [["bbox", "AP", 45.70, 0.02]] 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/fast_rcnn_R_50_FPN_instant_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../COCO-Detection/fast_rcnn_R_50_FPN_1x.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | DATASETS: 5 | TRAIN: ("coco_2017_val_100",) 6 | PROPOSAL_FILES_TRAIN: ("detectron2://COCO-Detection/rpn_R_50_FPN_1x/137258492/coco_2017_val_box_proposals_ee0dad.pkl", ) 7 | TEST: ("coco_2017_val_100",) 8 | PROPOSAL_FILES_TEST: ("detectron2://COCO-Detection/rpn_R_50_FPN_1x/137258492/coco_2017_val_box_proposals_ee0dad.pkl", ) 9 | SOLVER: 10 | BASE_LR: 0.005 11 | STEPS: (30,) 12 | MAX_ITER: 40 13 | IMS_PER_BATCH: 4 14 | DATALOADER: 15 | NUM_WORKERS: 2 16 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/keypoint_rcnn_R_50_FPN_inference_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x/137849621/model_final_a6e10b.pkl" 4 | DATASETS: 5 | TEST: ("keypoints_coco_2017_val_100",) 6 | TEST: 7 | EXPECTED_RESULTS: [["bbox", "AP", 52.47, 0.02], ["keypoints", "AP", 67.36, 0.02]] 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/keypoint_rcnn_R_50_FPN_instant_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | KEYPOINT_ON: True 5 | ROI_HEADS: 6 | NUM_CLASSES: 1 7 | DATASETS: 8 | TRAIN: ("keypoints_coco_2017_val_100",) 9 | TEST: ("keypoints_coco_2017_val_100",) 10 | SOLVER: 11 | BASE_LR: 0.005 12 | STEPS: (30,) 13 | MAX_ITER: 40 14 | IMS_PER_BATCH: 4 15 | DATALOADER: 16 | NUM_WORKERS: 2 17 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/keypoint_rcnn_R_50_FPN_training_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | KEYPOINT_ON: True 5 | RESNETS: 6 | DEPTH: 50 7 | ROI_HEADS: 8 | BATCH_SIZE_PER_IMAGE: 256 9 | NUM_CLASSES: 1 10 | ROI_KEYPOINT_HEAD: 11 | POOLER_RESOLUTION: 14 12 | POOLER_SAMPLING_RATIO: 2 13 | ROI_BOX_HEAD: 14 | SMOOTH_L1_BETA: 1.0 # Keypoint AP degrades when using plain L1 loss 15 | RPN: 16 | SMOOTH_L1_BETA: 0.2 # Keypoint AP degrades when using plain L1 loss 17 | DATASETS: 18 | TRAIN: ("keypoints_coco_2017_val",) 19 | TEST: ("keypoints_coco_2017_val",) 20 | INPUT: 21 | MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) 22 | SOLVER: 23 | WARMUP_FACTOR: 0.33333333 24 | WARMUP_ITERS: 100 25 | STEPS: (5500, 5800) 26 | MAX_ITER: 6000 27 | TEST: 28 | EXPECTED_RESULTS: [["bbox", "AP", 53.5, 1.0], ["keypoints", "AP", 72.4, 1.0]] 29 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/mask_rcnn_R_50_C4_GCV_instant_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-C4.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | DATASETS: 6 | TRAIN: ("coco_2017_val_100",) 7 | TEST: ("coco_2017_val_100",) 8 | SOLVER: 9 | BASE_LR: 0.001 10 | STEPS: (30,) 11 | MAX_ITER: 40 12 | IMS_PER_BATCH: 4 13 | CLIP_GRADIENTS: 14 | ENABLED: True 15 | CLIP_TYPE: "value" 16 | CLIP_VALUE: 1.0 17 | DATALOADER: 18 | NUM_WORKERS: 2 19 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/mask_rcnn_R_50_C4_inference_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../COCO-InstanceSegmentation/mask_rcnn_R_50_C4_3x.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_C4_3x/137849525/model_final_4ce675.pkl" 4 | DATASETS: 5 | TEST: ("coco_2017_val_100",) 6 | TEST: 7 | EXPECTED_RESULTS: [["bbox", "AP", 47.37, 0.02], ["segm", "AP", 40.99, 0.02]] 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/mask_rcnn_R_50_C4_instant_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-C4.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | DATASETS: 6 | TRAIN: ("coco_2017_val_100",) 7 | TEST: ("coco_2017_val_100",) 8 | SOLVER: 9 | BASE_LR: 0.001 10 | STEPS: (30,) 11 | MAX_ITER: 40 12 | IMS_PER_BATCH: 4 13 | DATALOADER: 14 | NUM_WORKERS: 2 15 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/mask_rcnn_R_50_C4_training_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-C4.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | ROI_HEADS: 5 | BATCH_SIZE_PER_IMAGE: 256 6 | MASK_ON: True 7 | DATASETS: 8 | TRAIN: ("coco_2017_val",) 9 | TEST: ("coco_2017_val",) 10 | INPUT: 11 | MIN_SIZE_TRAIN: (600,) 12 | MAX_SIZE_TRAIN: 1000 13 | MIN_SIZE_TEST: 800 14 | MAX_SIZE_TEST: 1000 15 | SOLVER: 16 | IMS_PER_BATCH: 8 # base uses 16 17 | WARMUP_FACTOR: 0.33333 18 | WARMUP_ITERS: 100 19 | STEPS: (11000, 11600) 20 | MAX_ITER: 12000 21 | TEST: 22 | EXPECTED_RESULTS: [["bbox", "AP", 41.88, 0.7], ["segm", "AP", 33.79, 0.5]] 23 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/mask_rcnn_R_50_DC5_inference_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_3x.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_3x/137849551/model_final_84107b.pkl" 4 | DATASETS: 5 | TEST: ("coco_2017_val_100",) 6 | TEST: 7 | EXPECTED_RESULTS: [["bbox", "AP", 47.44, 0.02], ["segm", "AP", 42.94, 0.02]] 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/mask_rcnn_R_50_FPN_inference_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl" 4 | DATASETS: 5 | TEST: ("coco_2017_val_100",) 6 | TEST: 7 | EXPECTED_RESULTS: [["bbox", "AP", 47.34, 0.02], ["segm", "AP", 42.67, 0.02], ["bbox_TTA", "AP", 49.11, 0.02], ["segm_TTA", "AP", 45.04, 0.02]] 8 | AUG: 9 | ENABLED: True 10 | MIN_SIZES: (700, 800) # to save some time 11 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/mask_rcnn_R_50_FPN_instant_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | MASK_ON: True 5 | DATASETS: 6 | TRAIN: ("coco_2017_val_100",) 7 | TEST: ("coco_2017_val_100",) 8 | SOLVER: 9 | BASE_LR: 0.005 10 | STEPS: (30,) 11 | MAX_ITER: 40 12 | IMS_PER_BATCH: 4 13 | DATALOADER: 14 | NUM_WORKERS: 2 15 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/mask_rcnn_R_50_FPN_pred_boxes_training_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "./mask_rcnn_R_50_FPN_training_acc_test.yaml" 2 | MODEL: 3 | ROI_BOX_HEAD: 4 | TRAIN_ON_PRED_BOXES: True 5 | TEST: 6 | EXPECTED_RESULTS: [["bbox", "AP", 42.6, 1.0], ["segm", "AP", 35.8, 0.8]] 7 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/mask_rcnn_R_50_FPN_training_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | ROI_HEADS: 5 | BATCH_SIZE_PER_IMAGE: 256 6 | MASK_ON: True 7 | DATASETS: 8 | TRAIN: ("coco_2017_val",) 9 | TEST: ("coco_2017_val",) 10 | INPUT: 11 | MIN_SIZE_TRAIN: (600,) 12 | MAX_SIZE_TRAIN: 1000 13 | MIN_SIZE_TEST: 800 14 | MAX_SIZE_TEST: 1000 15 | SOLVER: 16 | WARMUP_FACTOR: 0.3333333 17 | WARMUP_ITERS: 100 18 | STEPS: (5500, 5800) 19 | MAX_ITER: 6000 20 | TEST: 21 | EXPECTED_RESULTS: [["bbox", "AP", 42.5, 1.0], ["segm", "AP", 35.8, 0.8]] 22 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/panoptic_fpn_R_50_inference_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../COCO-PanopticSegmentation/panoptic_fpn_R_50_3x.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://COCO-PanopticSegmentation/panoptic_fpn_R_50_3x/139514569/model_final_c10459.pkl" 4 | DATASETS: 5 | TEST: ("coco_2017_val_100_panoptic_separated",) 6 | TEST: 7 | EXPECTED_RESULTS: [["bbox", "AP", 46.47, 0.02], ["segm", "AP", 43.39, 0.02], ["sem_seg", "mIoU", 42.55, 0.02], ["panoptic_seg", "PQ", 38.99, 0.02]] 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/panoptic_fpn_R_50_instant_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | META_ARCHITECTURE: "PanopticFPN" 4 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 5 | MASK_ON: True 6 | RESNETS: 7 | DEPTH: 50 8 | SEM_SEG_HEAD: 9 | LOSS_WEIGHT: 0.5 10 | DATASETS: 11 | TRAIN: ("coco_2017_val_100_panoptic_separated",) 12 | TEST: ("coco_2017_val_100_panoptic_separated",) 13 | SOLVER: 14 | BASE_LR: 0.005 15 | STEPS: (30,) 16 | MAX_ITER: 40 17 | IMS_PER_BATCH: 4 18 | DATALOADER: 19 | NUM_WORKERS: 1 20 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/panoptic_fpn_R_50_training_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | META_ARCHITECTURE: "PanopticFPN" 4 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 5 | MASK_ON: True 6 | RESNETS: 7 | DEPTH: 50 8 | SEM_SEG_HEAD: 9 | LOSS_WEIGHT: 0.5 10 | DATASETS: 11 | TRAIN: ("coco_2017_val_panoptic_separated",) 12 | TEST: ("coco_2017_val_panoptic_separated",) 13 | SOLVER: 14 | BASE_LR: 0.01 15 | WARMUP_FACTOR: 0.001 16 | WARMUP_ITERS: 500 17 | STEPS: (5500,) 18 | MAX_ITER: 7000 19 | TEST: 20 | EXPECTED_RESULTS: [["bbox", "AP", 46.70, 1.1], ["segm", "AP", 39.0, 0.7], ["sem_seg", "mIoU", 64.73, 1.3], ["panoptic_seg", "PQ", 48.13, 0.8]] 21 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/retinanet_R_50_FPN_inference_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../COCO-Detection/retinanet_R_50_FPN_3x.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://COCO-Detection/retinanet_R_50_FPN_3x/190397829/model_final_5bd44e.pkl" 4 | DATASETS: 5 | TEST: ("coco_2017_val_100",) 6 | TEST: 7 | EXPECTED_RESULTS: [["bbox", "AP", 44.45, 0.02]] 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/retinanet_R_50_FPN_instant_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../COCO-Detection/retinanet_R_50_FPN_1x.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | DATASETS: 5 | TRAIN: ("coco_2017_val_100",) 6 | TEST: ("coco_2017_val_100",) 7 | SOLVER: 8 | BASE_LR: 0.005 9 | STEPS: (30,) 10 | MAX_ITER: 40 11 | IMS_PER_BATCH: 4 12 | DATALOADER: 13 | NUM_WORKERS: 2 14 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/rpn_R_50_FPN_inference_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../COCO-Detection/rpn_R_50_FPN_1x.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://COCO-Detection/rpn_R_50_FPN_1x/137258492/model_final_02ce48.pkl" 4 | DATASETS: 5 | TEST: ("coco_2017_val_100",) 6 | TEST: 7 | EXPECTED_RESULTS: [["box_proposals", "AR@1000", 58.16, 0.02]] 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/rpn_R_50_FPN_instant_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../COCO-Detection/rpn_R_50_FPN_1x.yaml" 2 | MODEL: 3 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 4 | DATASETS: 5 | TRAIN: ("coco_2017_val_100",) 6 | TEST: ("coco_2017_val_100",) 7 | SOLVER: 8 | STEPS: (30,) 9 | MAX_ITER: 40 10 | BASE_LR: 0.005 11 | IMS_PER_BATCH: 4 12 | DATALOADER: 13 | NUM_WORKERS: 2 14 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/semantic_R_50_FPN_inference_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | META_ARCHITECTURE: "SemanticSegmentor" 4 | WEIGHTS: "detectron2://semantic_R_50_FPN_1x/111802073/model_final_c18079783c55a94968edc28b7101c5f0.pkl" 5 | RESNETS: 6 | DEPTH: 50 7 | DATASETS: 8 | TEST: ("coco_2017_val_100_panoptic_stuffonly",) 9 | TEST: 10 | EXPECTED_RESULTS: [["sem_seg", "mIoU", 39.53, 0.02], ["sem_seg", "mACC", 51.50, 0.02]] 11 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/semantic_R_50_FPN_instant_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | META_ARCHITECTURE: "SemanticSegmentor" 4 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 5 | RESNETS: 6 | DEPTH: 50 7 | DATASETS: 8 | TRAIN: ("coco_2017_val_100_panoptic_stuffonly",) 9 | TEST: ("coco_2017_val_100_panoptic_stuffonly",) 10 | INPUT: 11 | MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) 12 | SOLVER: 13 | BASE_LR: 0.005 14 | STEPS: (30,) 15 | MAX_ITER: 40 16 | IMS_PER_BATCH: 4 17 | DATALOADER: 18 | NUM_WORKERS: 2 19 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/configs/quick_schedules/semantic_R_50_FPN_training_acc_test.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../Base-RCNN-FPN.yaml" 2 | MODEL: 3 | META_ARCHITECTURE: "SemanticSegmentor" 4 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 5 | RESNETS: 6 | DEPTH: 50 7 | DATASETS: 8 | TRAIN: ("coco_2017_val_panoptic_stuffonly",) 9 | TEST: ("coco_2017_val_panoptic_stuffonly",) 10 | SOLVER: 11 | BASE_LR: 0.01 12 | WARMUP_FACTOR: 0.001 13 | WARMUP_ITERS: 300 14 | STEPS: (5500,) 15 | MAX_ITER: 7000 16 | TEST: 17 | EXPECTED_RESULTS: [["sem_seg", "mIoU", 76.51, 1.0], ["sem_seg", "mACC", 83.25, 1.0]] 18 | INPUT: 19 | # no scale augmentation 20 | MIN_SIZE_TRAIN: (800, ) 21 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/demo/README.md: -------------------------------------------------------------------------------- 1 | 2 | ## Detectron2 Demo 3 | 4 | We provide a command line tool to run a simple demo of builtin configs. 5 | The usage is explained in [GETTING_STARTED.md](../GETTING_STARTED.md). 6 | 7 | See our [blog post](https://ai.facebook.com/blog/-detectron2-a-pytorch-based-modular-object-detection-library-) 8 | for a high-quality demo generated with this tool. 9 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | from .utils.env import setup_environment 4 | 5 | setup_environment() 6 | 7 | 8 | # This line will be programatically read/write by setup.py. 9 | # Leave them at the bottom of this file and don't touch them. 10 | __version__ = "0.6" 11 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/checkpoint/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | # File: 4 | 5 | 6 | from . import catalog as _UNUSED # register the handler 7 | from .detection_checkpoint import DetectionCheckpointer 8 | from fvcore.common.checkpoint import Checkpointer, PeriodicCheckpointer 9 | 10 | __all__ = ["Checkpointer", "PeriodicCheckpointer", "DetectionCheckpointer"] 11 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/config/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from .compat import downgrade_config, upgrade_config 3 | from .config import CfgNode, get_cfg, global_cfg, set_global_cfg, configurable 4 | from .instantiate import instantiate 5 | from .lazy import LazyCall, LazyConfig 6 | 7 | __all__ = [ 8 | "CfgNode", 9 | "get_cfg", 10 | "global_cfg", 11 | "set_global_cfg", 12 | "downgrade_config", 13 | "upgrade_config", 14 | "configurable", 15 | "instantiate", 16 | "LazyCall", 17 | "LazyConfig", 18 | ] 19 | 20 | 21 | from detectron2.utils.env import fixup_module_metadata 22 | 23 | fixup_module_metadata(__name__, globals(), __all__) 24 | del fixup_module_metadata 25 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/data/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from . import transforms # isort:skip 3 | 4 | from .build import ( 5 | build_batch_data_loader, 6 | build_detection_test_loader, 7 | build_detection_train_loader, 8 | get_detection_dataset_dicts, 9 | load_proposals_into_dataset, 10 | print_instances_class_histogram, 11 | ) 12 | from .catalog import DatasetCatalog, MetadataCatalog, Metadata 13 | from .common import DatasetFromList, MapDataset, ToIterableDataset 14 | from .dataset_mapper import DatasetMapper 15 | 16 | # ensure the builtin datasets are registered 17 | from . import datasets, samplers # isort:skip 18 | 19 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 20 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/data/datasets/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### Common Datasets 4 | 5 | The dataset implemented here do not need to load the data into the final format. 6 | It should provide the minimal data structure needed to use the dataset, so it can be very efficient. 7 | 8 | For example, for an image dataset, just provide the file names and labels, but don't read the images. 9 | Let the downstream decide how to read. 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/data/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from .coco import load_coco_json, load_sem_seg, register_coco_instances, convert_to_coco_json 3 | from .coco_panoptic import register_coco_panoptic, register_coco_panoptic_separated 4 | from .lvis import load_lvis_json, register_lvis_instances, get_lvis_instances_meta 5 | from .pascal_voc import load_voc_instances, register_pascal_voc 6 | from . import builtin as _builtin # ensure the builtin datasets are registered 7 | 8 | 9 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/data/datasets/register_coco.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from .coco import register_coco_instances # noqa 3 | from .coco_panoptic import register_coco_panoptic_separated # noqa 4 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/data/samplers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from .distributed_sampler import ( 3 | InferenceSampler, 4 | RandomSubsetTrainingSampler, 5 | RepeatFactorTrainingSampler, 6 | TrainingSampler, 7 | ) 8 | 9 | from .grouped_batch_sampler import GroupedBatchSampler 10 | 11 | __all__ = [ 12 | "GroupedBatchSampler", 13 | "TrainingSampler", 14 | "RandomSubsetTrainingSampler", 15 | "InferenceSampler", 16 | "RepeatFactorTrainingSampler", 17 | ] 18 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/data/transforms/__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 | 10 | 11 | from detectron2.utils.env import fixup_module_metadata 12 | 13 | fixup_module_metadata(__name__, globals(), __all__) 14 | del fixup_module_metadata 15 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/engine/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | from .launch import * 4 | from .train_loop import * 5 | 6 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 7 | 8 | 9 | # prefer to let hooks and defaults live in separate namespaces (therefore not in __all__) 10 | # but still make them available here 11 | from .hooks import * 12 | from .defaults import * 13 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/evaluation/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from .cityscapes_evaluation import CityscapesInstanceEvaluator, CityscapesSemSegEvaluator 3 | from .coco_evaluation import COCOEvaluator 4 | from .rotated_coco_evaluation import RotatedCOCOEvaluator 5 | from .evaluator import DatasetEvaluator, DatasetEvaluators, inference_context, inference_on_dataset 6 | from .lvis_evaluation import LVISEvaluator 7 | from .panoptic_evaluation import COCOPanopticEvaluator 8 | from .pascal_voc_evaluation import PascalVOCDetectionEvaluator 9 | from .sem_seg_evaluation import SemSegEvaluator 10 | from .testing import print_csv_format, verify_results 11 | 12 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 13 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/export/README.md: -------------------------------------------------------------------------------- 1 | 2 | This directory contains code to prepare a detectron2 model for deployment. 3 | Currently it supports exporting a detectron2 model to Caffe2 format through ONNX. 4 | 5 | Please see [documentation](https://detectron2.readthedocs.io/tutorials/deployment.html) for its usage. 6 | 7 | 8 | ### Acknowledgements 9 | 10 | Thanks to Mobile Vision team at Facebook for developing the Caffe2 conversion tools. 11 | 12 | Thanks to Computing Platform Department - PAI team at Alibaba Group (@bddpqq, @chenbohua3) who 13 | help export Detectron2 models to TorchScript. 14 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/export/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | try: 4 | from caffe2.proto import caffe2_pb2 as _tmp 5 | 6 | # caffe2 is optional 7 | except ImportError: 8 | pass 9 | else: 10 | from .api import * 11 | 12 | from .flatten import TracingAdapter 13 | from .torchscript import scripting_with_instances, dump_torchscript_IR 14 | 15 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 16 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/layers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from .batch_norm import FrozenBatchNorm2d, get_norm, NaiveSyncBatchNorm, CycleBatchNormList 3 | from .deform_conv import DeformConv, ModulatedDeformConv 4 | from .mask_ops import paste_masks_in_image 5 | from .nms import batched_nms, batched_nms_rotated, nms, nms_rotated 6 | from .roi_align import ROIAlign, roi_align 7 | from .roi_align_rotated import ROIAlignRotated, roi_align_rotated 8 | from .shape_spec import ShapeSpec 9 | from .wrappers import ( 10 | BatchNorm2d, 11 | Conv2d, 12 | ConvTranspose2d, 13 | cat, 14 | interpolate, 15 | Linear, 16 | nonzero_tuple, 17 | cross_entropy, 18 | shapes_to_tensor, 19 | ) 20 | from .blocks import CNNBlockBase, DepthwiseSeparableConv2d 21 | from .aspp import ASPP 22 | from .losses import ciou_loss, diou_loss 23 | 24 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 25 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/layers/csrc/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | To add a new Op: 4 | 5 | 1. Create a new directory 6 | 2. Implement new ops there 7 | 3. Delcare its Python interface in `vision.cpp`. 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/layers/csrc/cuda_version.cu: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | #include 4 | 5 | namespace detectron2 { 6 | int get_cudart_version() { 7 | // Not a ROCM platform: Either HIP is not used, or 8 | // it is used, but platform is not ROCM (i.e. it is CUDA) 9 | #if !defined(__HIP_PLATFORM_HCC__) 10 | return CUDART_VERSION; 11 | #else 12 | int version = 0; 13 | 14 | #if HIP_VERSION_MAJOR != 0 15 | // Create a convention similar to that of CUDA, as assumed by other 16 | // parts of the code. 17 | 18 | version = HIP_VERSION_MINOR; 19 | version += (HIP_VERSION_MAJOR * 100); 20 | #else 21 | hipRuntimeGetVersion(&version); 22 | #endif 23 | return version; 24 | #endif 25 | } 26 | } // namespace detectron2 27 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/layers/rotated_boxes.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from __future__ import absolute_import, division, print_function, unicode_literals 3 | import torch 4 | 5 | 6 | def pairwise_iou_rotated(boxes1, boxes2): 7 | """ 8 | Return intersection-over-union (Jaccard index) of boxes. 9 | 10 | Both sets of boxes are expected to be in 11 | (x_center, y_center, width, height, angle) format. 12 | 13 | Arguments: 14 | boxes1 (Tensor[N, 5]) 15 | boxes2 (Tensor[M, 5]) 16 | 17 | Returns: 18 | iou (Tensor[N, M]): the NxM matrix containing the pairwise 19 | IoU values for every element in boxes1 and boxes2 20 | """ 21 | return torch.ops.detectron2.box_iou_rotated(boxes1, boxes2) 22 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/layers/shape_spec.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | from collections import namedtuple 4 | 5 | 6 | class ShapeSpec(namedtuple("_ShapeSpec", ["channels", "height", "width", "stride"])): 7 | """ 8 | A simple structure that contains basic shape specification about a tensor. 9 | It is often used as the auxiliary inputs/outputs of models, 10 | to complement the lack of shape inference ability among pytorch modules. 11 | 12 | Attributes: 13 | channels: 14 | height: 15 | width: 16 | stride: 17 | """ 18 | 19 | def __new__(cls, channels=None, height=None, width=None, stride=None): 20 | return super().__new__(cls, channels, height, width, stride) 21 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/modeling/backbone/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from .build import build_backbone, BACKBONE_REGISTRY # noqa F401 isort:skip 3 | 4 | from .backbone import Backbone 5 | from .fpn import FPN 6 | from .regnet import RegNet 7 | from .resnet import ( 8 | BasicStem, 9 | ResNet, 10 | ResNetBlockBase, 11 | build_resnet_backbone, 12 | make_stage, 13 | BottleneckBlock, 14 | ) 15 | 16 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 17 | # TODO can expose more resnet blocks after careful consideration 18 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/modeling/meta_arch/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | 4 | from .build import META_ARCH_REGISTRY, build_model # isort:skip 5 | 6 | from .panoptic_fpn import PanopticFPN 7 | 8 | # import all the meta_arch, so they will be registered 9 | from .rcnn import GeneralizedRCNN, ProposalNetwork 10 | from .dense_detector import DenseDetector 11 | from .retinanet import RetinaNet 12 | from .fcos import FCOS 13 | from .semantic_seg import SEM_SEG_HEADS_REGISTRY, SemanticSegmentor, build_sem_seg_head 14 | 15 | 16 | __all__ = list(globals().keys()) 17 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/modeling/meta_arch/build.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | import torch 3 | 4 | from detectron2.utils.logger import _log_api_usage 5 | from detectron2.utils.registry import Registry 6 | 7 | META_ARCH_REGISTRY = Registry("META_ARCH") # noqa F401 isort:skip 8 | META_ARCH_REGISTRY.__doc__ = """ 9 | Registry for meta-architectures, i.e. the whole model. 10 | 11 | The registered object will be called with `obj(cfg)` 12 | and expected to return a `nn.Module` object. 13 | """ 14 | 15 | 16 | def build_model(cfg): 17 | """ 18 | Build the whole model architecture, defined by ``cfg.MODEL.META_ARCHITECTURE``. 19 | Note that it does not load any weights from ``cfg``. 20 | """ 21 | meta_arch = cfg.MODEL.META_ARCHITECTURE 22 | model = META_ARCH_REGISTRY.get(meta_arch)(cfg) 23 | model.to(torch.device(cfg.MODEL.DEVICE)) 24 | _log_api_usage("modeling.meta_arch." + meta_arch) 25 | return model 26 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/modeling/proposal_generator/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from .build import PROPOSAL_GENERATOR_REGISTRY, build_proposal_generator 3 | from .rpn import RPN_HEAD_REGISTRY, build_rpn_head, RPN, StandardRPNHead 4 | 5 | __all__ = list(globals().keys()) 6 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/modeling/roi_heads/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from .box_head import ROI_BOX_HEAD_REGISTRY, build_box_head, FastRCNNConvFCHead 3 | from .keypoint_head import ( 4 | ROI_KEYPOINT_HEAD_REGISTRY, 5 | build_keypoint_head, 6 | BaseKeypointRCNNHead, 7 | KRCNNConvDeconvUpsampleHead, 8 | ) 9 | from .mask_head import ( 10 | ROI_MASK_HEAD_REGISTRY, 11 | build_mask_head, 12 | BaseMaskRCNNHead, 13 | MaskRCNNConvUpsampleHead, 14 | ) 15 | from .roi_heads import ( 16 | ROI_HEADS_REGISTRY, 17 | ROIHeads, 18 | Res5ROIHeads, 19 | StandardROIHeads, 20 | build_roi_heads, 21 | select_foreground_proposals, 22 | ) 23 | from .cascade_rcnn import CascadeROIHeads 24 | from .rotated_fast_rcnn import RROIHeads 25 | from .fast_rcnn import FastRCNNOutputLayers 26 | 27 | from . import cascade_rcnn # isort:skip 28 | 29 | __all__ = list(globals().keys()) 30 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/projects/README.md: -------------------------------------------------------------------------------- 1 | 2 | Projects live in the [`projects` directory](../../projects) under the root of this repository, but not here. 3 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/solver/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from .build import build_lr_scheduler, build_optimizer, get_default_optimizer_params 3 | from .lr_scheduler import WarmupCosineLR, WarmupMultiStepLR, LRMultiplier, WarmupParamScheduler 4 | 5 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 6 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/structures/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from .boxes import Boxes, BoxMode, pairwise_iou, pairwise_ioa, pairwise_point_box_distance 3 | from .image_list import ImageList 4 | 5 | from .instances import Instances 6 | from .keypoints import Keypoints, heatmaps_to_keypoints 7 | from .masks import BitMasks, PolygonMasks, polygons_to_bitmask, ROIMasks 8 | from .rotated_boxes import RotatedBoxes 9 | from .rotated_boxes import pairwise_iou as pairwise_iou_rotated 10 | 11 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 12 | 13 | 14 | from detectron2.utils.env import fixup_module_metadata 15 | 16 | fixup_module_metadata(__name__, globals(), __all__) 17 | del fixup_module_metadata 18 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/utils/README.md: -------------------------------------------------------------------------------- 1 | # Utility functions 2 | 3 | This folder contain utility functions that are not used in the 4 | core library, but are useful for building models or training 5 | code using the config system. 6 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/detectron2/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/dev/README.md: -------------------------------------------------------------------------------- 1 | 2 | ## Some scripts for developers to use, include: 3 | 4 | - `linter.sh`: lint the codebase before commit. 5 | - `run_{inference,instant}_tests.sh`: run inference/training for a few iterations. 6 | Note that these tests require 2 GPUs. 7 | - `parse_results.sh`: parse results from a log file. 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/dev/packaging/README.md: -------------------------------------------------------------------------------- 1 | 2 | ## To build a cu101 wheel for release: 3 | 4 | ``` 5 | $ nvidia-docker run -it --storage-opt "size=20GB" --name pt pytorch/manylinux-cuda101 6 | # inside the container: 7 | # git clone https://github.com/facebookresearch/detectron2/ 8 | # cd detectron2 9 | # export CU_VERSION=cu101 D2_VERSION_SUFFIX= PYTHON_VERSION=3.7 PYTORCH_VERSION=1.8 10 | # ./dev/packaging/build_wheel.sh 11 | ``` 12 | 13 | ## To build all wheels for combinations of CUDA and Python 14 | ``` 15 | ./dev/packaging/build_all_wheels.sh 16 | ./dev/packaging/gen_wheel_index.sh /path/to/wheels 17 | ``` 18 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2.3" 2 | services: 3 | detectron2: 4 | build: 5 | context: . 6 | dockerfile: Dockerfile 7 | args: 8 | USER_ID: ${USER_ID:-1000} 9 | deploy: 10 | resources: 11 | reservations: 12 | devices: 13 | - capabilities: 14 | - gpu 15 | shm_size: "8gb" 16 | ulimits: 17 | memlock: -1 18 | stack: 67108864 19 | volumes: 20 | - /tmp/.X11-unix:/tmp/.X11-unix:ro 21 | environment: 22 | - DISPLAY=$DISPLAY 23 | - NVIDIA_VISIBLE_DEVICES=all 24 | # Uncomment with proper source to access webcam from docker 25 | # devices: 26 | # - /dev/video0:/dev/video0 27 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/.gitignore: -------------------------------------------------------------------------------- 1 | _build 2 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SOURCEDIR = . 8 | BUILDDIR = _build 9 | 10 | # Put it first so that "make" without argument is like "make help". 11 | help: 12 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 13 | 14 | .PHONY: help Makefile 15 | 16 | # Catch-all target: route all unknown targets to Sphinx using the new 17 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 18 | %: Makefile 19 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 20 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/README.md: -------------------------------------------------------------------------------- 1 | # Read the docs: 2 | 3 | The latest documentation built from this directory is available at [detectron2.readthedocs.io](https://detectron2.readthedocs.io/). 4 | Documents in this directory are not meant to be read on github. 5 | 6 | # Build the docs: 7 | 8 | 1. Install detectron2 according to [INSTALL.md](../INSTALL.md). 9 | 2. Install additional libraries required to build docs: 10 | - docutils==0.16 11 | - Sphinx==3.2.0 12 | - recommonmark==0.6.0 13 | - sphinx_rtd_theme 14 | 15 | 3. Run `make html` from this directory. 16 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/_static/css/custom.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * some extra css to make markdown look similar between github/sphinx 4 | */ 5 | 6 | /* 7 | * Below is for install.md: 8 | */ 9 | .rst-content code { 10 | white-space: pre; 11 | border: 0px; 12 | } 13 | 14 | .rst-content th { 15 | border: 1px solid #e1e4e5; 16 | } 17 | 18 | .rst-content th p { 19 | /* otherwise will be default 24px for regular paragraph */ 20 | margin-bottom: 0px; 21 | } 22 | 23 | .rst-content .line-block { 24 | /* otherwise will be 24px */ 25 | margin-bottom: 0px; 26 | } 27 | 28 | div.section > details { 29 | padding-bottom: 1em; 30 | } 31 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/index.rst: -------------------------------------------------------------------------------- 1 | .. detectron2 documentation master file, created by 2 | sphinx-quickstart on Sat Sep 21 13:46:45 2019. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to detectron2's documentation! 7 | ====================================== 8 | 9 | .. toctree:: 10 | :maxdepth: 2 11 | 12 | tutorials/index 13 | notes/index 14 | modules/index 15 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/modules/checkpoint.rst: -------------------------------------------------------------------------------- 1 | detectron2.checkpoint 2 | ============================= 3 | 4 | .. automodule:: detectron2.checkpoint 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/modules/config.rst: -------------------------------------------------------------------------------- 1 | detectron2.config 2 | ========================= 3 | 4 | Related tutorials: :doc:`../tutorials/configs`, :doc:`../tutorials/extend`. 5 | 6 | .. automodule:: detectron2.config 7 | :members: 8 | :undoc-members: 9 | :show-inheritance: 10 | 11 | 12 | Yaml Config References 13 | ----------------- 14 | 15 | .. literalinclude:: ../../detectron2/config/defaults.py 16 | :language: python 17 | :linenos: 18 | :lines: 7- 19 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/modules/data_transforms.rst: -------------------------------------------------------------------------------- 1 | detectron2.data.transforms 2 | ==================================== 3 | 4 | Related tutorial: :doc:`../tutorials/augmentation`. 5 | 6 | .. automodule:: detectron2.data.transforms 7 | :members: 8 | :undoc-members: 9 | :show-inheritance: 10 | :imported-members: 11 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/modules/engine.rst: -------------------------------------------------------------------------------- 1 | detectron2.engine 2 | ========================= 3 | 4 | Related tutorial: :doc:`../tutorials/training`. 5 | 6 | .. automodule:: detectron2.engine 7 | :members: 8 | :undoc-members: 9 | :show-inheritance: 10 | 11 | 12 | detectron2.engine.defaults module 13 | --------------------------------- 14 | 15 | .. automodule:: detectron2.engine.defaults 16 | :members: 17 | :undoc-members: 18 | :show-inheritance: 19 | 20 | detectron2.engine.hooks module 21 | --------------------------------- 22 | 23 | .. automodule:: detectron2.engine.hooks 24 | :members: 25 | :undoc-members: 26 | :show-inheritance: 27 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/modules/evaluation.rst: -------------------------------------------------------------------------------- 1 | detectron2.evaluation 2 | ============================= 3 | 4 | .. automodule:: detectron2.evaluation 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/modules/export.rst: -------------------------------------------------------------------------------- 1 | detectron2.export 2 | ========================= 3 | 4 | Related tutorial: :doc:`../tutorials/deployment`. 5 | 6 | .. automodule:: detectron2.export 7 | :members: 8 | :undoc-members: 9 | :show-inheritance: 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/modules/index.rst: -------------------------------------------------------------------------------- 1 | API Documentation 2 | ================== 3 | 4 | .. toctree:: 5 | 6 | checkpoint 7 | config 8 | data 9 | data_transforms 10 | engine 11 | evaluation 12 | layers 13 | model_zoo 14 | modeling 15 | solver 16 | structures 17 | utils 18 | export 19 | fvcore 20 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/modules/layers.rst: -------------------------------------------------------------------------------- 1 | detectron2.layers 2 | ========================= 3 | 4 | .. automodule:: detectron2.layers 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/modules/model_zoo.rst: -------------------------------------------------------------------------------- 1 | detectron2.model_zoo 2 | ============================ 3 | 4 | .. automodule:: detectron2.model_zoo 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/modules/solver.rst: -------------------------------------------------------------------------------- 1 | detectron2.solver 2 | ========================= 3 | 4 | .. automodule:: detectron2.solver 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/modules/structures.rst: -------------------------------------------------------------------------------- 1 | detectron2.structures 2 | ============================= 3 | 4 | .. automodule:: detectron2.structures 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/notes/contributing.md: -------------------------------------------------------------------------------- 1 | ../../.github/CONTRIBUTING.md -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/notes/index.rst: -------------------------------------------------------------------------------- 1 | Notes 2 | ====================================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | benchmarks 8 | compatibility 9 | contributing 10 | changelog 11 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/requirements.txt: -------------------------------------------------------------------------------- 1 | docutils==0.16 2 | # https://github.com/sphinx-doc/sphinx/commit/7acd3ada3f38076af7b2b5c9f3b60bb9c2587a3d 3 | sphinx==3.2.0 4 | recommonmark==0.6.0 5 | sphinx_rtd_theme 6 | # Dependencies here are only those required by import 7 | termcolor 8 | numpy 9 | tqdm 10 | matplotlib 11 | termcolor 12 | yacs 13 | tabulate 14 | cloudpickle 15 | Pillow 16 | future 17 | git+git://github.com/facebookresearch/fvcore.git 18 | https://download.pytorch.org/whl/cpu/torch-1.8.1%2Bcpu-cp37-cp37m-linux_x86_64.whl 19 | https://download.pytorch.org/whl/cpu/torchvision-0.9.1%2Bcpu-cp37-cp37m-linux_x86_64.whl 20 | omegaconf>=2.1.0.dev24 21 | hydra-core>=1.1.0.dev5 22 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/tutorials/README.md: -------------------------------------------------------------------------------- 1 | # Read the docs: 2 | 3 | The latest documentation built from this directory is available at [detectron2.readthedocs.io](https://detectron2.readthedocs.io/). 4 | Documents in this directory are not meant to be read on github. 5 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/tutorials/builtin_datasets.md: -------------------------------------------------------------------------------- 1 | ../../datasets/README.md -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/tutorials/getting_started.md: -------------------------------------------------------------------------------- 1 | ../../GETTING_STARTED.md -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/tutorials/index.rst: -------------------------------------------------------------------------------- 1 | Tutorials 2 | ====================================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | install 8 | getting_started 9 | builtin_datasets 10 | extend 11 | datasets 12 | data_loading 13 | augmentation 14 | models 15 | write-models 16 | training 17 | evaluation 18 | configs 19 | lazyconfigs 20 | deployment 21 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/docs/tutorials/install.md: -------------------------------------------------------------------------------- 1 | ../../INSTALL.md -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/.gitignore: -------------------------------------------------------------------------------- 1 | # compilation and distribution 2 | __pycache__ 3 | _ext 4 | *.pyc 5 | *.pyd 6 | *.so 7 | centernet.egg-info/ 8 | build/ 9 | dist/ 10 | wheels/ 11 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/centernet/__init__.py: -------------------------------------------------------------------------------- 1 | from .modeling.meta_arch.centernet_detector import CenterNetDetector 2 | from .modeling.dense_heads.centernet import CenterNet 3 | from .modeling.roi_heads.custom_roi_heads import CustomROIHeads, CustomCascadeROIHeads 4 | 5 | from .modeling.backbone.fpn_p5 import build_p67_resnet_fpn_backbone 6 | from .modeling.backbone.dla import build_dla_backbone 7 | from .modeling.backbone.dlafpn import build_dla_fpn3_backbone 8 | from .modeling.backbone.bifpn import build_resnet_bifpn_backbone 9 | from .modeling.backbone.bifpn_fcos import build_fcos_resnet_bifpn_backbone 10 | from .modeling.backbone.res2net import build_p67_res2net_fpn_backbone 11 | 12 | from .data.datasets.objects365 import categories_v1 13 | from .data.datasets.coco import _PREDEFINED_SPLITS_COCO 14 | from .data.datasets import nuimages 15 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/configs/Base-CenterNet-FPN.yaml: -------------------------------------------------------------------------------- 1 | MODEL: 2 | META_ARCHITECTURE: "CenterNetDetector" 3 | PROPOSAL_GENERATOR: 4 | NAME: "CenterNet" 5 | BACKBONE: 6 | NAME: "build_p67_resnet_fpn_backbone" 7 | WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" 8 | RESNETS: 9 | DEPTH: 50 10 | OUT_FEATURES: ["res3", "res4", "res5"] 11 | FPN: 12 | IN_FEATURES: ["res3", "res4", "res5"] 13 | DATASETS: 14 | TRAIN: ("coco_2017_train",) 15 | TEST: ("coco_2017_val",) 16 | SOLVER: 17 | IMS_PER_BATCH: 16 18 | BASE_LR: 0.01 19 | STEPS: (60000, 80000) 20 | MAX_ITER: 90000 21 | CHECKPOINT_PERIOD: 1000000000 22 | WARMUP_ITERS: 4000 23 | WARMUP_FACTOR: 0.00025 24 | CLIP_GRADIENTS: 25 | ENABLED: True 26 | INPUT: 27 | MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) 28 | OUTPUT_DIR: "./output/CenterNet2/auto" 29 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/configs/CenterNet-FPN_R50_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-CenterNet-FPN.yaml" 2 | MODEL: 3 | CENTERNET: 4 | MORE_POS: True -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/configs/CenterNet-S4_DLA_8x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base_S4_DLA.yaml" 2 | SOLVER: 3 | MAX_ITER: 90000 4 | BASE_LR: 0.08 5 | IMS_PER_BATCH: 128 -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/configs/CenterNet2-F_R50_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-CenterNet2.yaml" 2 | MODEL: 3 | ROI_HEADS: 4 | NAME: CustomROIHeads -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/configs/CenterNet2_DLA-BiFPN-P5_640_16x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-CenterNet2.yaml" 2 | MODEL: 3 | BACKBONE: 4 | NAME: "build_p37_dla_bifpn_backbone" 5 | BIFPN: 6 | OUT_CHANNELS: 160 7 | NUM_LEVELS: 5 8 | NUM_BIFPN: 3 9 | CENTERNET: 10 | POST_NMS_TOPK_TEST: 128 11 | WEIGHTS: '' 12 | PIXEL_MEAN: [123.675, 116.280, 103.530] 13 | PIXEL_STD: [58.395, 57.12, 57.375] 14 | FPN: 15 | IN_FEATURES: ["dla3", "dla4", "dla5"] 16 | SOLVER: 17 | LR_SCHEDULER_NAME: "WarmupCosineLR" 18 | MAX_ITER: 360000 19 | BASE_LR: 0.08 20 | IMS_PER_BATCH: 64 21 | CHECKPOINT_PERIOD: 90000 22 | TEST: 23 | EVAL_PERIOD: 7500 24 | INPUT: 25 | FORMAT: RGB 26 | CUSTOM_AUG: EfficientDetResizeCrop 27 | TRAIN_SIZE: 640 28 | MIN_SIZE_TEST: 608 29 | MAX_SIZE_TEST: 900 30 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/configs/CenterNet2_DLA-BiFPN-P5_640_16x_ST.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-CenterNet2.yaml" 2 | MODEL: 3 | BACKBONE: 4 | NAME: "build_p37_dla_bifpn_backbone" 5 | BIFPN: 6 | OUT_CHANNELS: 160 7 | NUM_LEVELS: 5 8 | NUM_BIFPN: 3 9 | CENTERNET: 10 | POST_NMS_TOPK_TEST: 128 11 | WEIGHTS: '' 12 | PIXEL_MEAN: [123.675, 116.280, 103.530] 13 | PIXEL_STD: [58.395, 57.12, 57.375] 14 | FPN: 15 | IN_FEATURES: ["dla3", "dla4", "dla5"] 16 | SOLVER: 17 | LR_SCHEDULER_NAME: "WarmupCosineLR" 18 | MAX_ITER: 360000 19 | BASE_LR: 0.08 20 | IMS_PER_BATCH: 64 21 | TEST: 22 | EVAL_PERIOD: 7500 23 | INPUT: 24 | FORMAT: RGB 25 | CUSTOM_AUG: EfficientDetResizeCrop 26 | TRAIN_SIZE: 640 27 | MIN_SIZE_TEST: 608 28 | MAX_SIZE_TEST: 900 29 | DATASETS: 30 | TRAIN: ("coco_2017_train","coco_un_yolov4_55_0.5",) 31 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/configs/CenterNet2_DLA-fcosBiFPN-P5_640_16x_ST.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-CenterNet2.yaml" 2 | MODEL: 3 | BACKBONE: 4 | NAME: "build_p37_fcos_dla_bifpn_backbone" 5 | BIFPN: 6 | OUT_CHANNELS: 160 7 | NUM_LEVELS: 5 8 | NUM_BIFPN: 3 9 | CENTERNET: 10 | POST_NMS_TOPK_TEST: 128 11 | WEIGHTS: '' 12 | PIXEL_MEAN: [123.675, 116.280, 103.530] 13 | PIXEL_STD: [58.395, 57.12, 57.375] 14 | FPN: 15 | IN_FEATURES: ["dla3", "dla4", "dla5"] 16 | TEST: 17 | EVAL_PERIOD: 7500 18 | SOLVER: 19 | LR_SCHEDULER_NAME: "WarmupCosineLR" 20 | MAX_ITER: 360000 21 | BASE_LR: 0.08 22 | IMS_PER_BATCH: 64 23 | INPUT: 24 | FORMAT: RGB 25 | CUSTOM_AUG: EfficientDetResizeCrop 26 | TRAIN_SIZE: 640 27 | MIN_SIZE_TEST: 608 28 | MAX_SIZE_TEST: 900 29 | DATASETS: 30 | TRAIN: ("coco_2017_train","coco_un_yolov4_55_0.5",) 31 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/configs/CenterNet2_R2-101-DCN-BiFPN_1280_4x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-CenterNet2.yaml" 2 | MODEL: 3 | BACKBONE: 4 | NAME: "build_res2net_bifpn_backbone" 5 | BIFPN: 6 | NUM_BIFPN: 7 7 | OUT_CHANNELS: 288 8 | WEIGHTS: "output/r2_101.pkl" 9 | RESNETS: 10 | DEPTH: 101 11 | WIDTH_PER_GROUP: 26 12 | DEFORM_ON_PER_STAGE: [False, False, True, True] # on Res4, Res5 13 | DEFORM_MODULATED: True 14 | PIXEL_MEAN: [123.675, 116.280, 103.530] 15 | PIXEL_STD: [58.395, 57.12, 57.375] 16 | CENTERNET: 17 | USE_DEFORMABLE: True 18 | ROI_HEADS: 19 | IN_FEATURES: ["p3", "p4"] 20 | INPUT: 21 | FORMAT: RGB 22 | TEST: 23 | EVAL_PERIOD: 7500 24 | SOLVER: 25 | MAX_ITER: 180000 26 | CHECKPOINT_PERIOD: 60000 27 | LR_SCHEDULER_NAME: "WarmupCosineLR" 28 | BASE_LR: 0.04 29 | IMS_PER_BATCH: 32 30 | INPUT: 31 | CUSTOM_AUG: EfficientDetResizeCrop 32 | TRAIN_SIZE: 1280 33 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/configs/CenterNet2_R2-101-DCN_896_4x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-CenterNet2.yaml" 2 | MODEL: 3 | BACKBONE: 4 | NAME: "build_p67_res2net_fpn_backbone" 5 | WEIGHTS: "output/r2_101.pkl" 6 | RESNETS: 7 | DEPTH: 101 8 | WIDTH_PER_GROUP: 26 9 | DEFORM_ON_PER_STAGE: [False, False, True, True] # on Res4, Res5 10 | DEFORM_MODULATED: True 11 | PIXEL_MEAN: [123.675, 116.280, 103.530] 12 | PIXEL_STD: [58.395, 57.12, 57.375] 13 | CENTERNET: 14 | USE_DEFORMABLE: True 15 | ROI_HEADS: 16 | IN_FEATURES: ["p3", "p4"] 17 | INPUT: 18 | FORMAT: RGB 19 | TEST: 20 | EVAL_PERIOD: 7500 21 | SOLVER: 22 | MAX_ITER: 180000 23 | CHECKPOINT_PERIOD: 600000 24 | LR_SCHEDULER_NAME: "WarmupCosineLR" 25 | BASE_LR: 0.04 26 | IMS_PER_BATCH: 32 27 | INPUT: 28 | CUSTOM_AUG: EfficientDetResizeCrop 29 | TRAIN_SIZE: 896 -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/configs/CenterNet2_R50_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-CenterNet2.yaml" 2 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/configs/CenterNet2_X101-DCN_2x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-CenterNet2.yaml" 2 | MODEL: 3 | CENTERNET: 4 | USE_DEFORMABLE: True 5 | WEIGHTS: "detectron2://ImageNetPretrained/FAIR/X-101-32x8d.pkl" 6 | PIXEL_STD: [57.375, 57.120, 58.395] 7 | RESNETS: 8 | STRIDE_IN_1X1: False 9 | NUM_GROUPS: 32 10 | WIDTH_PER_GROUP: 8 11 | DEPTH: 101 12 | DEFORM_ON_PER_STAGE: [False, False, True, True] # on Res4, Res5 13 | DEFORM_MODULATED: True 14 | ROI_HEADS: 15 | IN_FEATURES: ["p3", "p4"] 16 | SOLVER: 17 | STEPS: (120000, 160000) 18 | MAX_ITER: 180000 19 | CHECKPOINT_PERIOD: 40000 20 | INPUT: 21 | MIN_SIZE_TRAIN: (480, 960) 22 | MIN_SIZE_TRAIN_SAMPLING: "range" 23 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/configs/LVIS_CenterNet2_R50_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-CenterNet2.yaml" 2 | MODEL: 3 | ROI_HEADS: 4 | NUM_CLASSES: 1203 5 | SCORE_THRESH_TEST: 0.02 6 | NMS_THRESH_TEST: 0.5 7 | CENTERNET: 8 | NUM_CLASSES: 1203 9 | 10 | DATASETS: 11 | TRAIN: ("lvis_v1_train",) 12 | TEST: ("lvis_v1_val",) 13 | DATALOADER: 14 | SAMPLER_TRAIN: "RepeatFactorTrainingSampler" 15 | REPEAT_THRESHOLD: 0.001 16 | TEST: 17 | DETECTIONS_PER_IMAGE: 300 18 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/configs/LVIS_CenterNet2_R50_Fed_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-CenterNet2.yaml" 2 | MODEL: 3 | ROI_HEADS: 4 | NUM_CLASSES: 1203 5 | SCORE_THRESH_TEST: 0.02 6 | NMS_THRESH_TEST: 0.5 7 | CENTERNET: 8 | NUM_CLASSES: 1203 9 | ROI_BOX_HEAD: 10 | USE_SIGMOID_CE: True 11 | USE_FED_LOSS: True 12 | DATASETS: 13 | TRAIN: ("lvis_v1_train",) 14 | TEST: ("lvis_v1_val",) 15 | DATALOADER: 16 | SAMPLER_TRAIN: "RepeatFactorTrainingSampler" 17 | REPEAT_THRESHOLD: 0.001 18 | TEST: 19 | DETECTIONS_PER_IMAGE: 300 20 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/projects/CenterNet2/configs/O365_CenterNet2_R50_1x.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "Base-CenterNet2.yaml" 2 | MODEL: 3 | ROI_HEADS: 4 | NUM_CLASSES: 365 5 | CENTERNET: 6 | NUM_CLASSES: 365 7 | DATASETS: 8 | TRAIN: ("objects365_train",) 9 | TEST: ("objects365_val",) 10 | DATALOADER: 11 | SAMPLER_TRAIN: "ClassAwareSampler" 12 | TEST: 13 | DETECTIONS_PER_IMAGE: 300 -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/tests/README.md: -------------------------------------------------------------------------------- 1 | ## Unit Tests 2 | 3 | To run the unittests, do: 4 | ``` 5 | cd detectron2 6 | python -m unittest discover -v -s ./tests 7 | ``` 8 | 9 | There are also end-to-end inference & training tests, in [dev/run_*_tests.sh](../dev). 10 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/tests/config/dir1/dir1_a.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | dir1a_str = "base_a_1" 3 | dir1a_dict = {"a": 1, "b": 2} 4 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/tests/config/dir1/dir1_b.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from detectron2.config import LazyConfig 3 | 4 | # equivalent to relative import 5 | dir1a_str, dir1a_dict = LazyConfig.load_rel("dir1_a.py", ("dir1a_str", "dir1a_dict")) 6 | 7 | dir1b_str = dir1a_str + "_from_b" 8 | dir1b_dict = dir1a_dict 9 | 10 | # Every import is a reload: not modified by other config files 11 | assert dir1a_dict.a == 1 12 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/tests/config/root_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | from itertools import count 3 | 4 | from detectron2.config import LazyCall as L 5 | 6 | from .dir1.dir1_a import dir1a_dict, dir1a_str 7 | 8 | dir1a_dict.a = "modified" 9 | 10 | # modification above won't affect future imports 11 | from .dir1.dir1_b import dir1b_dict, dir1b_str 12 | 13 | 14 | lazyobj = L(count)(x=dir1a_str, y=dir1b_str) 15 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/tests/data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/grit_src/third_party/CenterNet2/tests/data/__init__.py -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/tests/layers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/grit_src/third_party/CenterNet2/tests/layers/__init__.py -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/tests/modeling/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/grit_src/third_party/CenterNet2/tests/modeling/__init__.py -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/tests/structures/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/grit_src/third_party/CenterNet2/tests/structures/__init__.py -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/tests/structures/test_keypoints.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | import unittest 3 | import torch 4 | 5 | from detectron2.structures.keypoints import Keypoints 6 | 7 | 8 | class TestKeypoints(unittest.TestCase): 9 | def test_cat_keypoints(self): 10 | keypoints1 = Keypoints(torch.rand(2, 21, 3)) 11 | keypoints2 = Keypoints(torch.rand(4, 21, 3)) 12 | 13 | cat_keypoints = keypoints1.cat([keypoints1, keypoints2]) 14 | self.assertTrue(torch.all(cat_keypoints.tensor[:2] == keypoints1.tensor).item()) 15 | self.assertTrue(torch.all(cat_keypoints.tensor[2:] == keypoints2.tensor).item()) 16 | 17 | 18 | if __name__ == "__main__": 19 | unittest.main() 20 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/tests/test_packaging.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | import unittest 3 | 4 | from detectron2.utils.collect_env import collect_env_info 5 | 6 | 7 | class TestProjects(unittest.TestCase): 8 | def test_import(self): 9 | from detectron2.projects import point_rend 10 | 11 | _ = point_rend.add_pointrend_config 12 | 13 | import detectron2.projects.deeplab as deeplab 14 | 15 | _ = deeplab.add_deeplab_config 16 | 17 | # import detectron2.projects.panoptic_deeplab as panoptic_deeplab 18 | 19 | # _ = panoptic_deeplab.add_panoptic_deeplab_config 20 | 21 | 22 | class TestCollectEnv(unittest.TestCase): 23 | def test(self): 24 | _ = collect_env_info() 25 | -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/tools/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/grit_src/third_party/CenterNet2/tools/__init__.py -------------------------------------------------------------------------------- /iGPT/models/grit_src/third_party/CenterNet2/tools/deploy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # See https://pytorch.org/tutorials/advanced/cpp_frontend.html 3 | cmake_minimum_required(VERSION 3.12 FATAL_ERROR) 4 | project(torchscript_mask_rcnn) 5 | 6 | find_package(Torch REQUIRED) 7 | find_package(OpenCV REQUIRED) 8 | find_package(TorchVision REQUIRED) # needed by export-method=tracing/scripting 9 | 10 | add_executable(torchscript_mask_rcnn torchscript_mask_rcnn.cpp) 11 | target_link_libraries( 12 | torchscript_mask_rcnn 13 | -Wl,--no-as-needed TorchVision::TorchVision -Wl,--as-needed 14 | "${TORCH_LIBRARIES}" ${OpenCV_LIBS}) 15 | set_property(TARGET torchscript_mask_rcnn PROPERTY CXX_STANDARD 14) 16 | -------------------------------------------------------------------------------- /iGPT/models/imagebind/__init__.py: -------------------------------------------------------------------------------- 1 | from .data import load_and_transform_text, load_and_transform_audio_data, load_and_transform_video_data, load_and_transform_vision_data, load_and_transform_thermal_data 2 | from .models.imagebind_model import imagebind_huge, ModalityType -------------------------------------------------------------------------------- /iGPT/models/imagebind/bpe/bpe_simple_vocab_16e6.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/imagebind/bpe/bpe_simple_vocab_16e6.txt.gz -------------------------------------------------------------------------------- /iGPT/models/imagebind/models/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/imagebind/models/__init__.py -------------------------------------------------------------------------------- /iGPT/models/inpainting_src/__init__.py: -------------------------------------------------------------------------------- 1 | from .ldm_inpainting import LDMInpainter -------------------------------------------------------------------------------- /iGPT/models/inpainting_src/ldm_inpainting/__init__.py: -------------------------------------------------------------------------------- 1 | from .wrapper import LDMInpainter -------------------------------------------------------------------------------- /iGPT/models/inpainting_src/ldm_inpainting/ldm/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/inpainting_src/ldm_inpainting/ldm/__init__.py -------------------------------------------------------------------------------- /iGPT/models/inpainting_src/ldm_inpainting/ldm/models/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/inpainting_src/ldm_inpainting/ldm/models/__init__.py -------------------------------------------------------------------------------- /iGPT/models/inpainting_src/ldm_inpainting/ldm/models/diffusion/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/inpainting_src/ldm_inpainting/ldm/models/diffusion/__init__.py -------------------------------------------------------------------------------- /iGPT/models/inpainting_src/ldm_inpainting/ldm/modules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/inpainting_src/ldm_inpainting/ldm/modules/__init__.py -------------------------------------------------------------------------------- /iGPT/models/inpainting_src/ldm_inpainting/ldm/modules/diffusionmodules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/inpainting_src/ldm_inpainting/ldm/modules/diffusionmodules/__init__.py -------------------------------------------------------------------------------- /iGPT/models/inpainting_src/ldm_inpainting/ldm/modules/distributions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/inpainting_src/ldm_inpainting/ldm/modules/distributions/__init__.py -------------------------------------------------------------------------------- /iGPT/models/inpainting_src/ldm_inpainting/ldm/modules/encoders/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/inpainting_src/ldm_inpainting/ldm/modules/encoders/__init__.py -------------------------------------------------------------------------------- /iGPT/models/inpainting_src/ldm_inpainting/ldm/modules/image_degradation/__init__.py: -------------------------------------------------------------------------------- 1 | from ldm.modules.image_degradation.bsrgan import degradation_bsrgan_variant as degradation_fn_bsr 2 | from ldm.modules.image_degradation.bsrgan_light import degradation_bsrgan_variant as degradation_fn_bsr_light 3 | -------------------------------------------------------------------------------- /iGPT/models/inpainting_src/ldm_inpainting/ldm/modules/image_degradation/utils/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/iGPT/models/inpainting_src/ldm_inpainting/ldm/modules/image_degradation/utils/test.png -------------------------------------------------------------------------------- /iGPT/models/inpainting_src/ldm_inpainting/ldm/modules/losses/__init__.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | 3 | class DummyLoss(nn.Module): 4 | def __init__(self): 5 | super().__init__() -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | torch==1.13.0 2 | opencv-python==4.5.5.64 3 | Pillow==9.5.0 4 | openai-whisper==20230314 5 | gradio==3.28.1 6 | transformers==4.28.0 7 | diffusers==0.15.1 8 | controlnet_aux 9 | langchain==0.0.101 10 | decord==0.6.0 11 | openai==0.27.4 12 | ffmpeg-python==0.2.0 13 | fairscale==0.4.3 14 | lvis==0.5.3 15 | suno-bark 16 | easyocr==1.6.2 17 | easydict==1.9 18 | scikit-learn==0.24.2 19 | pytorch-lightning==1.5.10 20 | albumentations==0.5.2 21 | webdataset==0.2.48 22 | kornia==0.5.0 23 | sentencepiece==0.1.98 24 | accelerate==0.18.0 25 | timm==0.6.13 26 | git+https://github.com/facebookresearch/segment-anything.git 27 | wget 28 | protobuf==3.20 29 | pytorchvideo==0.1.5 30 | soundfile 31 | fvcore 32 | decord==0.6.0 33 | ftfy 34 | regex 35 | einops 36 | imageio-ffmpeg -------------------------------------------------------------------------------- /tests/test_anything2image.py: -------------------------------------------------------------------------------- 1 | import sys 2 | sys.path.append('../') 3 | import torch 4 | from iGPT.models import Audio2Image, Thermal2Image, AudioText2Image, AudioImage2Image 5 | 6 | 7 | def test_audio2image(): 8 | model = Audio2Image(torch.device('cuda')) 9 | model.inference('assets/audio/cat.wav') 10 | 11 | 12 | def test_thermal2image(): 13 | model = Thermal2Image(torch.device('cuda')) 14 | model.inference('assets/thermal/030444.jpg') 15 | -------------------------------------------------------------------------------- /third-party/lama/bin/mask_example.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | from skimage import io 3 | from skimage.transform import resize 4 | 5 | from saicinpainting.evaluation.masks.mask import SegmentationMask 6 | 7 | im = io.imread('imgs/ex4.jpg') 8 | im = resize(im, (512, 1024), anti_aliasing=True) 9 | mask_seg = SegmentationMask(num_variants_per_mask=10) 10 | mask_examples = mask_seg.get_masks(im) 11 | for i, example in enumerate(mask_examples): 12 | plt.imshow(example) 13 | plt.show() 14 | plt.imsave(f'tmp/img_masks/{i}.png', example) 15 | -------------------------------------------------------------------------------- /third-party/lama/bin/models/ade20k/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import * -------------------------------------------------------------------------------- /third-party/lama/bin/models/ade20k/color150.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/models/ade20k/color150.mat -------------------------------------------------------------------------------- /third-party/lama/bin/models/ade20k/segm_lib/nn/__init__.py: -------------------------------------------------------------------------------- 1 | from .modules import * 2 | from .parallel import UserScatteredDataParallel, user_scattered_collate, async_copy_to 3 | -------------------------------------------------------------------------------- /third-party/lama/bin/models/ade20k/segm_lib/nn/modules/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # File : __init__.py 3 | # Author : Jiayuan Mao 4 | # Email : maojiayuan@gmail.com 5 | # Date : 27/01/2018 6 | # 7 | # This file is part of Synchronized-BatchNorm-PyTorch. 8 | # https://github.com/vacancy/Synchronized-BatchNorm-PyTorch 9 | # Distributed under MIT License. 10 | 11 | from .batchnorm import SynchronizedBatchNorm1d, SynchronizedBatchNorm2d, SynchronizedBatchNorm3d 12 | from .replicate import DataParallelWithCallback, patch_replication_callback 13 | -------------------------------------------------------------------------------- /third-party/lama/bin/models/ade20k/segm_lib/nn/parallel/__init__.py: -------------------------------------------------------------------------------- 1 | from .data_parallel import UserScatteredDataParallel, user_scattered_collate, async_copy_to 2 | -------------------------------------------------------------------------------- /third-party/lama/bin/models/ade20k/segm_lib/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .th import * 2 | -------------------------------------------------------------------------------- /third-party/lama/bin/models/ade20k/segm_lib/utils/data/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | from .dataset import Dataset, TensorDataset, ConcatDataset 3 | from .dataloader import DataLoader 4 | -------------------------------------------------------------------------------- /third-party/lama/bin/models/lpips_models/alex.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/models/lpips_models/alex.pth -------------------------------------------------------------------------------- /third-party/lama/bin/models/lpips_models/squeeze.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/models/lpips_models/squeeze.pth -------------------------------------------------------------------------------- /third-party/lama/bin/models/lpips_models/vgg.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/models/lpips_models/vgg.pth -------------------------------------------------------------------------------- /third-party/lama/bin/paper_runfiles/env.sh: -------------------------------------------------------------------------------- 1 | DIRNAME="$(dirname $0)" 2 | DIRNAME="$(realpath ""$DIRNAME"")" 3 | 4 | BINDIR="$DIRNAME/.." 5 | SRCDIR="$BINDIR/.." 6 | CONFIGDIR="$SRCDIR/configs" 7 | 8 | export PYTHONPATH="$SRCDIR:$PYTHONPATH" 9 | -------------------------------------------------------------------------------- /third-party/lama/bin/paper_runfiles/generate_test_celeba-hq.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # paths to data are valid for mml-ws01 4 | OUT_DIR="/media/inpainting/paper_data/CelebA-HQ_val_test" 5 | 6 | source "$(dirname $0)/env.sh" 7 | 8 | for datadir in "val" "test" 9 | do 10 | for conf in random_thin_256 random_medium_256 random_thick_256 random_thin_512 random_medium_512 random_thick_512 11 | do 12 | "$BINDIR/gen_mask_dataset_hydra.py" -cn $conf datadir=$datadir location=mml-ws01-celeba-hq \ 13 | location.out_dir=$OUT_DIR cropping.out_square_crop=False 14 | 15 | "$BINDIR/calc_dataset_stats.py" --samples-n 20 "$OUT_DIR/$datadir/$conf" "$OUT_DIR/$datadir/${conf}_stats" 16 | done 17 | done 18 | -------------------------------------------------------------------------------- /third-party/lama/bin/paper_runfiles/generate_test_ffhq.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # paths to data are valid for mml-ws01 4 | OUT_DIR="/media/inpainting/paper_data/FFHQ_val" 5 | 6 | source "$(dirname $0)/env.sh" 7 | 8 | for datadir in test 9 | do 10 | for conf in random_thin_256 random_medium_256 random_thick_256 random_thin_512 random_medium_512 random_thick_512 11 | do 12 | "$BINDIR/gen_mask_dataset_hydra.py" -cn $conf datadir=$datadir location=mml-ws01-ffhq \ 13 | location.out_dir=$OUT_DIR cropping.out_square_crop=False 14 | 15 | "$BINDIR/calc_dataset_stats.py" --samples-n 20 "$OUT_DIR/$datadir/$conf" "$OUT_DIR/$datadir/${conf}_stats" 16 | done 17 | done 18 | -------------------------------------------------------------------------------- /third-party/lama/bin/paper_runfiles/generate_test_paris.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # paths to data are valid for mml-ws01 4 | OUT_DIR="/media/inpainting/paper_data/Paris_StreetView_Dataset_val" 5 | 6 | source "$(dirname $0)/env.sh" 7 | 8 | for datadir in paris_eval_gt 9 | do 10 | for conf in random_thin_256 random_medium_256 random_thick_256 segm_256 11 | do 12 | "$BINDIR/gen_mask_dataset_hydra.py" -cn $conf datadir=$datadir location=mml-ws01-paris \ 13 | location.out_dir=OUT_DIR cropping.out_square_crop=False cropping.out_min_size=227 14 | 15 | "$BINDIR/calc_dataset_stats.py" --samples-n 20 "$OUT_DIR/$datadir/$conf" "$OUT_DIR/$datadir/${conf}_stats" 16 | done 17 | done 18 | -------------------------------------------------------------------------------- /third-party/lama/bin/paper_runfiles/generate_test_paris_256.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # paths to data are valid for mml-ws01 4 | OUT_DIR="/media/inpainting/paper_data/Paris_StreetView_Dataset_val_256" 5 | 6 | source "$(dirname $0)/env.sh" 7 | 8 | for datadir in paris_eval_gt 9 | do 10 | for conf in random_thin_256 random_medium_256 random_thick_256 segm_256 11 | do 12 | "$BINDIR/gen_mask_dataset_hydra.py" -cn $conf datadir=$datadir location=mml-ws01-paris \ 13 | location.out_dir=$OUT_DIR cropping.out_square_crop=False cropping.out_min_size=256 14 | 15 | "$BINDIR/calc_dataset_stats.py" --samples-n 20 "$OUT_DIR/$datadir/$conf" "$OUT_DIR/$datadir/${conf}_stats" 16 | done 17 | done 18 | -------------------------------------------------------------------------------- /third-party/lama/bin/paper_runfiles/predict_inner_features.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # paths to data are valid for mml7 4 | 5 | source "$(dirname $0)/env.sh" 6 | 7 | "$BINDIR/predict_inner_features.py" \ 8 | -cn default_inner_features_ffc \ 9 | model.path="/data/inpainting/paper_data/final_models/ours/r.suvorov_2021-03-05_17-34-05_train_ablv2_work_ffc075_resume_epoch39" \ 10 | indir="/data/inpainting/paper_data/inner_features_vis/input/" \ 11 | outdir="/data/inpainting/paper_data/inner_features_vis/output/ffc" \ 12 | dataset.img_suffix=.png 13 | 14 | 15 | "$BINDIR/predict_inner_features.py" \ 16 | -cn default_inner_features_work \ 17 | model.path="/data/inpainting/paper_data/final_models/ours/r.suvorov_2021-03-05_17-08-35_train_ablv2_work_resume_epoch37" \ 18 | indir="/data/inpainting/paper_data/inner_features_vis/input/" \ 19 | outdir="/data/inpainting/paper_data/inner_features_vis/output/work" \ 20 | dataset.img_suffix=.png 21 | -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/__init__.py -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/losses/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/evaluation/losses/__init__.py -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/losses/fid/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/evaluation/losses/fid/__init__.py -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/masks/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/evaluation/masks/__init__.py -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/masks/countless/.gitignore: -------------------------------------------------------------------------------- 1 | results -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/masks/countless/README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/william-silversmith/countless.svg?branch=master)](https://travis-ci.org/william-silversmith/countless) 2 | 3 | Python COUNTLESS Downsampling 4 | ============================= 5 | 6 | To install: 7 | 8 | `pip install -r requirements.txt` 9 | 10 | To test: 11 | 12 | `python test.py` 13 | 14 | To benchmark countless2d: 15 | 16 | `python python/countless2d.py python/images/gray_segmentation.png` 17 | 18 | To benchmark countless3d: 19 | 20 | `python python/countless3d.py` 21 | 22 | Adjust N and the list of algorithms inside each script to modify the run parameters. 23 | 24 | 25 | Python3 is slightly faster than Python2. -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/masks/countless/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/evaluation/masks/countless/__init__.py -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/masks/countless/images/gcim.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/evaluation/masks/countless/images/gcim.jpg -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/masks/countless/images/gray_segmentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/evaluation/masks/countless/images/gray_segmentation.png -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/masks/countless/images/segmentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/evaluation/masks/countless/images/segmentation.png -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/masks/countless/images/sparse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/evaluation/masks/countless/images/sparse.png -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/masks/countless/memprof/countless2d_gcim_N_1000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/evaluation/masks/countless/memprof/countless2d_gcim_N_1000.png -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/masks/countless/memprof/countless2d_quick_gcim_N_1000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/evaluation/masks/countless/memprof/countless2d_quick_gcim_N_1000.png -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/masks/countless/memprof/countless3d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/evaluation/masks/countless/memprof/countless3d.png -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/masks/countless/memprof/countless3d_dynamic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/evaluation/masks/countless/memprof/countless3d_dynamic.png -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/masks/countless/memprof/countless3d_dynamic_generalized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/evaluation/masks/countless/memprof/countless3d_dynamic_generalized.png -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/masks/countless/memprof/countless3d_generalized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/evaluation/masks/countless/memprof/countless3d_generalized.png -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/masks/countless/requirements.txt: -------------------------------------------------------------------------------- 1 | Pillow>=6.2.0 2 | numpy>=1.16 3 | scipy 4 | tqdm 5 | memory_profiler 6 | six 7 | pytest -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/evaluation/utils.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | import yaml 4 | from easydict import EasyDict as edict 5 | import torch.nn as nn 6 | import torch 7 | 8 | 9 | def load_yaml(path): 10 | with open(path, 'r') as f: 11 | return edict(yaml.safe_load(f)) 12 | 13 | 14 | def move_to_device(obj, device): 15 | if isinstance(obj, nn.Module): 16 | return obj.to(device) 17 | if torch.is_tensor(obj): 18 | return obj.to(device) 19 | if isinstance(obj, (tuple, list)): 20 | return [move_to_device(el, device) for el in obj] 21 | if isinstance(obj, dict): 22 | return {name: move_to_device(val, device) for name, val in obj.items()} 23 | raise ValueError(f'Unexpected type {type(obj)}') 24 | 25 | 26 | class SmallMode(Enum): 27 | DROP = "drop" 28 | UPSCALE = "upscale" 29 | -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/training/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/training/__init__.py -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/training/data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/training/data/__init__.py -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/training/losses/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/bin/saicinpainting/training/losses/__init__.py -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/training/modules/depthwise_sep_conv.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | 4 | class DepthWiseSeperableConv(nn.Module): 5 | def __init__(self, in_dim, out_dim, *args, **kwargs): 6 | super().__init__() 7 | if 'groups' in kwargs: 8 | # ignoring groups for Depthwise Sep Conv 9 | del kwargs['groups'] 10 | 11 | self.depthwise = nn.Conv2d(in_dim, in_dim, *args, groups=in_dim, **kwargs) 12 | self.pointwise = nn.Conv2d(in_dim, out_dim, kernel_size=1) 13 | 14 | def forward(self, x): 15 | out = self.depthwise(x) 16 | out = self.pointwise(out) 17 | return out -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/training/modules/squeeze_excitation.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | 3 | 4 | class SELayer(nn.Module): 5 | def __init__(self, channel, reduction=16): 6 | super(SELayer, self).__init__() 7 | self.avg_pool = nn.AdaptiveAvgPool2d(1) 8 | self.fc = nn.Sequential( 9 | nn.Linear(channel, channel // reduction, bias=False), 10 | nn.ReLU(inplace=True), 11 | nn.Linear(channel // reduction, channel, bias=False), 12 | nn.Sigmoid() 13 | ) 14 | 15 | def forward(self, x): 16 | b, c, _, _ = x.size() 17 | y = self.avg_pool(x).view(b, c) 18 | y = self.fc(y).view(b, c, 1, 1) 19 | res = x * y.expand_as(x) 20 | return res 21 | -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/training/visualizers/__init__.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from saicinpainting.training.visualizers.directory import DirectoryVisualizer 4 | from saicinpainting.training.visualizers.noop import NoopVisualizer 5 | 6 | 7 | def make_visualizer(kind, **kwargs): 8 | logging.info(f'Make visualizer {kind}') 9 | 10 | if kind == 'directory': 11 | return DirectoryVisualizer(**kwargs) 12 | if kind == 'noop': 13 | return NoopVisualizer() 14 | 15 | raise ValueError(f'Unknown visualizer kind {kind}') 16 | -------------------------------------------------------------------------------- /third-party/lama/bin/saicinpainting/training/visualizers/noop.py: -------------------------------------------------------------------------------- 1 | from saicinpainting.training.visualizers.base import BaseVisualizer 2 | 3 | 4 | class NoopVisualizer(BaseVisualizer): 5 | def __init__(self, *args, **kwargs): 6 | pass 7 | 8 | def __call__(self, epoch_i, batch_i, batch, suffix='', rank=None): 9 | pass 10 | -------------------------------------------------------------------------------- /third-party/lama/bin/split_tar.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | 4 | import tqdm 5 | import webdataset as wds 6 | 7 | 8 | def main(args): 9 | input_dataset = wds.Dataset(args.infile) 10 | output_dataset = wds.ShardWriter(args.outpattern) 11 | for rec in tqdm.tqdm(input_dataset): 12 | output_dataset.write(rec) 13 | 14 | 15 | if __name__ == '__main__': 16 | import argparse 17 | 18 | aparser = argparse.ArgumentParser() 19 | aparser.add_argument('infile', type=str) 20 | aparser.add_argument('outpattern', type=str) 21 | 22 | main(aparser.parse_args()) 23 | -------------------------------------------------------------------------------- /third-party/lama/configs/analyze_mask_errors.yaml: -------------------------------------------------------------------------------- 1 | dataset_kwargs: 2 | img_suffix: .jpg 3 | inpainted_suffix: .jpg 4 | 5 | take_global_top: 30 6 | take_worst_best_top: 30 7 | take_overlapping_top: 30 -------------------------------------------------------------------------------- /third-party/lama/configs/data_gen/random_medium_256.yaml: -------------------------------------------------------------------------------- 1 | generator_kind: random 2 | 3 | mask_generator_kwargs: 4 | irregular_proba: 1 5 | irregular_kwargs: 6 | min_times: 4 7 | max_times: 5 8 | max_width: 50 9 | max_angle: 4 10 | max_len: 100 11 | 12 | box_proba: 0.3 13 | box_kwargs: 14 | margin: 0 15 | bbox_min_size: 10 16 | bbox_max_size: 50 17 | max_times: 5 18 | min_times: 1 19 | 20 | segm_proba: 0 21 | squares_proba: 0 22 | 23 | variants_n: 5 24 | 25 | max_masks_per_image: 1 26 | 27 | cropping: 28 | out_min_size: 256 29 | handle_small_mode: upscale 30 | out_square_crop: True 31 | crop_min_overlap: 1 32 | 33 | max_tamper_area: 0.5 34 | -------------------------------------------------------------------------------- /third-party/lama/configs/data_gen/random_medium_512.yaml: -------------------------------------------------------------------------------- 1 | generator_kind: random 2 | 3 | mask_generator_kwargs: 4 | irregular_proba: 1 5 | irregular_kwargs: 6 | min_times: 4 7 | max_times: 10 8 | max_width: 100 9 | max_angle: 4 10 | max_len: 200 11 | 12 | box_proba: 0.3 13 | box_kwargs: 14 | margin: 0 15 | bbox_min_size: 30 16 | bbox_max_size: 150 17 | max_times: 5 18 | min_times: 1 19 | 20 | segm_proba: 0 21 | squares_proba: 0 22 | 23 | variants_n: 5 24 | 25 | max_masks_per_image: 1 26 | 27 | cropping: 28 | out_min_size: 512 29 | handle_small_mode: upscale 30 | out_square_crop: True 31 | crop_min_overlap: 1 32 | 33 | max_tamper_area: 0.5 34 | -------------------------------------------------------------------------------- /third-party/lama/configs/data_gen/random_thick_256.yaml: -------------------------------------------------------------------------------- 1 | generator_kind: random 2 | 3 | mask_generator_kwargs: 4 | irregular_proba: 1 5 | irregular_kwargs: 6 | min_times: 1 7 | max_times: 5 8 | max_width: 100 9 | max_angle: 4 10 | max_len: 200 11 | 12 | box_proba: 0.3 13 | box_kwargs: 14 | margin: 10 15 | bbox_min_size: 30 16 | bbox_max_size: 150 17 | max_times: 3 18 | min_times: 1 19 | 20 | segm_proba: 0 21 | squares_proba: 0 22 | 23 | variants_n: 5 24 | 25 | max_masks_per_image: 1 26 | 27 | cropping: 28 | out_min_size: 256 29 | handle_small_mode: upscale 30 | out_square_crop: True 31 | crop_min_overlap: 1 32 | 33 | max_tamper_area: 0.5 34 | -------------------------------------------------------------------------------- /third-party/lama/configs/data_gen/random_thick_512.yaml: -------------------------------------------------------------------------------- 1 | generator_kind: random 2 | 3 | mask_generator_kwargs: 4 | irregular_proba: 1 5 | irregular_kwargs: 6 | min_times: 1 7 | max_times: 5 8 | max_width: 250 9 | max_angle: 4 10 | max_len: 450 11 | 12 | box_proba: 0.3 13 | box_kwargs: 14 | margin: 10 15 | bbox_min_size: 30 16 | bbox_max_size: 300 17 | max_times: 4 18 | min_times: 1 19 | 20 | segm_proba: 0 21 | squares_proba: 0 22 | 23 | variants_n: 5 24 | 25 | max_masks_per_image: 1 26 | 27 | cropping: 28 | out_min_size: 512 29 | handle_small_mode: upscale 30 | out_square_crop: True 31 | crop_min_overlap: 1 32 | 33 | max_tamper_area: 0.5 34 | -------------------------------------------------------------------------------- /third-party/lama/configs/data_gen/random_thin_256.yaml: -------------------------------------------------------------------------------- 1 | generator_kind: random 2 | 3 | mask_generator_kwargs: 4 | irregular_proba: 1 5 | irregular_kwargs: 6 | min_times: 4 7 | max_times: 50 8 | max_width: 10 9 | max_angle: 4 10 | max_len: 40 11 | box_proba: 0 12 | segm_proba: 0 13 | squares_proba: 0 14 | 15 | variants_n: 5 16 | 17 | max_masks_per_image: 1 18 | 19 | cropping: 20 | out_min_size: 256 21 | handle_small_mode: upscale 22 | out_square_crop: True 23 | crop_min_overlap: 1 24 | 25 | max_tamper_area: 0.5 26 | -------------------------------------------------------------------------------- /third-party/lama/configs/data_gen/random_thin_512.yaml: -------------------------------------------------------------------------------- 1 | generator_kind: random 2 | 3 | mask_generator_kwargs: 4 | irregular_proba: 1 5 | irregular_kwargs: 6 | min_times: 4 7 | max_times: 70 8 | max_width: 20 9 | max_angle: 4 10 | max_len: 100 11 | box_proba: 0 12 | segm_proba: 0 13 | squares_proba: 0 14 | 15 | variants_n: 5 16 | 17 | max_masks_per_image: 1 18 | 19 | cropping: 20 | out_min_size: 512 21 | handle_small_mode: upscale 22 | out_square_crop: True 23 | crop_min_overlap: 1 24 | 25 | max_tamper_area: 0.5 26 | -------------------------------------------------------------------------------- /third-party/lama/configs/debug_mask_gen.yaml: -------------------------------------------------------------------------------- 1 | img_ext: .jpg 2 | 3 | gen_kwargs: 4 | mask_size: 200 5 | step: 0.5 6 | -------------------------------------------------------------------------------- /third-party/lama/configs/eval1.yaml: -------------------------------------------------------------------------------- 1 | evaluator_kwargs: 2 | batch_size: 8 3 | 4 | dataset_kwargs: 5 | img_suffix: .png 6 | inpainted_suffix: .jpg -------------------------------------------------------------------------------- /third-party/lama/configs/eval2.yaml: -------------------------------------------------------------------------------- 1 | evaluator_kwargs: 2 | batch_size: 8 3 | device: cuda 4 | 5 | dataset_kwargs: 6 | img_suffix: .png 7 | inpainted_suffix: .png -------------------------------------------------------------------------------- /third-party/lama/configs/eval2_cpu.yaml: -------------------------------------------------------------------------------- 1 | evaluator_kwargs: 2 | batch_size: 8 3 | device: cpu 4 | 5 | dataset_kwargs: 6 | img_suffix: .png 7 | inpainted_suffix: .png -------------------------------------------------------------------------------- /third-party/lama/configs/eval2_gpu.yaml: -------------------------------------------------------------------------------- 1 | evaluator_kwargs: 2 | batch_size: 8 3 | 4 | dataset_kwargs: 5 | img_suffix: .png 6 | inpainted_suffix: .png -------------------------------------------------------------------------------- /third-party/lama/configs/eval2_jpg.yaml: -------------------------------------------------------------------------------- 1 | evaluator_kwargs: 2 | batch_size: 8 3 | 4 | dataset_kwargs: 5 | img_suffix: .png 6 | inpainted_suffix: .jpg -------------------------------------------------------------------------------- /third-party/lama/configs/eval2_segm.yaml: -------------------------------------------------------------------------------- 1 | evaluator_kwargs: 2 | batch_size: 8 3 | 4 | dataset_kwargs: 5 | img_suffix: .png 6 | inpainted_suffix: .png 7 | 8 | segmentation: 9 | enable: True 10 | weights_path: ${TORCH_HOME} 11 | -------------------------------------------------------------------------------- /third-party/lama/configs/eval2_segm_test.yaml: -------------------------------------------------------------------------------- 1 | evaluator_kwargs: 2 | batch_size: 1 3 | 4 | dataset_kwargs: 5 | img_suffix: _input.png 6 | inpainted_suffix: .png 7 | pad_out_to_modulo: 8 8 | 9 | segmentation: 10 | enable: True 11 | weights_path: ${TORCH_HOME} 12 | -------------------------------------------------------------------------------- /third-party/lama/configs/eval2_test.yaml: -------------------------------------------------------------------------------- 1 | evaluator_kwargs: 2 | batch_size: 1 3 | 4 | dataset_kwargs: 5 | img_suffix: _input.png 6 | inpainted_suffix: .png 7 | pad_out_to_modulo: 8 8 | -------------------------------------------------------------------------------- /third-party/lama/configs/prediction/default.yaml: -------------------------------------------------------------------------------- 1 | indir: no # to be overridden in CLI 2 | outdir: no # to be overridden in CLI 3 | 4 | model: 5 | path: no # to be overridden in CLI 6 | checkpoint: model_zoo/big_lama.ckpt 7 | 8 | dataset: 9 | kind: default 10 | img_suffix: .png 11 | pad_out_to_modulo: 8 12 | 13 | device: cuda 14 | out_key: inpainted 15 | 16 | refine: False # refiner will only run if this is True 17 | refiner: 18 | gpu_ids: 0,1 # the GPU ids of the machine to use. If only single GPU, use: "0," 19 | modulo: ${dataset.pad_out_to_modulo} 20 | n_iters: 15 # number of iterations of refinement for each scale 21 | lr: 0.002 # learning rate 22 | min_side: 512 # all sides of image on all scales should be >= min_side / sqrt(2) 23 | max_scales: 3 # max number of downscaling scales for the image-mask pyramid 24 | px_budget: 1800000 # pixels budget. Any image will be resized to satisfy height*width <= px_budget 25 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/ablv2_work.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: True 7 | store_discr_outputs_for_vis: True 8 | 9 | losses: 10 | l1: 11 | weight_missing: 0 12 | weight_known: 10 13 | perceptual: 14 | weight: 0 15 | adversarial: 16 | kind: r1 17 | weight: 10 18 | gp_coef: 0.001 19 | mask_as_fake_target: True 20 | allow_scale_mask: True 21 | feature_matching: 22 | weight: 100 23 | resnet_pl: 24 | weight: 30 25 | weights_path: ${env:TORCH_HOME} 26 | 27 | defaults: 28 | - location: docker 29 | - data: abl-04-256-mh-dist 30 | - generator: pix2pixhd_global_sigmoid 31 | - discriminator: pix2pixhd_nlayer 32 | - optimizers: default_optimizers 33 | - visualizer: directory 34 | - evaluator: default_inpainted 35 | - trainer: any_gpu_large_ssim_ddp_final 36 | - hydra: overrides 37 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/ablv2_work_ffc075.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: True 7 | store_discr_outputs_for_vis: True 8 | 9 | losses: 10 | l1: 11 | weight_missing: 0 12 | weight_known: 10 13 | perceptual: 14 | weight: 0 15 | adversarial: 16 | kind: r1 17 | weight: 10 18 | gp_coef: 0.001 19 | mask_as_fake_target: True 20 | allow_scale_mask: True 21 | feature_matching: 22 | weight: 100 23 | resnet_pl: 24 | weight: 30 25 | weights_path: ${env:TORCH_HOME} 26 | 27 | defaults: 28 | - location: docker 29 | - data: abl-04-256-mh-dist 30 | - generator: ffc_resnet_075 31 | - discriminator: pix2pixhd_nlayer 32 | - optimizers: default_optimizers 33 | - visualizer: directory 34 | - evaluator: default_inpainted 35 | - trainer: any_gpu_large_ssim_ddp_final 36 | - hydra: overrides 37 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/ablv2_work_md.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: True 7 | store_discr_outputs_for_vis: True 8 | 9 | losses: 10 | l1: 11 | weight_missing: 0 12 | weight_known: 10 13 | perceptual: 14 | weight: 0 15 | adversarial: 16 | kind: r1 17 | weight: 10 18 | gp_coef: 0.001 19 | mask_as_fake_target: True 20 | allow_scale_mask: True 21 | feature_matching: 22 | weight: 100 23 | resnet_pl: 24 | weight: 30 25 | weights_path: ${env:TORCH_HOME} 26 | 27 | defaults: 28 | - location: docker 29 | - data: abl-04-256-mh-dist 30 | - generator: pix2pixhd_multidilated_catin_4dil_9b 31 | - discriminator: pix2pixhd_nlayer 32 | - optimizers: default_optimizers 33 | - visualizer: directory 34 | - evaluator: default_inpainted 35 | - trainer: any_gpu_large_ssim_ddp_final_benchmark 36 | - hydra: overrides 37 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/ablv2_work_no_fm.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: True 7 | store_discr_outputs_for_vis: True 8 | 9 | losses: 10 | l1: 11 | weight_missing: 0 12 | weight_known: 10 13 | perceptual: 14 | weight: 0 15 | adversarial: 16 | kind: r1 17 | weight: 10 18 | gp_coef: 0.001 19 | mask_as_fake_target: True 20 | allow_scale_mask: True 21 | feature_matching: 22 | weight: 0 23 | resnet_pl: 24 | weight: 30 25 | weights_path: ${env:TORCH_HOME} 26 | 27 | defaults: 28 | - location: mlp-mow-final 29 | - data: abl-04-256-mh-dist 30 | - generator: pix2pixhd_global_sigmoid 31 | - discriminator: pix2pixhd_nlayer 32 | - optimizers: default_optimizers 33 | - visualizer: directory 34 | - evaluator: default_inpainted 35 | - trainer: any_gpu_large_ssim_ddp_final 36 | - hydra: overrides 37 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/ablv2_work_no_segmpl.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: True 7 | store_discr_outputs_for_vis: True 8 | 9 | losses: 10 | l1: 11 | weight_missing: 0 12 | weight_known: 10 13 | perceptual: 14 | weight: 0 15 | adversarial: 16 | kind: r1 17 | weight: 10 18 | gp_coef: 0.001 19 | mask_as_fake_target: True 20 | allow_scale_mask: True 21 | feature_matching: 22 | weight: 100 23 | resnet_pl: 24 | weight: 0 25 | # weights_path: ${env:TORCH_HOME} 26 | 27 | defaults: 28 | - location: docker 29 | - data: abl-04-256-mh-dist 30 | - generator: pix2pixhd_global_sigmoid 31 | - discriminator: pix2pixhd_nlayer 32 | - optimizers: default_optimizers 33 | - visualizer: directory 34 | - evaluator: default_inpainted 35 | - trainer: any_gpu_large_ssim_ddp_final 36 | - hydra: overrides 37 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/ablv2_work_no_segmpl_csdilirpl.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: True 7 | store_discr_outputs_for_vis: True 8 | 9 | losses: 10 | l1: 11 | weight_missing: 0 12 | weight_known: 10 13 | perceptual: 14 | weight: 0 15 | adversarial: 16 | kind: r1 17 | weight: 10 18 | gp_coef: 0.001 19 | mask_as_fake_target: True 20 | allow_scale_mask: True 21 | feature_matching: 22 | weight: 100 23 | resnet_pl: 24 | weight: 1 25 | segmentation: false 26 | 27 | defaults: 28 | - location: docker 29 | - data: abl-04-256-mh-dist 30 | - generator: pix2pixhd_global_sigmoid 31 | - discriminator: pix2pixhd_nlayer 32 | - optimizers: default_optimizers 33 | - visualizer: directory 34 | - evaluator: default_inpainted 35 | - trainer: any_gpu_large_ssim_ddp_final_benchmark 36 | - hydra: overrides 37 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/ablv2_work_no_segmpl_csdilirpl_celeba_csdilirpl1_new.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: true 7 | store_discr_outputs_for_vis: true 8 | losses: 9 | l1: 10 | weight_missing: 0 11 | weight_known: 10 12 | perceptual: 13 | weight: 0 14 | adversarial: 15 | kind: r1 16 | weight: 10 17 | gp_coef: 0.001 18 | mask_as_fake_target: true 19 | allow_scale_mask: true 20 | feature_matching: 21 | weight: 100 22 | segm_pl: 23 | weight: 1 24 | imagenet_weights: true 25 | 26 | defaults: 27 | - location: celeba 28 | - data: abl-04-256-mh-dist-celeba 29 | - generator: pix2pixhd_global_sigmoid 30 | - discriminator: pix2pixhd_nlayer 31 | - optimizers: default_optimizers 32 | - visualizer: directory 33 | - evaluator: default_inpainted 34 | - trainer: any_gpu_large_ssim_ddp_final_celeba 35 | - hydra: overrides -------------------------------------------------------------------------------- /third-party/lama/configs/training/ablv2_work_no_segmpl_csirpl.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: True 7 | store_discr_outputs_for_vis: True 8 | 9 | losses: 10 | l1: 11 | weight_missing: 0 12 | weight_known: 10 13 | perceptual: 14 | weight: 0 15 | adversarial: 16 | kind: r1 17 | weight: 10 18 | gp_coef: 0.001 19 | mask_as_fake_target: True 20 | allow_scale_mask: True 21 | feature_matching: 22 | weight: 100 23 | resnet_pl: 24 | weight: 0.3 25 | arch_encoder: 'resnet50' 26 | segmentation: false 27 | 28 | defaults: 29 | - location: docker 30 | - data: abl-04-256-mh-dist 31 | - generator: pix2pixhd_global_sigmoid 32 | - discriminator: pix2pixhd_nlayer 33 | - optimizers: default_optimizers 34 | - visualizer: directory 35 | - evaluator: default_inpainted 36 | - trainer: any_gpu_large_ssim_ddp_final 37 | - hydra: overrides 38 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/ablv2_work_no_segmpl_vgg.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: True 7 | store_discr_outputs_for_vis: True 8 | 9 | losses: 10 | l1: 11 | weight_missing: 0 12 | weight_known: 10 13 | perceptual: 14 | weight: 0.03 15 | adversarial: 16 | kind: r1 17 | weight: 10 18 | gp_coef: 0.001 19 | mask_as_fake_target: True 20 | allow_scale_mask: True 21 | feature_matching: 22 | weight: 100 23 | resnet_pl: 24 | weight: 0 25 | # weights_path: ${env:TORCH_HOME} 26 | 27 | defaults: 28 | - location: docker 29 | - data: abl-04-256-mh-dist 30 | - generator: pix2pixhd_global_sigmoid 31 | - discriminator: pix2pixhd_nlayer 32 | - optimizers: default_optimizers 33 | - visualizer: directory 34 | - evaluator: default_inpainted 35 | - trainer: any_gpu_large_ssim_ddp_final 36 | - hydra: overrides 37 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/ablv2_work_no_segmpl_vgg_celeba_l2_vgg003_new.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: true 7 | store_discr_outputs_for_vis: true 8 | losses: 9 | l1: 10 | weight_missing: 0 11 | weight_known: 10 12 | perceptual: 13 | weight: 0.03 14 | kwargs: 15 | metric: l2 16 | adversarial: 17 | kind: r1 18 | weight: 10 19 | gp_coef: 0.001 20 | mask_as_fake_target: true 21 | allow_scale_mask: true 22 | feature_matching: 23 | weight: 100 24 | segm_pl: 25 | weight: 0 26 | 27 | defaults: 28 | - location: celeba 29 | - data: abl-04-256-mh-dist-celeba 30 | - generator: pix2pixhd_global_sigmoid 31 | - discriminator: pix2pixhd_nlayer 32 | - optimizers: default_optimizers 33 | - visualizer: directory 34 | - evaluator: default_inpainted 35 | - trainer: any_gpu_large_ssim_ddp_final_celeba 36 | - hydra: overrides 37 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/ablv2_work_nodil_segmpl.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: True 7 | store_discr_outputs_for_vis: True 8 | 9 | losses: 10 | l1: 11 | weight_missing: 0 12 | weight_known: 10 13 | perceptual: 14 | weight: 0 15 | adversarial: 16 | kind: r1 17 | weight: 10 18 | gp_coef: 0.001 19 | mask_as_fake_target: True 20 | allow_scale_mask: True 21 | feature_matching: 22 | weight: 100 23 | resnet_pl: 24 | arch_encoder: resnet50 25 | weight: 30 26 | weights_path: ${env:TORCH_HOME} 27 | 28 | defaults: 29 | - location: docker 30 | - data: abl-04-256-mh-dist 31 | - generator: pix2pixhd_global_sigmoid 32 | - discriminator: pix2pixhd_nlayer 33 | - optimizers: default_optimizers 34 | - visualizer: directory 35 | - evaluator: default_inpainted 36 | - trainer: any_gpu_large_ssim_ddp_final 37 | - hydra: overrides 38 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/ablv2_work_small_holes.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: True 7 | store_discr_outputs_for_vis: True 8 | 9 | losses: 10 | l1: 11 | weight_missing: 0 12 | weight_known: 10 13 | perceptual: 14 | weight: 0 15 | adversarial: 16 | kind: r1 17 | weight: 10 18 | gp_coef: 0.001 19 | mask_as_fake_target: True 20 | allow_scale_mask: True 21 | feature_matching: 22 | weight: 100 23 | resnet_pl: 24 | weight: 30 25 | weights_path: ${env:TORCH_HOME} 26 | 27 | defaults: 28 | - location: docker 29 | - data: abl-02-thin-bb 30 | - generator: pix2pixhd_global_sigmoid 31 | - discriminator: pix2pixhd_nlayer 32 | - optimizers: default_optimizers 33 | - visualizer: directory 34 | - evaluator: default_inpainted 35 | - trainer: any_gpu_large_ssim_ddp_final 36 | - hydra: overrides 37 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/discriminator/pix2pixhd_nlayer.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | kind: pix2pixhd_nlayer 3 | input_nc: 3 4 | ndf: 64 5 | n_layers: 4 6 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/evaluator/default_inpainted.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | kind: default 3 | inpainted_key: inpainted # if you want to evaluate before blending with original image by mask, set predicted_image 4 | integral_kind: ssim_fid100_f1 5 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/generator/ffc_resnet_075.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | kind: ffc_resnet 3 | input_nc: 4 4 | output_nc: 3 5 | ngf: 64 6 | n_downsampling: 3 7 | n_blocks: 9 8 | add_out_act: sigmoid 9 | 10 | init_conv_kwargs: 11 | ratio_gin: 0 12 | ratio_gout: 0 13 | enable_lfu: False 14 | 15 | downsample_conv_kwargs: 16 | ratio_gin: ${generator.init_conv_kwargs.ratio_gout} 17 | ratio_gout: ${generator.downsample_conv_kwargs.ratio_gin} 18 | enable_lfu: False 19 | 20 | resnet_conv_kwargs: 21 | ratio_gin: 0.75 22 | ratio_gout: ${generator.resnet_conv_kwargs.ratio_gin} 23 | enable_lfu: False 24 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/generator/pix2pixhd_global.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | kind: pix2pixhd_global 3 | input_nc: 4 4 | output_nc: 3 5 | ngf: 64 6 | n_downsampling: 3 7 | n_blocks: 9 8 | conv_kind: default -------------------------------------------------------------------------------- /third-party/lama/configs/training/generator/pix2pixhd_global_sigmoid.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | kind: pix2pixhd_global 3 | input_nc: 4 4 | output_nc: 3 5 | ngf: 64 6 | n_downsampling: 3 7 | n_blocks: 9 8 | conv_kind: default 9 | add_out_act: sigmoid 10 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/generator/pix2pixhd_multidilated_catin_4dil_9b.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | kind: pix2pixhd_multidilated 3 | input_nc: 4 4 | output_nc: 3 5 | ngf: 64 6 | n_downsampling: 3 7 | n_blocks: 9 8 | conv_kind: default 9 | add_out_act: sigmoid 10 | multidilation_kwargs: 11 | comb_mode: cat_in 12 | dilation_num: 4 13 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/hydra/no_time.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | run: 3 | dir: ${location.out_root_dir}/${env:USER}_${hydra:job.name}_${hydra:job.config_name}_${run_title} 4 | sweep: 5 | dir: ${hydra:run.dir}_sweep 6 | subdir: ${hydra.job.num} 7 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/hydra/overrides.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | run: 3 | dir: ${location.out_root_dir}/${env:USER}_${now:%Y-%m-%d_%H-%M-%S}_${hydra:job.name}_${hydra:job.config_name}_${run_title} 4 | sweep: 5 | dir: ${hydra:run.dir}_sweep 6 | subdir: ${hydra.job.num} 7 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/lama-fourier-celeba.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: true 7 | store_discr_outputs_for_vis: true 8 | losses: 9 | l1: 10 | weight_missing: 0 11 | weight_known: 10 12 | perceptual: 13 | weight: 0 14 | adversarial: 15 | kind: r1 16 | weight: 10 17 | gp_coef: 0.001 18 | mask_as_fake_target: true 19 | allow_scale_mask: true 20 | feature_matching: 21 | weight: 100 22 | resnet_pl: 23 | weight: 30 24 | weights_path: ${env:TORCH_HOME} 25 | 26 | defaults: 27 | - location: celeba 28 | - data: abl-04-256-mh-dist-celeba 29 | - generator: ffc_resnet_075 30 | - discriminator: pix2pixhd_nlayer 31 | - optimizers: default_optimizers 32 | - visualizer: directory 33 | - evaluator: default_inpainted 34 | - trainer: any_gpu_large_ssim_ddp_final_celeba 35 | - hydra: overrides -------------------------------------------------------------------------------- /third-party/lama/configs/training/lama-fourier.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: true 7 | store_discr_outputs_for_vis: true 8 | losses: 9 | l1: 10 | weight_missing: 0 11 | weight_known: 10 12 | perceptual: 13 | weight: 0 14 | adversarial: 15 | kind: r1 16 | weight: 10 17 | gp_coef: 0.001 18 | mask_as_fake_target: true 19 | allow_scale_mask: true 20 | feature_matching: 21 | weight: 100 22 | resnet_pl: 23 | weight: 30 24 | weights_path: ${env:TORCH_HOME} 25 | 26 | defaults: 27 | - location: docker 28 | - data: abl-04-256-mh-dist 29 | - generator: ffc_resnet_075 30 | - discriminator: pix2pixhd_nlayer 31 | - optimizers: default_optimizers 32 | - visualizer: directory 33 | - evaluator: default_inpainted 34 | - trainer: any_gpu_large_ssim_ddp_final 35 | - hydra: overrides -------------------------------------------------------------------------------- /third-party/lama/configs/training/lama-regular-celeba.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: true 7 | store_discr_outputs_for_vis: true 8 | losses: 9 | l1: 10 | weight_missing: 0 11 | weight_known: 10 12 | perceptual: 13 | weight: 0 14 | adversarial: 15 | kind: r1 16 | weight: 10 17 | gp_coef: 0.001 18 | mask_as_fake_target: true 19 | allow_scale_mask: true 20 | feature_matching: 21 | weight: 100 22 | resnet_pl: 23 | weight: 30 24 | weights_path: ${env:TORCH_HOME} 25 | 26 | defaults: 27 | - location: celeba 28 | - data: abl-04-256-mh-dist-celeba 29 | - generator: pix2pixhd_global_sigmoid 30 | - discriminator: pix2pixhd_nlayer 31 | - optimizers: default_optimizers 32 | - visualizer: directory 33 | - evaluator: default_inpainted 34 | - trainer: any_gpu_large_ssim_ddp_final_celeba 35 | - hydra: overrides 36 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/lama-regular.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: true 7 | store_discr_outputs_for_vis: true 8 | losses: 9 | l1: 10 | weight_missing: 0 11 | weight_known: 10 12 | perceptual: 13 | weight: 0 14 | adversarial: 15 | kind: r1 16 | weight: 10 17 | gp_coef: 0.001 18 | mask_as_fake_target: true 19 | allow_scale_mask: true 20 | feature_matching: 21 | weight: 100 22 | resnet_pl: 23 | weight: 30 24 | weights_path: ${env:TORCH_HOME} 25 | 26 | defaults: 27 | - location: docker 28 | - data: abl-04-256-mh-dist 29 | - generator: pix2pixhd_global_sigmoid 30 | - discriminator: pix2pixhd_nlayer 31 | - optimizers: default_optimizers 32 | - visualizer: directory 33 | - evaluator: default_inpainted 34 | - trainer: any_gpu_large_ssim_ddp_final 35 | - hydra: overrides 36 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/lama_small_train_masks.yaml: -------------------------------------------------------------------------------- 1 | run_title: '' 2 | 3 | training_model: 4 | kind: default 5 | visualize_each_iters: 1000 6 | concat_mask: true 7 | store_discr_outputs_for_vis: true 8 | 9 | losses: 10 | l1: 11 | weight_missing: 0 12 | weight_known: 10 13 | perceptual: 14 | weight: 0 15 | adversarial: 16 | kind: r1 17 | weight: 10 18 | gp_coef: 0.001 19 | mask_as_fake_target: true 20 | allow_scale_mask: true 21 | feature_matching: 22 | weight: 100 23 | resnet_pl: 24 | weight: 30 25 | weights_path: ${env:TORCH_HOME} 26 | 27 | defaults: 28 | - location: docker 29 | - data: abl-02-thin-bb 30 | - generator: pix2pixhd_sigmoid 31 | - discriminator: pix2pixhd_nlayer 32 | - optimizers: default_optimizers 33 | - visualizer: directory 34 | - evaluator: default_inpainted 35 | - trainer: any_gpu_large_ssim_ddp_final 36 | - hydra: overrides -------------------------------------------------------------------------------- /third-party/lama/configs/training/location/celeba_example.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | data_root_dir: /home/user/lama/celeba-hq-dataset/ 3 | out_root_dir: /home/user/lama/experiments/ 4 | tb_dir: /home/user/lama/tb_logs/ 5 | pretrained_models: /home/user/lama/ 6 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/location/docker.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | data_root_dir: /data/data 3 | out_root_dir: /data/experiments 4 | tb_dir: /data/tb_logs 5 | pretrained_models: /some_path 6 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/location/places_example.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | data_root_dir: /home/user/inpainting-lama/places_standard_dataset/ 3 | out_root_dir: /home/user/inpainting-lama/experiments 4 | tb_dir: /home/user/inpainting-lama/tb_logs 5 | pretrained_models: /home/user/inpainting-lama/ 6 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/optimizers/default_optimizers.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | generator: 3 | kind: adam 4 | lr: 0.001 5 | discriminator: 6 | kind: adam 7 | lr: 0.0001 8 | -------------------------------------------------------------------------------- /third-party/lama/configs/training/trainer/any_gpu_large_ssim_ddp_final_celeba.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | kwargs: 3 | gpus: -1 4 | accelerator: ddp 5 | max_epochs: 40 6 | gradient_clip_val: 1 7 | log_gpu_memory: None 8 | limit_train_batches: 25000 9 | val_check_interval: 2600 10 | log_every_n_steps: 250 11 | precision: 32 12 | terminate_on_nan: False 13 | check_val_every_n_epoch: 1 14 | num_sanity_val_steps: 8 15 | replace_sampler_ddp: False 16 | checkpoint_kwargs: 17 | verbose: True 18 | save_top_k: 5 19 | save_last: True 20 | period: 1 21 | monitor: val_ssim_fid100_f1_total_mean 22 | mode: max -------------------------------------------------------------------------------- /third-party/lama/configs/training/visualizer/directory.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | kind: directory 3 | outdir: samples 4 | key_order: 5 | - image 6 | - predicted_image 7 | - discr_output_fake 8 | - discr_output_real 9 | - inpainted 10 | rescale_keys: 11 | - discr_output_fake 12 | - discr_output_real 13 | -------------------------------------------------------------------------------- /third-party/lama/docker/1_generate_masks_from_raw_images.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | if (( $# < 3 )) 5 | then 6 | echo "Usage: $0 config_name input_images_dir image_mask_dataset_out_dir [other args to gen_mask_dataset.py]" 7 | exit 1 8 | fi 9 | 10 | CURDIR="$(dirname $0)" 11 | SRCDIR="$CURDIR/.." 12 | SRCDIR="$(realpath $SRCDIR)" 13 | 14 | CONFIG_LOCAL_PATH="$(realpath $1)" 15 | INPUT_LOCAL_DIR="$(realpath $2)" 16 | OUTPUT_LOCAL_DIR="$(realpath $3)" 17 | shift 3 18 | 19 | mkdir -p "$OUTPUT_LOCAL_DIR" 20 | 21 | docker run \ 22 | -v "$SRCDIR":/home/user/project \ 23 | -v "$CONFIG_LOCAL_PATH":/data/config.yaml \ 24 | -v "$INPUT_LOCAL_DIR":/data/input \ 25 | -v "$OUTPUT_LOCAL_DIR":/data/output \ 26 | -u $(id -u):$(id -g) \ 27 | --name="lama-mask-gen" \ 28 | --rm \ 29 | windj007/lama \ 30 | /home/user/project/bin/gen_mask_dataset.py \ 31 | /data/config.yaml /data/input /data/output $@ 32 | -------------------------------------------------------------------------------- /third-party/lama/docker/2_predict.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | if (( $# < 3 )) 5 | then 6 | echo "Usage: $0 model_dir input_dir output_dir [other arguments to predict.py]" 7 | exit 1 8 | fi 9 | 10 | CURDIR="$(dirname $0)" 11 | SRCDIR="$CURDIR/.." 12 | SRCDIR="$(realpath $SRCDIR)" 13 | 14 | MODEL_LOCAL_DIR="$(realpath $1)" 15 | INPUT_LOCAL_DIR="$(realpath $2)" 16 | OUTPUT_LOCAL_DIR="$(realpath $3)" 17 | shift 3 18 | 19 | mkdir -p "$OUTPUT_LOCAL_DIR" 20 | 21 | docker run \ 22 | -v "$SRCDIR":/home/user/project \ 23 | -v "$MODEL_LOCAL_DIR":/data/checkpoint \ 24 | -v "$INPUT_LOCAL_DIR":/data/input \ 25 | -v "$OUTPUT_LOCAL_DIR":/data/output \ 26 | -u $(id -u):$(id -g) \ 27 | --name="lama-predict" \ 28 | --rm \ 29 | windj007/lama \ 30 | /home/user/project/bin/predict.py \ 31 | model.path=/data/checkpoint \ 32 | indir=/data/input \ 33 | outdir=/data/output \ 34 | dataset.img_suffix=.png \ 35 | $@ 36 | -------------------------------------------------------------------------------- /third-party/lama/docker/build-cuda111.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASEDIR="$(dirname $0)" 4 | 5 | docker build -t windj007/lama:cuda111 -f "$BASEDIR/Dockerfile-cuda111" "$BASEDIR" 6 | -------------------------------------------------------------------------------- /third-party/lama/docker/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASEDIR="$(dirname $0)" 4 | 5 | docker build -t windj007/lama -f "$BASEDIR/Dockerfile" "$BASEDIR" 6 | -------------------------------------------------------------------------------- /third-party/lama/docker/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec $@ 4 | -------------------------------------------------------------------------------- /third-party/lama/fetch_data/eval_sampler.py: -------------------------------------------------------------------------------- 1 | import os 2 | import random 3 | 4 | val_files_path = os.path.abspath('.') + '/places_standard_dataset/original/val/' 5 | list_of_random_val_files = os.path.abspath('.') + '/places_standard_dataset/original/eval_random_files.txt' 6 | val_files = [val_files_path + image for image in os.listdir(val_files_path)] 7 | 8 | print(f'Sampling 30000 images out of {len(val_files)} images in {val_files_path}' + \ 9 | f'and put their paths to {list_of_random_val_files}') 10 | 11 | print('In our paper we evaluate trained models on these 30k sampled (mask,image) pairs in our paper (check Sup. mat.)') 12 | 13 | random.shuffle(val_files) 14 | val_files_random = val_files[0:30000] 15 | 16 | with open(list_of_random_val_files, 'w') as fw: 17 | for filename in val_files_random: 18 | fw.write(filename+'\n') 19 | print('...done') 20 | 21 | -------------------------------------------------------------------------------- /third-party/lama/fetch_data/places_challenge_train_download.sh: -------------------------------------------------------------------------------- 1 | mkdir places_challenge_dataset 2 | 3 | 4 | declare -a TARPARTS 5 | for i in {a..z} 6 | do 7 | TARPARTS[${#TARPARTS[@]}]="http://data.csail.mit.edu/places/places365/train_large_split/${i}.tar" 8 | done 9 | ls 10 | printf "%s\n" "${TARPARTS[@]}" > places_challenge_dataset/places365_train.txt 11 | 12 | cd places_challenge_dataset/ 13 | xargs -a places365_train.txt -n 1 -P 8 wget [...] 14 | ls *.tar | xargs -i tar xvf {} 15 | -------------------------------------------------------------------------------- /third-party/lama/fetch_data/places_standard_test_val_gen_masks.sh: -------------------------------------------------------------------------------- 1 | mkdir -p places_standard_dataset/val/ 2 | mkdir -p places_standard_dataset/visual_test/ 3 | 4 | 5 | python3 bin/gen_mask_dataset.py \ 6 | $(pwd)/configs/data_gen/random_thick_512.yaml \ 7 | places_standard_dataset/val_hires/ \ 8 | places_standard_dataset/val/ 9 | 10 | python3 bin/gen_mask_dataset.py \ 11 | $(pwd)/configs/data_gen/random_thick_512.yaml \ 12 | places_standard_dataset/visual_test_hires/ \ 13 | places_standard_dataset/visual_test/ -------------------------------------------------------------------------------- /third-party/lama/fetch_data/places_standard_test_val_prepare.sh: -------------------------------------------------------------------------------- 1 | mkdir -p places_standard_dataset/original/test/ 2 | tar -xvf test_large.tar -C places_standard_dataset/original/test/ 3 | 4 | mkdir -p places_standard_dataset/original/val/ 5 | tar -xvf val_large.tar -C places_standard_dataset/original/val/ 6 | -------------------------------------------------------------------------------- /third-party/lama/fetch_data/places_standard_test_val_sample.sh: -------------------------------------------------------------------------------- 1 | mkdir -p places_standard_dataset/val_hires/ 2 | mkdir -p places_standard_dataset/visual_test_hires/ 3 | 4 | 5 | # randomly sample images for test and vis 6 | OUT=$(python3 fetch_data/sampler.py) 7 | echo ${OUT} 8 | 9 | FILELIST=$(cat places_standard_dataset/original/test_random_files.txt) 10 | 11 | for i in $FILELIST 12 | do 13 | $(cp ${i} places_standard_dataset/val_hires/) 14 | done 15 | 16 | FILELIST=$(cat places_standard_dataset/original/val_random_files.txt) 17 | 18 | for i in $FILELIST 19 | do 20 | $(cp ${i} places_standard_dataset/visual_test_hires/) 21 | done 22 | 23 | -------------------------------------------------------------------------------- /third-party/lama/fetch_data/places_standard_train_prepare.sh: -------------------------------------------------------------------------------- 1 | mkdir -p places_standard_dataset/train 2 | 3 | # untar without folder structure 4 | tar -xvf train_large_places365standard.tar -C places_standard_dataset/train 5 | 6 | # create location config places.yaml 7 | PWD=$(pwd) 8 | DATASET=${PWD}/places_standard_dataset 9 | PLACES=${PWD}/configs/training/location/places_standard.yaml 10 | 11 | touch $PLACES 12 | echo "# @package _group_" >> $PLACES 13 | echo "data_root_dir: ${DATASET}/" >> $PLACES 14 | echo "out_root_dir: ${PWD}/experiments/" >> $PLACES 15 | echo "tb_dir: ${PWD}/tb_logs/" >> $PLACES 16 | echo "pretrained_models: ${PWD}/" >> $PLACES 17 | -------------------------------------------------------------------------------- /third-party/lama/models/ade20k/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import * -------------------------------------------------------------------------------- /third-party/lama/models/ade20k/color150.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/models/ade20k/color150.mat -------------------------------------------------------------------------------- /third-party/lama/models/ade20k/segm_lib/nn/__init__.py: -------------------------------------------------------------------------------- 1 | from .modules import * 2 | from .parallel import UserScatteredDataParallel, user_scattered_collate, async_copy_to 3 | -------------------------------------------------------------------------------- /third-party/lama/models/ade20k/segm_lib/nn/modules/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # File : __init__.py 3 | # Author : Jiayuan Mao 4 | # Email : maojiayuan@gmail.com 5 | # Date : 27/01/2018 6 | # 7 | # This file is part of Synchronized-BatchNorm-PyTorch. 8 | # https://github.com/vacancy/Synchronized-BatchNorm-PyTorch 9 | # Distributed under MIT License. 10 | 11 | from .batchnorm import SynchronizedBatchNorm1d, SynchronizedBatchNorm2d, SynchronizedBatchNorm3d 12 | from .replicate import DataParallelWithCallback, patch_replication_callback 13 | -------------------------------------------------------------------------------- /third-party/lama/models/ade20k/segm_lib/nn/parallel/__init__.py: -------------------------------------------------------------------------------- 1 | from .data_parallel import UserScatteredDataParallel, user_scattered_collate, async_copy_to 2 | -------------------------------------------------------------------------------- /third-party/lama/models/ade20k/segm_lib/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .th import * 2 | -------------------------------------------------------------------------------- /third-party/lama/models/ade20k/segm_lib/utils/data/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | from .dataset import Dataset, TensorDataset, ConcatDataset 3 | from .dataloader import DataLoader 4 | -------------------------------------------------------------------------------- /third-party/lama/models/lpips_models/alex.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/models/lpips_models/alex.pth -------------------------------------------------------------------------------- /third-party/lama/models/lpips_models/squeeze.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/models/lpips_models/squeeze.pth -------------------------------------------------------------------------------- /third-party/lama/models/lpips_models/vgg.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/models/lpips_models/vgg.pth -------------------------------------------------------------------------------- /third-party/lama/requirements.txt: -------------------------------------------------------------------------------- 1 | pyyaml 2 | tqdm 3 | numpy 4 | easydict==1.9.0 5 | scikit-image==0.17.2 6 | scikit-learn==0.24.2 7 | opencv-python 8 | tensorflow 9 | joblib 10 | matplotlib 11 | pandas 12 | albumentations==0.5.2 13 | hydra-core==1.1.0 14 | pytorch-lightning==1.2.9 15 | tabulate 16 | kornia==0.5.0 17 | webdataset 18 | packaging 19 | scikit-learn==0.24.2 20 | wldhx.yadisk-direct 21 | -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/__init__.py -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/losses/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/evaluation/losses/__init__.py -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/losses/fid/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/evaluation/losses/fid/__init__.py -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/masks/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/evaluation/masks/__init__.py -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/masks/countless/.gitignore: -------------------------------------------------------------------------------- 1 | results -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/masks/countless/README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/william-silversmith/countless.svg?branch=master)](https://travis-ci.org/william-silversmith/countless) 2 | 3 | Python COUNTLESS Downsampling 4 | ============================= 5 | 6 | To install: 7 | 8 | `pip install -r requirements.txt` 9 | 10 | To test: 11 | 12 | `python test.py` 13 | 14 | To benchmark countless2d: 15 | 16 | `python python/countless2d.py python/images/gray_segmentation.png` 17 | 18 | To benchmark countless3d: 19 | 20 | `python python/countless3d.py` 21 | 22 | Adjust N and the list of algorithms inside each script to modify the run parameters. 23 | 24 | 25 | Python3 is slightly faster than Python2. -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/masks/countless/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/evaluation/masks/countless/__init__.py -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/masks/countless/images/gcim.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/evaluation/masks/countless/images/gcim.jpg -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/masks/countless/images/gray_segmentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/evaluation/masks/countless/images/gray_segmentation.png -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/masks/countless/images/segmentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/evaluation/masks/countless/images/segmentation.png -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/masks/countless/images/sparse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/evaluation/masks/countless/images/sparse.png -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/masks/countless/memprof/countless2d_gcim_N_1000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/evaluation/masks/countless/memprof/countless2d_gcim_N_1000.png -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/masks/countless/memprof/countless2d_quick_gcim_N_1000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/evaluation/masks/countless/memprof/countless2d_quick_gcim_N_1000.png -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/masks/countless/memprof/countless3d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/evaluation/masks/countless/memprof/countless3d.png -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/masks/countless/memprof/countless3d_dynamic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/evaluation/masks/countless/memprof/countless3d_dynamic.png -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/masks/countless/memprof/countless3d_dynamic_generalized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/evaluation/masks/countless/memprof/countless3d_dynamic_generalized.png -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/masks/countless/memprof/countless3d_generalized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/evaluation/masks/countless/memprof/countless3d_generalized.png -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/masks/countless/requirements.txt: -------------------------------------------------------------------------------- 1 | Pillow>=6.2.0 2 | numpy>=1.16 3 | scipy 4 | tqdm 5 | memory_profiler 6 | six 7 | pytest -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/evaluation/utils.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | import yaml 4 | from easydict import EasyDict as edict 5 | import torch.nn as nn 6 | import torch 7 | 8 | 9 | def load_yaml(path): 10 | with open(path, 'r') as f: 11 | return edict(yaml.safe_load(f)) 12 | 13 | 14 | def move_to_device(obj, device): 15 | if isinstance(obj, nn.Module): 16 | return obj.to(device) 17 | if torch.is_tensor(obj): 18 | return obj.to(device) 19 | if isinstance(obj, (tuple, list)): 20 | return [move_to_device(el, device) for el in obj] 21 | if isinstance(obj, dict): 22 | return {name: move_to_device(val, device) for name, val in obj.items()} 23 | raise ValueError(f'Unexpected type {type(obj)}') 24 | 25 | 26 | class SmallMode(Enum): 27 | DROP = "drop" 28 | UPSCALE = "upscale" 29 | -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/training/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/training/__init__.py -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/training/data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/training/data/__init__.py -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/training/losses/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGVLab/InternGPT/a04d6dd6d5971e710cf55eae0a8ea1ce70ba1a81/third-party/lama/saicinpainting/training/losses/__init__.py -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/training/modules/depthwise_sep_conv.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | 4 | class DepthWiseSeperableConv(nn.Module): 5 | def __init__(self, in_dim, out_dim, *args, **kwargs): 6 | super().__init__() 7 | if 'groups' in kwargs: 8 | # ignoring groups for Depthwise Sep Conv 9 | del kwargs['groups'] 10 | 11 | self.depthwise = nn.Conv2d(in_dim, in_dim, *args, groups=in_dim, **kwargs) 12 | self.pointwise = nn.Conv2d(in_dim, out_dim, kernel_size=1) 13 | 14 | def forward(self, x): 15 | out = self.depthwise(x) 16 | out = self.pointwise(out) 17 | return out -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/training/modules/squeeze_excitation.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | 3 | 4 | class SELayer(nn.Module): 5 | def __init__(self, channel, reduction=16): 6 | super(SELayer, self).__init__() 7 | self.avg_pool = nn.AdaptiveAvgPool2d(1) 8 | self.fc = nn.Sequential( 9 | nn.Linear(channel, channel // reduction, bias=False), 10 | nn.ReLU(inplace=True), 11 | nn.Linear(channel // reduction, channel, bias=False), 12 | nn.Sigmoid() 13 | ) 14 | 15 | def forward(self, x): 16 | b, c, _, _ = x.size() 17 | y = self.avg_pool(x).view(b, c) 18 | y = self.fc(y).view(b, c, 1, 1) 19 | res = x * y.expand_as(x) 20 | return res 21 | -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/training/visualizers/__init__.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from saicinpainting.training.visualizers.directory import DirectoryVisualizer 4 | from saicinpainting.training.visualizers.noop import NoopVisualizer 5 | 6 | 7 | def make_visualizer(kind, **kwargs): 8 | logging.info(f'Make visualizer {kind}') 9 | 10 | if kind == 'directory': 11 | return DirectoryVisualizer(**kwargs) 12 | if kind == 'noop': 13 | return NoopVisualizer() 14 | 15 | raise ValueError(f'Unknown visualizer kind {kind}') 16 | -------------------------------------------------------------------------------- /third-party/lama/saicinpainting/training/visualizers/noop.py: -------------------------------------------------------------------------------- 1 | from saicinpainting.training.visualizers.base import BaseVisualizer 2 | 3 | 4 | class NoopVisualizer(BaseVisualizer): 5 | def __init__(self, *args, **kwargs): 6 | pass 7 | 8 | def __call__(self, epoch_i, batch_i, batch, suffix='', rank=None): 9 | pass 10 | --------------------------------------------------------------------------------