├── .dev_scripts └── check_installation.py ├── .dockerignore ├── .github ├── ISSUE_TEMPLATE │ ├── 1-bug-report.yml │ ├── 2-feature_request.yml │ ├── 3-documentation.yml │ └── config.yml ├── pull_request_template.md └── workflows │ ├── build_macos_wheel.yml │ ├── lint.yml │ ├── merge_stage_test.yml │ ├── pr_stage_test.yml │ └── publish-to-pypi.yml ├── .gitignore ├── .pre-commit-config-zh-cn.yaml ├── .pre-commit-config.yaml ├── .readthedocs.yml ├── CITATION.cff ├── CONTRIBUTING.md ├── CONTRIBUTING_zh-CN.md ├── LICENSE ├── LICENSES.md ├── MANIFEST.in ├── README.md ├── README_zh-CN.md ├── TERMINOLOGY.md ├── docker ├── README.md ├── dev │ └── Dockerfile └── release │ └── Dockerfile ├── docs ├── en │ ├── Makefile │ ├── _static │ │ ├── community │ │ │ ├── 1.png │ │ │ ├── 2.png │ │ │ └── 3.png │ │ ├── css │ │ │ └── readthedocs.css │ │ ├── flow_img2toimg1.png │ │ ├── flow_raw_images.png │ │ ├── flow_visualization.png │ │ ├── flow_warp.png │ │ ├── flow_warp_diff.png │ │ ├── image │ │ │ └── mmcv-logo.png │ │ ├── parallel_progress.gif │ │ ├── parallel_progress.png │ │ ├── progress.gif │ │ ├── progress.png │ │ └── version.json │ ├── _templates │ │ └── classtemplate.rst │ ├── api │ │ ├── arraymisc.rst │ │ ├── cnn.rst │ │ ├── image.rst │ │ ├── ops.rst │ │ ├── transforms.rst │ │ ├── utils.rst │ │ ├── video.rst │ │ └── visualization.rst │ ├── community │ │ ├── contributing.md │ │ └── pr.md │ ├── compatibility.md │ ├── conf.py │ ├── deployment │ │ └── mmcv_ops_definition.md │ ├── docutils.conf │ ├── faq.md │ ├── get_started │ │ ├── api_reference.md │ │ ├── build.md │ │ ├── installation.md │ │ ├── introduction.md │ │ └── previous_versions.md │ ├── index.rst │ ├── make.bat │ ├── mmcv-logo.png │ ├── switch_language.md │ └── understand_mmcv │ │ ├── cnn.md │ │ ├── data_process.md │ │ ├── data_transform.md │ │ ├── ops.md │ │ └── visualization.md └── zh_cn │ ├── Makefile │ ├── _static │ ├── css │ │ └── readthedocs.css │ ├── image │ │ └── mmcv-logo.png │ └── version.json │ ├── _templates │ └── classtemplate.rst │ ├── api │ ├── arraymisc.rst │ ├── cnn.rst │ ├── image.rst │ ├── ops.rst │ ├── transforms.rst │ ├── utils.rst │ ├── video.rst │ └── visualization.rst │ ├── community │ ├── code_style.md │ ├── contributing.md │ └── pr.md │ ├── compatibility.md │ ├── conf.py │ ├── docutils.conf │ ├── faq.md │ ├── get_started │ ├── api_reference.md │ ├── article.md │ ├── build.md │ ├── installation.md │ ├── introduction.md │ └── previous_versions.md │ ├── index.rst │ ├── make.bat │ ├── mmcv-logo.png │ ├── switch_language.md │ └── understand_mmcv │ ├── cnn.md │ ├── data_process.md │ ├── data_transform.md │ ├── ops.md │ └── visualization.md ├── mmcv ├── __init__.py ├── arraymisc │ ├── __init__.py │ └── quantization.py ├── cnn │ ├── __init__.py │ ├── alexnet.py │ ├── bricks │ │ ├── __init__.py │ │ ├── activation.py │ │ ├── context_block.py │ │ ├── conv.py │ │ ├── conv2d_adaptive_padding.py │ │ ├── conv_module.py │ │ ├── conv_ws.py │ │ ├── depthwise_separable_conv_module.py │ │ ├── drop.py │ │ ├── generalized_attention.py │ │ ├── hsigmoid.py │ │ ├── hswish.py │ │ ├── non_local.py │ │ ├── norm.py │ │ ├── padding.py │ │ ├── plugin.py │ │ ├── scale.py │ │ ├── swish.py │ │ ├── transformer.py │ │ ├── upsample.py │ │ └── wrappers.py │ ├── resnet.py │ ├── rfsearch │ │ ├── __init__.py │ │ ├── operator.py │ │ ├── search.py │ │ └── utils.py │ ├── utils │ │ ├── __init__.py │ │ ├── flops_counter.py │ │ └── fuse_conv_bn.py │ └── vgg.py ├── image │ ├── __init__.py │ ├── colorspace.py │ ├── geometric.py │ ├── io.py │ ├── misc.py │ └── photometric.py ├── ops │ ├── __init__.py │ ├── active_rotated_filter.py │ ├── assign_score_withk.py │ ├── ball_query.py │ ├── bbox.py │ ├── bezier_align.py │ ├── bias_act.py │ ├── border_align.py │ ├── box_iou_quadri.py │ ├── box_iou_rotated.py │ ├── carafe.py │ ├── cc_attention.py │ ├── chamfer_distance.py │ ├── contour_expand.py │ ├── conv2d_gradfix.py │ ├── convex_iou.py │ ├── corner_pool.py │ ├── correlation.py │ ├── csrc │ │ ├── README.md │ │ ├── common │ │ │ ├── box_iou_rotated_utils.hpp │ │ │ ├── cuda │ │ │ │ ├── active_rotated_filter_cuda_kernel.cuh │ │ │ │ ├── assign_score_withk_cuda_kernel.cuh │ │ │ │ ├── ball_query_cuda_kernel.cuh │ │ │ │ ├── bbox_overlaps_cuda_kernel.cuh │ │ │ │ ├── bezier_align_cuda_kernel.cuh │ │ │ │ ├── border_align_cuda_kernel.cuh │ │ │ │ ├── box_iou_quadri_cuda.cuh │ │ │ │ ├── box_iou_rotated_cuda.cuh │ │ │ │ ├── carafe_cuda_kernel.cuh │ │ │ │ ├── carafe_naive_cuda_kernel.cuh │ │ │ │ ├── chamfer_distance_cuda_kernel.cuh │ │ │ │ ├── common_cuda_helper.hpp │ │ │ │ ├── convex_iou_cuda_kernel.cuh │ │ │ │ ├── correlation_cuda.cuh │ │ │ │ ├── deform_conv_cuda_kernel.cuh │ │ │ │ ├── deform_roi_pool_cuda_kernel.cuh │ │ │ │ ├── diff_iou_rotated_cuda_kernel.cuh │ │ │ │ ├── furthest_point_sample_cuda_kernel.cuh │ │ │ │ ├── gather_points_cuda_kernel.cuh │ │ │ │ ├── group_points_cuda_kernel.cuh │ │ │ │ ├── iou3d_cuda_kernel.cuh │ │ │ │ ├── knn_cuda_kernel.cuh │ │ │ │ ├── masked_conv2d_cuda_kernel.cuh │ │ │ │ ├── min_area_polygons_cuda.cuh │ │ │ │ ├── modulated_deform_conv_cuda_kernel.cuh │ │ │ │ ├── ms_deform_attn_cuda_kernel.cuh │ │ │ │ ├── nms_cuda_kernel.cuh │ │ │ │ ├── nms_quadri_cuda.cuh │ │ │ │ ├── nms_rotated_cuda.cuh │ │ │ │ ├── parrots_cudawarpfunction.cuh │ │ │ │ ├── points_in_boxes_cuda_kernel.cuh │ │ │ │ ├── points_in_polygons_cuda_kernel.cuh │ │ │ │ ├── prroi_pool_cuda_kernel.cuh │ │ │ │ ├── psamask_cuda_kernel.cuh │ │ │ │ ├── riroi_align_rotated_cuda_kernel.cuh │ │ │ │ ├── roi_align_cuda_kernel.cuh │ │ │ │ ├── roi_align_rotated_cuda_kernel.cuh │ │ │ │ ├── roi_pool_cuda_kernel.cuh │ │ │ │ ├── roiaware_pool3d_cuda_kernel.cuh │ │ │ │ ├── roipoint_pool3d_cuda_kernel.cuh │ │ │ │ ├── rotated_feature_align_cuda_kernel.cuh │ │ │ │ ├── scatter_points_cuda_kernel.cuh │ │ │ │ ├── sigmoid_focal_loss_cuda_kernel.cuh │ │ │ │ ├── softmax_focal_loss_cuda_kernel.cuh │ │ │ │ ├── spconv │ │ │ │ │ ├── indice.cuh │ │ │ │ │ └── reordering.cuh │ │ │ │ ├── stack_ball_query_cuda_kernel.cuh │ │ │ │ ├── stack_group_points_cuda_kernel.cuh │ │ │ │ ├── sync_bn_cuda_kernel.cuh │ │ │ │ ├── three_interpolate_cuda_kernel.cuh │ │ │ │ ├── three_nn_cuda_kernel.cuh │ │ │ │ ├── tin_shift_cuda_kernel.cuh │ │ │ │ └── voxelization_cuda_kernel.cuh │ │ │ ├── mlu │ │ │ │ ├── common_mlu_helper.hpp │ │ │ │ ├── masked_conv2d_mlu_kernel.mlu │ │ │ │ └── roi_pool_mlu_kernel.mlu │ │ │ ├── mps │ │ │ │ ├── MPSDevice.h │ │ │ │ ├── MPSLibrary.h │ │ │ │ ├── MPSLibrary.mm │ │ │ │ ├── MPSStream.h │ │ │ │ └── MPSUtils.h │ │ │ ├── musa │ │ │ │ ├── active_rotated_filter_musa_kernel.muh │ │ │ │ ├── assign_score_withk_musa_kernel.muh │ │ │ │ ├── ball_query_musa_kernel.muh │ │ │ │ ├── bbox_overlaps_musa_kernel.muh │ │ │ │ ├── bezier_align_musa_kernel.muh │ │ │ │ ├── border_align_musa_kernel.muh │ │ │ │ ├── box_iou_quadri_musa.muh │ │ │ │ ├── box_iou_rotated_musa.muh │ │ │ │ ├── carafe_musa_kernel.muh │ │ │ │ ├── carafe_naive_musa_kernel.muh │ │ │ │ ├── chamfer_distance_musa_kernel.muh │ │ │ │ ├── common_musa_helper.hpp │ │ │ │ ├── convex_iou_musa_kernel.muh │ │ │ │ ├── correlation_musa.muh │ │ │ │ ├── deform_conv_musa_kernel.muh │ │ │ │ ├── deform_roi_pool_musa_kernel.muh │ │ │ │ ├── diff_iou_rotated_musa_kernel.muh │ │ │ │ ├── furthest_point_sample_musa_kernel.muh │ │ │ │ ├── gather_points_musa_kernel.muh │ │ │ │ ├── group_points_musa_kernel.muh │ │ │ │ ├── iou3d_musa_kernel.muh │ │ │ │ ├── knn_musa_kernel.muh │ │ │ │ ├── masked_conv2d_musa_kernel.muh │ │ │ │ ├── min_area_polygons_musa.muh │ │ │ │ ├── modulated_deform_conv_musa_kernel.muh │ │ │ │ ├── ms_deform_attn_musa_kernel.muh │ │ │ │ ├── nms_musa_kernel.muh │ │ │ │ ├── nms_quadri_musa.muh │ │ │ │ ├── nms_rotated_musa.muh │ │ │ │ ├── points_in_boxes_musa_kernel.muh │ │ │ │ ├── points_in_polygons_musa_kernel.muh │ │ │ │ ├── prroi_pool_musa_kernel.muh │ │ │ │ ├── psamask_musa_kernel.muh │ │ │ │ ├── riroi_align_rotated_musa_kernel.muh │ │ │ │ ├── roi_align_musa_kernel.muh │ │ │ │ ├── roi_align_rotated_musa_kernel.muh │ │ │ │ ├── roi_pool_musa_kernel.muh │ │ │ │ ├── roiaware_pool3d_musa_kernel.muh │ │ │ │ ├── roipoint_pool3d_musa_kernel.muh │ │ │ │ ├── rotated_feature_align_musa_kernel.muh │ │ │ │ ├── scatter_points_musa_kernel.muh │ │ │ │ ├── sigmoid_focal_loss_musa_kernel.muh │ │ │ │ ├── softmax_focal_loss_musa_kernel.muh │ │ │ │ ├── spconv │ │ │ │ │ ├── indice.muh │ │ │ │ │ └── reordering.muh │ │ │ │ ├── stack_ball_query_musa_kernel.muh │ │ │ │ ├── stack_group_points_musa_kernel.muh │ │ │ │ ├── sync_bn_musa_kernel.muh │ │ │ │ ├── three_interpolate_musa_kernel.muh │ │ │ │ ├── three_nn_musa_kernel.muh │ │ │ │ ├── tin_shift_musa_kernel.muh │ │ │ │ └── voxelization_musa_kernel.muh │ │ │ ├── parrots_cpp_helper.hpp │ │ │ ├── parrots_cuda_helper.hpp │ │ │ ├── pytorch_cpp_helper.hpp │ │ │ ├── pytorch_cuda_helper.hpp │ │ │ ├── pytorch_device_registry.hpp │ │ │ ├── pytorch_mlu_helper.hpp │ │ │ ├── pytorch_musa_helper.hpp │ │ │ ├── pytorch_npu_helper.hpp │ │ │ ├── pytorch_npu_util.hpp │ │ │ └── utils │ │ │ │ └── spconv │ │ │ │ ├── paramsgrid.h │ │ │ │ ├── prettyprint.h │ │ │ │ ├── pybind11_utils.h │ │ │ │ ├── spconv │ │ │ │ ├── geometry.h │ │ │ │ ├── indice.h │ │ │ │ ├── maxpool.h │ │ │ │ ├── mp_helper.h │ │ │ │ ├── point2voxel.h │ │ │ │ └── reordering.h │ │ │ │ └── tensorview │ │ │ │ ├── helper_kernel.cuh │ │ │ │ ├── helper_kernel.muh │ │ │ │ ├── helper_launch.h │ │ │ │ └── tensorview.h │ │ ├── parrots │ │ │ ├── active_rotated_filter.cpp │ │ │ ├── active_rotated_filter_parrots.cpp │ │ │ ├── active_rotated_filter_pytorch.h │ │ │ ├── assign_score_withk.cpp │ │ │ ├── assign_score_withk_parrots.cpp │ │ │ ├── assign_score_withk_pytorch.h │ │ │ ├── ball_query._parrots.cpp │ │ │ ├── ball_query.cpp │ │ │ ├── ball_query_pytorch.h │ │ │ ├── bbox_overlaps.cpp │ │ │ ├── bbox_overlaps_parrots.cpp │ │ │ ├── bbox_overlaps_pytorch.h │ │ │ ├── border_align.cpp │ │ │ ├── border_align_parrots.cpp │ │ │ ├── border_align_pytorch.h │ │ │ ├── box_iou_rotated.cpp │ │ │ ├── box_iou_rotated_parrots.cpp │ │ │ ├── box_iou_rotated_pytorch.h │ │ │ ├── carafe.cpp │ │ │ ├── carafe_naive.cpp │ │ │ ├── carafe_naive_parrots.cpp │ │ │ ├── carafe_naive_pytorch.h │ │ │ ├── carafe_parrots.cpp │ │ │ ├── carafe_pytorch.h │ │ │ ├── chamfer_distance.cpp │ │ │ ├── chamfer_distance_parrots.cpp │ │ │ ├── chamfer_distance_pytorch.h │ │ │ ├── contour_expand.cpp │ │ │ ├── contour_expand_parrots.cpp │ │ │ ├── contour_expand_pytorch.h │ │ │ ├── convex_iou.cpp │ │ │ ├── convex_iou_parrots.cpp │ │ │ ├── convex_iou_pytorch.h │ │ │ ├── correlation.cpp │ │ │ ├── correlation_parrots.cpp │ │ │ ├── correlation_pytorch.h │ │ │ ├── cudabind.cpp │ │ │ ├── deform_conv.cpp │ │ │ ├── deform_conv_parrots.cpp │ │ │ ├── deform_conv_pytorch.h │ │ │ ├── deform_roi_pool.cpp │ │ │ ├── deform_roi_pool_parrots.cpp │ │ │ ├── deform_roi_pool_pytorch.h │ │ │ ├── diff_iou_rotated.cpp │ │ │ ├── diff_iou_rotated_parrots.cpp │ │ │ ├── diff_iou_rotated_pytorch.h │ │ │ ├── focal_loss.cpp │ │ │ ├── focal_loss_parrots.cpp │ │ │ ├── focal_loss_pytorch.h │ │ │ ├── furthest_point_sample.cpp │ │ │ ├── furthest_point_sample_parrots.cpp │ │ │ ├── furthest_point_sample_pytorch.h │ │ │ ├── fused_bias_leakyrelu.cpp │ │ │ ├── fused_bias_parrots.cpp │ │ │ ├── gather_points.cpp │ │ │ ├── gather_points_parrots.cpp │ │ │ ├── gather_points_pytorch.h │ │ │ ├── group_points.cpp │ │ │ ├── group_points_parrots.cpp │ │ │ ├── group_points_pytorch.h │ │ │ ├── info.cpp │ │ │ ├── iou3d.cpp │ │ │ ├── iou3d_parrots.cpp │ │ │ ├── iou3d_pytorch.h │ │ │ ├── knn.cpp │ │ │ ├── knn_parrots.cpp │ │ │ ├── knn_pytorch.h │ │ │ ├── masked_conv2d.cpp │ │ │ ├── masked_conv2d_parrots.cpp │ │ │ ├── masked_conv2d_pytorch.h │ │ │ ├── min_area_polygons.cpp │ │ │ ├── min_area_polygons_parrots.cpp │ │ │ ├── min_area_polygons_pytorch.h │ │ │ ├── modulated_deform_conv.cpp │ │ │ ├── modulated_deform_conv_parrots.cpp │ │ │ ├── modulated_deform_conv_pytorch.h │ │ │ ├── ms_deform_attn.cpp │ │ │ ├── ms_deform_attn_parrots.cpp │ │ │ ├── nms.cpp │ │ │ ├── nms_parrots.cpp │ │ │ ├── nms_pytorch.h │ │ │ ├── nms_rotated.cpp │ │ │ ├── pixel_group.cpp │ │ │ ├── pixel_group_parrots.cpp │ │ │ ├── pixel_group_pytorch.h │ │ │ ├── points_in_boxes.cpp │ │ │ ├── points_in_boxes_parrots.cpp │ │ │ ├── points_in_boxes_pytorch.h │ │ │ ├── points_in_polygons.cpp │ │ │ ├── points_in_polygons_parrots.cpp │ │ │ ├── points_in_polygons_pytorch.h │ │ │ ├── prroi_pool.cpp │ │ │ ├── prroi_pool_parrots.cpp │ │ │ ├── prroi_pool_pytorch.h │ │ │ ├── psamask.cpp │ │ │ ├── psamask_parrots.cpp │ │ │ ├── psamask_pytorch.h │ │ │ ├── riroi_align_rotated.cpp │ │ │ ├── riroi_align_rotated_parrots.cpp │ │ │ ├── riroi_align_rotated_pytorch.h │ │ │ ├── roi_align.cpp │ │ │ ├── roi_align_parrots.cpp │ │ │ ├── roi_align_pytorch.h │ │ │ ├── roi_align_rotated.cpp │ │ │ ├── roi_align_rotated_parrots.cpp │ │ │ ├── roi_align_rotated_pytorch.h │ │ │ ├── roi_pool.cpp │ │ │ ├── roi_pool_parrots.cpp │ │ │ ├── roi_pool_pytorch.h │ │ │ ├── roiaware_pool3d.cpp │ │ │ ├── roiaware_pool3d_parrots.cpp │ │ │ ├── roiaware_pool3d_pytorch.h │ │ │ ├── roipoint_pool3d.cpp │ │ │ ├── roipoint_pool3d_parrots.cpp │ │ │ ├── roipoint_pool3d_pytorch.h │ │ │ ├── rotated_feature_align.cpp │ │ │ ├── rotated_feature_align_parrots.cpp │ │ │ ├── rotated_feature_align_pytorch.h │ │ │ ├── sync_bn.cpp │ │ │ ├── sync_bn_parrots.cpp │ │ │ ├── sync_bn_pytorch.h │ │ │ ├── three_interpolate.cpp │ │ │ ├── three_interpolate_parrots.cpp │ │ │ ├── three_interpolate_pytorch.h │ │ │ ├── three_nn.cpp │ │ │ ├── three_nn_parrots.cpp │ │ │ ├── three_nn_pytorch.h │ │ │ ├── tin_shift.cpp │ │ │ ├── tin_shift_parrots.cpp │ │ │ ├── tin_shift_pytorch.h │ │ │ ├── upfirdn2d.cpp │ │ │ ├── upfirdn2d_parrots.cpp │ │ │ ├── voxelization.cpp │ │ │ ├── voxelization_parrots.cpp │ │ │ └── voxelization_pytorch.h │ │ └── pytorch │ │ │ ├── active_rotated_filter.cpp │ │ │ ├── assign_score_withk.cpp │ │ │ ├── ball_query.cpp │ │ │ ├── bbox_overlaps.cpp │ │ │ ├── bezier_align.cpp │ │ │ ├── bias_act.cpp │ │ │ ├── border_align.cpp │ │ │ ├── box_iou_quadri.cpp │ │ │ ├── box_iou_rotated.cpp │ │ │ ├── carafe.cpp │ │ │ ├── carafe_naive.cpp │ │ │ ├── chamfer_distance.cpp │ │ │ ├── contour_expand.cpp │ │ │ ├── convex_iou.cpp │ │ │ ├── correlation.cpp │ │ │ ├── cpu │ │ │ ├── active_rotated_filter.cpp │ │ │ ├── bbox_overlaps_cpu.cpp │ │ │ ├── bezier_align.cpp │ │ │ ├── box_iou_quadri.cpp │ │ │ ├── box_iou_rotated.cpp │ │ │ ├── deform_conv.cpp │ │ │ ├── modulated_deform_conv.cpp │ │ │ ├── nms.cpp │ │ │ ├── nms_quadri.cpp │ │ │ ├── nms_rotated.cpp │ │ │ ├── pixel_group.cpp │ │ │ ├── points_in_boxes.cpp │ │ │ ├── psamask.cpp │ │ │ ├── roi_align.cpp │ │ │ ├── roi_align_rotated.cpp │ │ │ ├── rotated_feature_align.cpp │ │ │ ├── sparse_indice.cpp │ │ │ ├── sparse_maxpool.cpp │ │ │ ├── sparse_reordering.cpp │ │ │ └── voxelization.cpp │ │ │ ├── cuda │ │ │ ├── active_rotated_filter_cuda.cu │ │ │ ├── assign_score_withk_cuda.cu │ │ │ ├── ball_query_cuda.cu │ │ │ ├── bbox_overlaps_cuda.cu │ │ │ ├── bezier_align_cuda.cu │ │ │ ├── bias_act_cuda.cu │ │ │ ├── border_align_cuda.cu │ │ │ ├── box_iou_quadri_cuda.cu │ │ │ ├── box_iou_rotated_cuda.cu │ │ │ ├── carafe_cuda.cu │ │ │ ├── carafe_naive_cuda.cu │ │ │ ├── chamfer_distance_cuda.cu │ │ │ ├── convex_iou.cu │ │ │ ├── correlation_cuda.cu │ │ │ ├── cudabind.cpp │ │ │ ├── deform_conv_cuda.cu │ │ │ ├── deform_roi_pool_cuda.cu │ │ │ ├── diff_iou_rotated_cuda.cu │ │ │ ├── filtered_lrelu.cu │ │ │ ├── focal_loss_cuda.cu │ │ │ ├── furthest_point_sample_cuda.cu │ │ │ ├── fused_bias_leakyrelu_cuda.cu │ │ │ ├── fused_spconv_ops_cuda.cu │ │ │ ├── gather_points_cuda.cu │ │ │ ├── group_points_cuda.cu │ │ │ ├── iou3d_cuda.cu │ │ │ ├── knn_cuda.cu │ │ │ ├── masked_conv2d_cuda.cu │ │ │ ├── min_area_polygons.cu │ │ │ ├── modulated_deform_conv_cuda.cu │ │ │ ├── ms_deform_attn_cuda.cu │ │ │ ├── nms_cuda.cu │ │ │ ├── nms_quadri_cuda.cu │ │ │ ├── nms_rotated_cuda.cu │ │ │ ├── points_in_boxes_cuda.cu │ │ │ ├── points_in_polygons_cuda.cu │ │ │ ├── prroi_pool_cuda.cu │ │ │ ├── psamask_cuda.cu │ │ │ ├── riroi_align_rotated_cuda.cu │ │ │ ├── roi_align_cuda.cu │ │ │ ├── roi_align_rotated_cuda.cu │ │ │ ├── roi_pool_cuda.cu │ │ │ ├── roiaware_pool3d_cuda.cu │ │ │ ├── roipoint_pool3d_cuda.cu │ │ │ ├── rotated_feature_align_cuda.cu │ │ │ ├── scatter_points_cuda.cu │ │ │ ├── sparse_indice.cu │ │ │ ├── sparse_maxpool.cu │ │ │ ├── sparse_pool_ops_cuda.cu │ │ │ ├── sparse_reordering.cu │ │ │ ├── spconv_ops_cuda.cu │ │ │ ├── stack_ball_query_cuda.cu │ │ │ ├── stack_group_points_cuda.cu │ │ │ ├── sync_bn_cuda.cu │ │ │ ├── three_interpolate_cuda.cu │ │ │ ├── three_nn_cuda.cu │ │ │ ├── tin_shift_cuda.cu │ │ │ ├── upfirdn2d_kernel.cu │ │ │ └── voxelization_cuda.cu │ │ │ ├── deform_conv.cpp │ │ │ ├── deform_roi_pool.cpp │ │ │ ├── diff_iou_rotated.cpp │ │ │ ├── filtered_lrelu.cpp │ │ │ ├── focal_loss.cpp │ │ │ ├── furthest_point_sample.cpp │ │ │ ├── fused_bias_leakyrelu.cpp │ │ │ ├── fused_spconv_ops.cpp │ │ │ ├── gather_points.cpp │ │ │ ├── group_points.cpp │ │ │ ├── info.cpp │ │ │ ├── iou3d.cpp │ │ │ ├── knn.cpp │ │ │ ├── masked_conv2d.cpp │ │ │ ├── min_area_polygons.cpp │ │ │ ├── mlu │ │ │ ├── ball_query_mlu.cpp │ │ │ ├── bbox_overlaps_mlu.cpp │ │ │ ├── box_iou_rotated.cpp │ │ │ ├── carafe_mlu.cpp │ │ │ ├── deform_roi_pool_mlu.cpp │ │ │ ├── diff_iou_rotated_mlu.cpp │ │ │ ├── focal_loss_sigmoid_mlu.cpp │ │ │ ├── iou3d_mlu.cpp │ │ │ ├── masked_conv2d_mlu.cpp │ │ │ ├── mlu_common_helper.cpp │ │ │ ├── mlu_common_helper.h │ │ │ ├── ms_deform_attn_mlu.cpp │ │ │ ├── nms_mlu.cpp │ │ │ ├── nms_rotated_mlu.cpp │ │ │ ├── psamask_mlu.cpp │ │ │ ├── roi_align_mlu.cpp │ │ │ ├── roi_align_rotated_mlu.cpp │ │ │ ├── roi_pool_mlu.cpp │ │ │ ├── roiaware_pool3d_mlu.cpp │ │ │ ├── roipoint_pool3d_mlu.cpp │ │ │ ├── rotated_feature_align_mlu.cpp │ │ │ ├── scatter_points_mlu.cpp │ │ │ ├── sparse_conv_mlu.cpp │ │ │ ├── three_nn_mlu.cpp │ │ │ ├── tin_shift_mlu.cpp │ │ │ └── voxelization_mlu.cpp │ │ │ ├── modulated_deform_conv.cpp │ │ │ ├── mps │ │ │ └── bbox_overlaps_mps.mm │ │ │ ├── ms_deform_attn.cpp │ │ │ ├── musa │ │ │ ├── active_rotated_filter_musa.mu │ │ │ ├── assign_score_withk_musa.mu │ │ │ ├── ball_query_musa.mu │ │ │ ├── bbox_overlaps_musa.mu │ │ │ ├── bezier_align_musa.mu │ │ │ ├── bias_act_musa.mu │ │ │ ├── border_align_musa.mu │ │ │ ├── box_iou_quadri_musa.mu │ │ │ ├── box_iou_rotated_musa.mu │ │ │ ├── carafe_musa.mu │ │ │ ├── carafe_naive_musa.mu │ │ │ ├── chamfer_distance_musa.mu │ │ │ ├── convex_iou.mu │ │ │ ├── correlation_musa.mu │ │ │ ├── deform_conv_musa.mu │ │ │ ├── deform_roi_pool_musa.mu │ │ │ ├── diff_iou_rotated_musa.mu │ │ │ ├── filtered_lrelu.mu │ │ │ ├── focal_loss_musa.mu │ │ │ ├── furthest_point_sample_musa.mu │ │ │ ├── fused_bias_leakyrelu_musa.mu │ │ │ ├── fused_spconv_ops_musa.mu │ │ │ ├── gather_points_musa.mu │ │ │ ├── group_points_musa.mu │ │ │ ├── iou3d_musa.mu │ │ │ ├── knn_musa.mu │ │ │ ├── masked_conv2d_musa.mu │ │ │ ├── min_area_polygons.mu │ │ │ ├── modulated_deform_conv_musa.mu │ │ │ ├── ms_deform_attn_musa.mu │ │ │ ├── musabind.cpp │ │ │ ├── nms_musa.mu │ │ │ ├── nms_quadri_musa.mu │ │ │ ├── nms_rotated_musa.mu │ │ │ ├── points_in_boxes_musa.mu │ │ │ ├── points_in_polygons_musa.mu │ │ │ ├── prroi_pool_musa.mu │ │ │ ├── psamask_musa.mu │ │ │ ├── riroi_align_rotated_musa.mu │ │ │ ├── roi_align_musa.mu │ │ │ ├── roi_align_rotated_musa.mu │ │ │ ├── roi_pool_musa.mu │ │ │ ├── roiaware_pool3d_musa.mu │ │ │ ├── roipoint_pool3d_musa.mu │ │ │ ├── rotated_feature_align_musa.mu │ │ │ ├── scatter_points_musa.mu │ │ │ ├── sparse_indice.mu │ │ │ ├── sparse_maxpool.mu │ │ │ ├── sparse_pool_ops_musa.mu │ │ │ ├── sparse_reordering.mu │ │ │ ├── spconv_ops_musa.mu │ │ │ ├── stack_ball_query_musa.mu │ │ │ ├── stack_group_points_musa.mu │ │ │ ├── sync_bn_musa.mu │ │ │ ├── three_interpolate_musa.mu │ │ │ ├── three_nn_musa.mu │ │ │ ├── tin_shift_musa.mu │ │ │ ├── upfirdn2d_kernel.mu │ │ │ └── voxelization_musa.mu │ │ │ ├── nms.cpp │ │ │ ├── nms_quadri.cpp │ │ │ ├── nms_rotated.cpp │ │ │ ├── npu │ │ │ ├── active_rotated_filter_npu.cpp │ │ │ ├── assign_score_withk_npu.cpp │ │ │ ├── ball_query_npu.cpp │ │ │ ├── bbox_overlaps_npu.cpp │ │ │ ├── border_align_npu.cpp │ │ │ ├── box_iou_quadri_npu.cpp │ │ │ ├── box_iou_rotated_npu.cpp │ │ │ ├── boxes_overlap_bev_npu.cpp │ │ │ ├── chamfer_distance_npu.cpp │ │ │ ├── common_util.h │ │ │ ├── deform_roi_pool.cpp │ │ │ ├── diff_iou_rotated_npu.cpp │ │ │ ├── focal_loss_npu.cpp │ │ │ ├── furthest_point_sample_npu.cpp │ │ │ ├── furthest_point_sampling_with_dist_npu.cpp │ │ │ ├── fused_bias_leakyrelu_npu.cpp │ │ │ ├── gather_points_npu.cpp │ │ │ ├── group_points_npu.cpp │ │ │ ├── knn_npu.cpp │ │ │ ├── ms_deform_attn_npu.cpp │ │ │ ├── nms3d_normal_npu.cpp │ │ │ ├── nms3d_npu.cpp │ │ │ ├── nms_npu.cpp │ │ │ ├── nms_rotated_npu.cpp │ │ │ ├── points_in_box_npu.cpp │ │ │ ├── points_in_box_npu_all.cpp │ │ │ ├── points_in_polygons_npu.cpp │ │ │ ├── psa_mask_npu.cpp │ │ │ ├── roi_align_npu.cpp │ │ │ ├── roi_align_rotated_npu.cpp │ │ │ ├── roi_pool_npu.cpp │ │ │ ├── roiaware_pool3d_npu.cpp │ │ │ ├── roipoint_pool3d_forward.cpp │ │ │ ├── rotated_feature_align_npu.cpp │ │ │ ├── stack_ball_query_npu.cpp │ │ │ ├── stack_group_points_npu.cpp │ │ │ ├── three_interpolate_npu.cpp │ │ │ ├── three_nn_npu.cpp │ │ │ └── voxelization_npu.cpp │ │ │ ├── pixel_group.cpp │ │ │ ├── points_in_boxes.cpp │ │ │ ├── points_in_polygons.cpp │ │ │ ├── prroi_pool.cpp │ │ │ ├── psamask.cpp │ │ │ ├── pybind.cpp │ │ │ ├── riroi_align_rotated.cpp │ │ │ ├── roi_align.cpp │ │ │ ├── roi_align_rotated.cpp │ │ │ ├── roi_pool.cpp │ │ │ ├── roiaware_pool3d.cpp │ │ │ ├── roipoint_pool3d.cpp │ │ │ ├── rotated_feature_align.cpp │ │ │ ├── scatter_points.cpp │ │ │ ├── sparse_pool_ops.cpp │ │ │ ├── spconv_ops.cpp │ │ │ ├── spconv_utils.h │ │ │ ├── sync_bn.cpp │ │ │ ├── three_interpolate.cpp │ │ │ ├── three_nn.cpp │ │ │ ├── tin_shift.cpp │ │ │ ├── upfirdn2d.cpp │ │ │ └── voxelization.cpp │ ├── deform_conv.py │ ├── deform_roi_pool.py │ ├── deprecated_wrappers.py │ ├── diff_iou_rotated.py │ ├── filtered_lrelu.py │ ├── focal_loss.py │ ├── furthest_point_sample.py │ ├── fused_bias_leakyrelu.py │ ├── gather_points.py │ ├── group_points.py │ ├── info.py │ ├── iou3d.py │ ├── knn.py │ ├── masked_conv.py │ ├── merge_cells.py │ ├── min_area_polygons.py │ ├── modulated_deform_conv.py │ ├── multi_scale_deform_attn.py │ ├── nms.py │ ├── pixel_group.py │ ├── point_sample.py │ ├── points_in_boxes.py │ ├── points_in_polygons.py │ ├── points_sampler.py │ ├── prroi_pool.py │ ├── psa_mask.py │ ├── riroi_align_rotated.py │ ├── roi_align.py │ ├── roi_align_rotated.py │ ├── roi_pool.py │ ├── roiaware_pool3d.py │ ├── roipoint_pool3d.py │ ├── rotated_feature_align.py │ ├── saconv.py │ ├── scatter_points.py │ ├── sparse_conv.py │ ├── sparse_functional.py │ ├── sparse_modules.py │ ├── sparse_ops.py │ ├── sparse_pool.py │ ├── sparse_structure.py │ ├── sync_bn.py │ ├── three_interpolate.py │ ├── three_nn.py │ ├── tin_shift.py │ ├── upfirdn2d.py │ └── voxelize.py ├── transforms │ ├── __init__.py │ ├── base.py │ ├── builder.py │ ├── formatting.py │ ├── loading.py │ ├── processing.py │ ├── utils.py │ └── wrappers.py ├── utils │ ├── __init__.py │ ├── device_type.py │ ├── env.py │ ├── ext_loader.py │ └── parrots_jit.py ├── version.py ├── video │ ├── __init__.py │ ├── io.py │ ├── optflow.py │ └── processing.py └── visualization │ ├── __init__.py │ ├── color.py │ ├── image.py │ └── optflow.py ├── requirements.txt ├── requirements ├── build.txt ├── docs.txt ├── optional.txt ├── runtime.txt └── test.txt ├── setup.cfg ├── setup.py └── tests ├── data ├── batched_nms_data.pkl ├── color.jpg ├── color_exif.jpg ├── config │ ├── a.b.py │ ├── a.py │ ├── b.json │ ├── base.py │ ├── c.yaml │ ├── code.py │ ├── d.py │ ├── delete.py │ ├── deprecated.py │ ├── deprecated_as_base.py │ ├── e.py │ ├── expected.py │ ├── f.py │ ├── g.py │ ├── h.py │ ├── i_base.py │ ├── i_child.py │ ├── l.py │ ├── l1.py │ ├── l2.yaml │ ├── l3.json │ ├── l4.py │ ├── m.py │ ├── n.py │ ├── o.json │ ├── p.yaml │ ├── q.py │ ├── r.py │ ├── s.py │ ├── t.json │ ├── t.py │ ├── t.yaml │ ├── u.json │ ├── u.py │ ├── u.yaml │ └── v.py ├── demo.lmdb │ ├── data.mdb │ └── lock.mdb ├── filelist.txt ├── for_3d_ops │ ├── features_for_fps_distance.npy │ ├── fps_idx.npy │ └── test_voxel.npy ├── for_carafe │ ├── carafe_feat.bin │ ├── carafe_feat_grad.bin │ ├── carafe_mask.bin │ ├── carafe_mask_grad.bin │ └── carafe_output.bin ├── for_ccattention │ ├── ccattention_input.bin │ └── ccattention_output.bin ├── for_masked_conv2d │ ├── masked_conv2d_for_bias.npy │ ├── masked_conv2d_for_input.npy │ ├── masked_conv2d_for_mask.npy │ ├── masked_conv2d_for_output.npy │ └── masked_conv2d_for_weight.npy ├── for_psa_mask │ ├── psa_input.bin │ ├── psa_output_collect.bin │ └── psa_output_distribute.bin ├── for_scan │ ├── .file │ ├── 1.json │ ├── 1.txt │ ├── 2.json │ ├── 2.txt │ ├── 3.TXT │ ├── a.bin │ └── sub │ │ ├── 1.json │ │ └── 1.txt ├── gray_alpha.png ├── grayscale.jpg ├── grayscale_dim3.jpg ├── mapping.txt ├── optflow.flo ├── optflow_concat0.jpg ├── optflow_concat1.jpg ├── palette.gif ├── patches │ ├── 0.npy │ ├── 1.npy │ ├── 2.npy │ ├── 3.npy │ ├── 4.npy │ ├── pad0_0.npy │ ├── pad0_1.npy │ ├── pad0_2.npy │ ├── pad0_3.npy │ ├── pad0_4.npy │ ├── pad_0.npy │ ├── pad_1.npy │ ├── pad_2.npy │ ├── pad_3.npy │ ├── pad_4.npy │ ├── scale_0.npy │ ├── scale_1.npy │ ├── scale_2.npy │ ├── scale_3.npy │ └── scale_4.npy ├── scripts │ └── hello.py ├── sparse_flow.png ├── test.mp4 └── uint16-5channel.tif ├── test_arraymisc.py ├── test_cnn ├── test_build_layers.py ├── test_context_block.py ├── test_conv2d_adaptive_padding.py ├── test_conv_module.py ├── test_depthwise_seperable_conv_module.py ├── test_flops_counter.py ├── test_fuse_conv_bn.py ├── test_generalized_attention.py ├── test_hsigmoid.py ├── test_hswish.py ├── test_non_local.py ├── test_rfsearch │ ├── test_operator.py │ └── test_search.py ├── test_scale.py ├── test_silu.py ├── test_swish.py ├── test_transformer.py └── test_wrappers.py ├── test_image ├── test_colorspace.py ├── test_geometric.py ├── test_image_misc.py ├── test_io.py └── test_photometric.py ├── test_ops ├── output.pkl ├── test_active_rotated_filter.py ├── test_assign_score_withk.py ├── test_ball_query.py ├── test_bbox.py ├── test_bezier_align.py ├── test_bias_act.py ├── test_bilinear_grid_sample.py ├── test_border_align.py ├── test_box_iou_quadri.py ├── test_box_iou_rotated.py ├── test_carafe.py ├── test_cc_attention.py ├── test_chamfer_distance.py ├── test_contour_expand.py ├── test_conv_gradfix.py ├── test_convex_iou.py ├── test_corner_pool.py ├── test_correlation.py ├── test_deform_conv.py ├── test_deform_roi_pool.py ├── test_diff_iou_rotated.py ├── test_filtered_lrelu.py ├── test_focal_loss.py ├── test_furthest_point_sample.py ├── test_fused_bias_leakyrelu.py ├── test_gather_points.py ├── test_group_points.py ├── test_info.py ├── test_iou3d.py ├── test_knn.py ├── test_masked_conv2d.py ├── test_merge_cells.py ├── test_min_area_polygons.py ├── test_modulated_deform_conv.py ├── test_ms_deformable_attn.py ├── test_nms.py ├── test_nms_quadri.py ├── test_nms_rotated.py ├── test_onnx.py ├── test_pixel_group.py ├── test_points_in_polygons.py ├── test_prroi_pool.py ├── test_psa_mask.py ├── test_riroi_align_rotated.py ├── test_roi_align.py ├── test_roi_align_rotated.py ├── test_roi_pool.py ├── test_roiaware_pool3d.py ├── test_roipoint_pool3d.py ├── test_rotated_feature_align.py ├── test_saconv.py ├── test_scatter_points.py ├── test_spconv.py ├── test_syncbn.py ├── test_three_interpolate.py ├── test_three_nn.py ├── test_tin_shift.py ├── test_upfirdn2d.py └── test_voxelization.py ├── test_transforms ├── test_transforms_formatting.py ├── test_transforms_loading.py ├── test_transforms_processing.py └── test_transforms_wrapper.py ├── test_utils ├── test_env.py └── test_parrots_jit.py ├── test_video ├── test_optflow.py ├── test_processing.py └── test_reader.py └── test_visualization.py /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | *.egg-info 4 | .eggs/ 5 | .mypy-cache 6 | pip-wheel-metadata 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/3-documentation.yml: -------------------------------------------------------------------------------- 1 | name: 📚 Documentation 2 | description: Report an issue related to the documentation. 3 | labels: "docs" 4 | title: "[Docs] " 5 | 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | ## Note 11 | For general usage questions or idea discussions, please post it to our [**Forum**](https://github.com/open-mmlab/mmcv/discussions) 12 | Please fill in as **much** of the following form as you're able to. **The clearer the description, the shorter it will take to solve it.** 13 | 14 | - type: textarea 15 | attributes: 16 | label: 📚 The doc issue 17 | description: > 18 | A clear and concise description the issue. 19 | validations: 20 | required: true 21 | 22 | - type: textarea 23 | attributes: 24 | label: Suggest a potential alternative/fix 25 | description: > 26 | Tell us how we could improve the documentation in this regard. 27 | 28 | - type: markdown 29 | attributes: 30 | value: | 31 | ## Acknowledgement 32 | Thanks for taking the time to fill out this report. 33 | 34 | If you have already identified the reason, we strongly appreciate you creating a new PR to fix it [**here**](https://github.com/open-mmlab/mmcv/pulls)! 35 | Please refer to [**Contribution Guide**](https://mmcv.readthedocs.io/en/latest/community/contributing.html) for contributing. 36 | 37 | Welcome to join our [**Community(TODO)**](https://mmcv.readthedocs.io/en/latest/contact.html) to discuss together. 👬 38 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | 3 | contact_links: 4 | - name: 💬 Forum 5 | url: https://github.com/open-mmlab/mmcv/discussions 6 | about: Ask general usage questions and discuss with other mmcv community members 7 | - name: MMCV Documentation 8 | url: https://mmcv.readthedocs.io/en/latest/ 9 | about: Check if your question is answered in docs 10 | - name: 🌐 Explore OpenMMLab 11 | url: https://openmmlab.com/ 12 | about: Get know more about OpenMMLab 13 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: lint 2 | 3 | on: [push, pull_request] 4 | 5 | concurrency: 6 | group: ${{ github.workflow }}-${{ github.ref }} 7 | cancel-in-progress: true 8 | 9 | jobs: 10 | lint: 11 | runs-on: ubuntu-22.04 12 | steps: 13 | - uses: actions/checkout@v2 14 | - name: Set up Python 3.10.15 15 | uses: actions/setup-python@v2 16 | with: 17 | python-version: '3.10.15' 18 | - name: Install pre-commit hook 19 | run: | 20 | pip install pre-commit 21 | pre-commit install 22 | - name: Linting 23 | run: pre-commit run --all-files 24 | - name: Format c/cuda codes with clang-format 25 | uses: DoozyX/clang-format-lint-action@v0.18 26 | with: 27 | source: mmcv/ops/csrc 28 | extensions: h,c,cpp,hpp,cu,cuh 29 | style: google 30 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | formats: all 4 | 5 | build: 6 | os: ubuntu-22.04 7 | tools: 8 | python: "3.7" 9 | 10 | python: 11 | install: 12 | - requirements: requirements/runtime.txt 13 | - requirements: requirements/docs.txt 14 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | message: "If you use this software, please cite it as below." 3 | authors: 4 | - name: "MMCV Contributors" 5 | title: "OpenMMLab Computer Vision Foundation" 6 | date-released: 2018-08-22 7 | url: "https://github.com/open-mmlab/mmcv" 8 | license: Apache-2.0 9 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include requirements/runtime.txt 2 | include mmcv/ops/csrc/common/cuda/*.cuh mmcv/ops/csrc/common/cuda/*.hpp mmcv/ops/csrc/common/*.hpp 3 | include mmcv/ops/csrc/pytorch/*.cpp mmcv/ops/csrc/pytorch/cuda/*.cu mmcv/ops/csrc/pytorch/cuda/*.cpp mmcv/ops/csrc/pytorch/cpu/*.cpp 4 | include mmcv/ops/csrc/parrots/*.h mmcv/ops/csrc/parrots/*.cpp 5 | include mmcv/ops/csrc/pytorch/mps/*.mm mmcv/ops/csrc/common/mps/*.h mmcv/ops/csrc/common/mps/*.mm 6 | recursive-include mmcv/ops/csrc/ *.h *.hpp *.cpp *.cuh *.cu *.mm 7 | -------------------------------------------------------------------------------- /TERMINOLOGY.md: -------------------------------------------------------------------------------- 1 | # English-Chinese terminology comparison (英汉术语对照) 2 | 3 | This document is used as a reference for English-Chinese terminology translation. 4 | 5 | 该文档用作中英文翻译对照参考。 6 | 7 | | English | 中文 | 8 | | :---------------: | :----------: | 9 | | annotation | 标注 | 10 | | backbone | 主干网络 | 11 | | benchmark | 基准测试 | 12 | | checkpoint | 模型权重文件 | 13 | | classifier | 分类器 | 14 | | cls_head | 分类头 | 15 | | decoder | 解码器 | 16 | | detector | 检测器 | 17 | | encoder | 编码器 | 18 | | finetune | 微调 | 19 | | ground truth | 真实标签 | 20 | | hook | 钩子 | 21 | | localizer | 定位器 | 22 | | neck | 模型颈部 | 23 | | pipeline | 流水线 | 24 | | recognizer | 识别器 | 25 | | register | 注册器 | 26 | | schedule | 调整 | 27 | | scheduler | 调度器 | 28 | | segmentor | 分割器 | 29 | | tensor | 张量 | 30 | | training schedule | 训练策略 | 31 | -------------------------------------------------------------------------------- /docker/dev/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PYTORCH="1.8.1" 2 | ARG CUDA="10.2" 3 | ARG CUDNN="7" 4 | 5 | FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel 6 | 7 | # To fix GPG key error when running apt-get update 8 | RUN rm /etc/apt/sources.list.d/cuda.list \ 9 | && rm /etc/apt/sources.list.d/nvidia-ml.list \ 10 | && apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub \ 11 | && apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub 12 | 13 | # Install git and system dependencies for opencv-python 14 | RUN apt-get update && apt-get install -y git \ 15 | && apt-get update && apt-get install -y libgl1 libglib2.0-0 16 | 17 | # Install system dependencies for unit tests 18 | RUN apt-get install -y ffmpeg libturbojpeg \ 19 | && apt-get clean \ 20 | && rm -rf /var/lib/apt/lists/* 21 | 22 | # build mmcv from source with develop mode 23 | ARG HTTPS_PROXY="" 24 | ENV https_proxy=${HTTPS_PROXY} 25 | ENV FORCE_CUDA="1" 26 | ARG CUDA_ARCH="" 27 | ENV TORCH_CUDA_ARCH_LIST=${CUDA_ARCH} 28 | RUN git clone https://github.com/open-mmlab/mmcv.git /mmcv 29 | WORKDIR /mmcv 30 | RUN git checkout 2.x && git rev-parse --short HEAD 31 | RUN pip install --no-cache-dir -e .[all] -v && pip install pre-commit && pre-commit install 32 | -------------------------------------------------------------------------------- /docker/release/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PYTORCH="1.8.1" 2 | ARG CUDA="10.2" 3 | ARG CUDNN="7" 4 | 5 | FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel 6 | 7 | # To fix GPG key error when running apt-get update 8 | RUN rm /etc/apt/sources.list.d/cuda.list \ 9 | && rm /etc/apt/sources.list.d/nvidia-ml.list \ 10 | && apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub \ 11 | && apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub 12 | 13 | # Install system dependencies for opencv-python 14 | RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 \ 15 | && apt-get clean \ 16 | && rm -rf /var/lib/apt/lists/* 17 | 18 | # Install mmcv 19 | ARG MMCV="" 20 | RUN if [ "${MMCV}" = "" ]; then pip install -U openmim && mim install 'mmcv>=2.0.0rc1'; else pip install -U openmim && mim install mmcv==${MMCV}; fi 21 | 22 | # Verify the installation 23 | RUN python -c 'import mmcv;print(mmcv.__version__)' 24 | -------------------------------------------------------------------------------- /docs/en/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 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 | -------------------------------------------------------------------------------- /docs/en/_static/community/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmcv/90d83c94cfb967ef162c449faf559616f31f28c2/docs/en/_static/community/1.png -------------------------------------------------------------------------------- /docs/en/_static/community/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmcv/90d83c94cfb967ef162c449faf559616f31f28c2/docs/en/_static/community/2.png -------------------------------------------------------------------------------- /docs/en/_static/community/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmcv/90d83c94cfb967ef162c449faf559616f31f28c2/docs/en/_static/community/3.png -------------------------------------------------------------------------------- /docs/en/_static/css/readthedocs.css: -------------------------------------------------------------------------------- 1 | .header-logo { 2 | background-image: url("../image/mmcv-logo.png"); 3 | background-size: 85px 40px; 4 | height: 40px; 5 | width: 85px; 6 | } 7 | 8 | table.colwidths-auto td { 9 | width: 50% 10 | } 11 | -------------------------------------------------------------------------------- /docs/en/_static/flow_img2toimg1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmcv/90d83c94cfb967ef162c449faf559616f31f28c2/docs/en/_static/flow_img2toimg1.png -------------------------------------------------------------------------------- /docs/en/_static/flow_raw_images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmcv/90d83c94cfb967ef162c449faf559616f31f28c2/docs/en/_static/flow_raw_images.png -------------------------------------------------------------------------------- /docs/en/_static/flow_visualization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmcv/90d83c94cfb967ef162c449faf559616f31f28c2/docs/en/_static/flow_visualization.png -------------------------------------------------------------------------------- /docs/en/_static/flow_warp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmcv/90d83c94cfb967ef162c449faf559616f31f28c2/docs/en/_static/flow_warp.png -------------------------------------------------------------------------------- /docs/en/_static/flow_warp_diff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmcv/90d83c94cfb967ef162c449faf559616f31f28c2/docs/en/_static/flow_warp_diff.png -------------------------------------------------------------------------------- /docs/en/_static/image/mmcv-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmcv/90d83c94cfb967ef162c449faf559616f31f28c2/docs/en/_static/image/mmcv-logo.png -------------------------------------------------------------------------------- /docs/en/_static/parallel_progress.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmcv/90d83c94cfb967ef162c449faf559616f31f28c2/docs/en/_static/parallel_progress.gif -------------------------------------------------------------------------------- /docs/en/_static/parallel_progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmcv/90d83c94cfb967ef162c449faf559616f31f28c2/docs/en/_static/parallel_progress.png -------------------------------------------------------------------------------- /docs/en/_static/progress.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmcv/90d83c94cfb967ef162c449faf559616f31f28c2/docs/en/_static/progress.gif -------------------------------------------------------------------------------- /docs/en/_static/progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmcv/90d83c94cfb967ef162c449faf559616f31f28c2/docs/en/_static/progress.png -------------------------------------------------------------------------------- /docs/en/_templates/classtemplate.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | .. currentmodule:: {{ module }} 4 | 5 | 6 | {{ name | underline}} 7 | 8 | .. autoclass:: {{ name }} 9 | :members: 10 | 11 | 12 | .. 13 | autogenerated from source/_templates/classtemplate.rst 14 | note it does not have :inherited-members: 15 | -------------------------------------------------------------------------------- /docs/en/api/arraymisc.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | mmcv.arraymisc 5 | =================================== 6 | 7 | .. contents:: mmcv.arraymisc 8 | :depth: 2 9 | :local: 10 | :backlinks: top 11 | 12 | .. currentmodule:: mmcv.arraymisc 13 | 14 | .. autosummary:: 15 | :toctree: generated 16 | :nosignatures: 17 | 18 | quantize 19 | dequantize 20 | -------------------------------------------------------------------------------- /docs/en/api/cnn.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | mmcv.cnn 5 | =================================== 6 | 7 | .. contents:: mmcv.cnn 8 | :depth: 2 9 | :local: 10 | :backlinks: top 11 | 12 | .. currentmodule:: mmcv.cnn 13 | 14 | Module 15 | ---------------- 16 | 17 | .. autosummary:: 18 | :toctree: generated 19 | :nosignatures: 20 | :template: classtemplate.rst 21 | 22 | ContextBlock 23 | Conv2d 24 | Conv3d 25 | ConvAWS2d 26 | ConvModule 27 | ConvTranspose2d 28 | ConvTranspose3d 29 | ConvWS2d 30 | DepthwiseSeparableConvModule 31 | GeneralizedAttention 32 | HSigmoid 33 | HSwish 34 | LayerScale 35 | Linear 36 | MaxPool2d 37 | MaxPool3d 38 | NonLocal1d 39 | NonLocal2d 40 | NonLocal3d 41 | Scale 42 | Swish 43 | Conv2dRFSearchOp 44 | 45 | Build Function 46 | ---------------- 47 | 48 | .. autosummary:: 49 | :toctree: generated 50 | :nosignatures: 51 | 52 | build_activation_layer 53 | build_conv_layer 54 | build_norm_layer 55 | build_padding_layer 56 | build_plugin_layer 57 | build_upsample_layer 58 | 59 | Miscellaneous 60 | ---------------- 61 | 62 | .. autosummary:: 63 | :toctree: generated 64 | :nosignatures: 65 | 66 | fuse_conv_bn 67 | conv_ws_2d 68 | is_norm 69 | make_res_layer 70 | make_vgg_layer 71 | get_model_complexity_info 72 | -------------------------------------------------------------------------------- /docs/en/api/transforms.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | mmcv.transforms 5 | =================================== 6 | 7 | .. currentmodule:: mmcv.transforms 8 | 9 | .. autosummary:: 10 | :toctree: generated 11 | :nosignatures: 12 | :template: classtemplate.rst 13 | 14 | BaseTransform 15 | TestTimeAug 16 | 17 | Loading 18 | ---------------- 19 | 20 | .. autosummary:: 21 | :toctree: generated 22 | :nosignatures: 23 | :template: classtemplate.rst 24 | 25 | LoadAnnotations 26 | LoadImageFromFile 27 | 28 | Processing 29 | ---------------- 30 | 31 | .. autosummary:: 32 | :toctree: generated 33 | :nosignatures: 34 | :template: classtemplate.rst 35 | 36 | CenterCrop 37 | MultiScaleFlipAug 38 | Normalize 39 | Pad 40 | RandomChoiceResize 41 | RandomFlip 42 | RandomGrayscale 43 | RandomResize 44 | Resize 45 | ToTensor 46 | ImageToTensor 47 | 48 | Wrapper 49 | ---------------- 50 | 51 | .. autosummary:: 52 | :toctree: generated 53 | :nosignatures: 54 | :template: classtemplate.rst 55 | 56 | Compose 57 | KeyMapper 58 | RandomApply 59 | RandomChoice 60 | TransformBroadcaster 61 | -------------------------------------------------------------------------------- /docs/en/api/utils.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | mmcv.utils 5 | =================================== 6 | 7 | .. contents:: mmcv.utils 8 | :depth: 2 9 | :local: 10 | :backlinks: top 11 | 12 | .. currentmodule:: mmcv.utils 13 | 14 | .. autosummary:: 15 | :toctree: generated 16 | :nosignatures: 17 | 18 | IS_CUDA_AVAILABLE 19 | IS_MLU_AVAILABLE 20 | IS_MPS_AVAILABLE 21 | collect_env 22 | jit 23 | skip_no_elena 24 | -------------------------------------------------------------------------------- /docs/en/api/video.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | mmcv.video 5 | =================================== 6 | 7 | .. contents:: mmcv.video 8 | :depth: 2 9 | :local: 10 | :backlinks: top 11 | 12 | .. currentmodule:: mmcv.video 13 | 14 | IO 15 | ---------------- 16 | 17 | .. autosummary:: 18 | :toctree: generated 19 | :nosignatures: 20 | :template: classtemplate.rst 21 | 22 | VideoReader 23 | Cache 24 | 25 | .. autosummary:: 26 | :toctree: generated 27 | :nosignatures: 28 | 29 | frames2video 30 | 31 | Optical Flow 32 | ---------------- 33 | 34 | .. autosummary:: 35 | :toctree: generated 36 | :nosignatures: 37 | 38 | dequantize_flow 39 | flow_from_bytes 40 | flow_warp 41 | flowread 42 | flowwrite 43 | quantize_flow 44 | sparse_flow_from_bytes 45 | 46 | Video Processing 47 | ---------------- 48 | 49 | .. autosummary:: 50 | :toctree: generated 51 | :nosignatures: 52 | 53 | concat_video 54 | convert_video 55 | cut_video 56 | resize_video 57 | -------------------------------------------------------------------------------- /docs/en/api/visualization.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | mmcv.visualization 5 | =================================== 6 | 7 | .. contents:: mmcv.visualization 8 | :depth: 2 9 | :local: 10 | :backlinks: top 11 | 12 | .. currentmodule:: mmcv.visualization 13 | 14 | Color 15 | ---------------- 16 | 17 | .. autosummary:: 18 | :toctree: generated 19 | :nosignatures: 20 | :template: classtemplate.rst 21 | 22 | Color 23 | 24 | .. autosummary:: 25 | :toctree: generated 26 | :nosignatures: 27 | 28 | color_val 29 | 30 | Image 31 | ---------------- 32 | 33 | .. autosummary:: 34 | :toctree: generated 35 | :nosignatures: 36 | 37 | imshow 38 | imshow_bboxes 39 | imshow_det_bboxes 40 | 41 | Optical Flow 42 | ---------------- 43 | 44 | .. autosummary:: 45 | :toctree: generated 46 | :nosignatures: 47 | 48 | flow2rgb 49 | flowshow 50 | make_color_wheel 51 | -------------------------------------------------------------------------------- /docs/en/community/pr.md: -------------------------------------------------------------------------------- 1 | ## Pull Request (PR) 2 | 3 | Content has been migrated to [contributing guidance](contributing.md). 4 | -------------------------------------------------------------------------------- /docs/en/docutils.conf: -------------------------------------------------------------------------------- 1 | [html writers] 2 | table_style: colwidths-auto 3 | -------------------------------------------------------------------------------- /docs/en/get_started/previous_versions.md: -------------------------------------------------------------------------------- 1 | ## OTHER VERSIONS OF PYTORCH BUILT FOR MMCV-FULL 2 | 3 | We no longer provide `mmcv-full` packages compiled under lower versions of `PyTorch`, but for your convenience, you can find them below. 4 | 5 | ### PyTorch 1.4 6 | 7 | | 1.0.0 \<= mmcv_version \<= 1.2.1 8 | 9 | #### CUDA 10.1 10 | 11 | ```bash 12 | pip install mmcv-full=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.4.0/index.html 13 | ``` 14 | 15 | #### CUDA 9.2 16 | 17 | ```bash 18 | pip install mmcv-full=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.4.0/index.html 19 | ``` 20 | 21 | #### CPU 22 | 23 | ```bash 24 | pip install mmcv-full=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.4.0/index.html 25 | ``` 26 | 27 | ### PyTorch v1.3 28 | 29 | | 1.0.0 \<= mmcv_version \<= 1.3.16 30 | 31 | #### CUDA 10.1 32 | 33 | ```bash 34 | pip install mmcv-full=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.3.0/index.html 35 | ``` 36 | 37 | #### CUDA 9.2 38 | 39 | ```bash 40 | pip install mmcv-full=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.3.0/index.html 41 | ``` 42 | 43 | #### CPU 44 | 45 | ```bash 46 | pip install mmcv-full=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.3.0/index.html 47 | ``` 48 | -------------------------------------------------------------------------------- /docs/en/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/en/mmcv-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmcv/90d83c94cfb967ef162c449faf559616f31f28c2/docs/en/mmcv-logo.png -------------------------------------------------------------------------------- /docs/en/switch_language.md: -------------------------------------------------------------------------------- 1 | ## English 2 | 3 | ## 简体中文 4 | -------------------------------------------------------------------------------- /docs/en/understand_mmcv/visualization.md: -------------------------------------------------------------------------------- 1 | ## Visualization 2 | 3 | `mmcv` can show images and annotations (currently supported types include bounding boxes). 4 | 5 | ```python 6 | # show an image file 7 | mmcv.imshow('a.jpg') 8 | 9 | # show a loaded image 10 | img = np.random.rand(100, 100, 3) 11 | mmcv.imshow(img) 12 | 13 | # show image with bounding boxes 14 | img = np.random.rand(100, 100, 3) 15 | bboxes = np.array([[0, 0, 50, 50], [20, 20, 60, 60]]) 16 | mmcv.imshow_bboxes(img, bboxes) 17 | ``` 18 | 19 | `mmcv` can also visualize special images such as optical flows. 20 | 21 | ```python 22 | flow = mmcv.flowread('test.flo') 23 | mmcv.flowshow(flow) 24 | ``` 25 | -------------------------------------------------------------------------------- /docs/zh_cn/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 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 | -------------------------------------------------------------------------------- /docs/zh_cn/_static/css/readthedocs.css: -------------------------------------------------------------------------------- 1 | .header-logo { 2 | background-image: url("../image/mmcv-logo.png"); 3 | background-size: 85px 40px; 4 | height: 40px; 5 | width: 85px; 6 | } 7 | 8 | table.colwidths-auto td { 9 | width: 50% 10 | } 11 | -------------------------------------------------------------------------------- /docs/zh_cn/_static/image/mmcv-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmcv/90d83c94cfb967ef162c449faf559616f31f28c2/docs/zh_cn/_static/image/mmcv-logo.png -------------------------------------------------------------------------------- /docs/zh_cn/_templates/classtemplate.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | .. currentmodule:: {{ module }} 4 | 5 | 6 | {{ name | underline}} 7 | 8 | .. autoclass:: {{ name }} 9 | :members: 10 | 11 | 12 | .. 13 | autogenerated from source/_templates/classtemplate.rst 14 | note it does not have :inherited-members: 15 | -------------------------------------------------------------------------------- /docs/zh_cn/api/arraymisc.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | mmcv.arraymisc 5 | =================================== 6 | 7 | .. contents:: mmcv.arraymisc 8 | :depth: 2 9 | :local: 10 | :backlinks: top 11 | 12 | .. currentmodule:: mmcv.arraymisc 13 | 14 | .. autosummary:: 15 | :toctree: generated 16 | :nosignatures: 17 | 18 | quantize 19 | dequantize 20 | -------------------------------------------------------------------------------- /docs/zh_cn/api/cnn.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | mmcv.cnn 5 | =================================== 6 | 7 | .. contents:: mmcv.cnn 8 | :depth: 2 9 | :local: 10 | :backlinks: top 11 | 12 | .. currentmodule:: mmcv.cnn 13 | 14 | Module 15 | ---------------- 16 | 17 | .. autosummary:: 18 | :toctree: generated 19 | :nosignatures: 20 | :template: classtemplate.rst 21 | 22 | ContextBlock 23 | Conv2d 24 | Conv3d 25 | ConvAWS2d 26 | ConvModule 27 | ConvTranspose2d 28 | ConvTranspose3d 29 | ConvWS2d 30 | DepthwiseSeparableConvModule 31 | GeneralizedAttention 32 | HSigmoid 33 | HSwish 34 | LayerScale 35 | Linear 36 | MaxPool2d 37 | MaxPool3d 38 | NonLocal1d 39 | NonLocal2d 40 | NonLocal3d 41 | Scale 42 | Swish 43 | Conv2dRFSearchOp 44 | 45 | Build Function 46 | ---------------- 47 | 48 | .. autosummary:: 49 | :toctree: generated 50 | :nosignatures: 51 | 52 | build_activation_layer 53 | build_conv_layer 54 | build_norm_layer 55 | build_padding_layer 56 | build_plugin_layer 57 | build_upsample_layer 58 | 59 | Miscellaneous 60 | ---------------- 61 | 62 | .. autosummary:: 63 | :toctree: generated 64 | :nosignatures: 65 | 66 | fuse_conv_bn 67 | conv_ws_2d 68 | is_norm 69 | make_res_layer 70 | make_vgg_layer 71 | get_model_complexity_info 72 | -------------------------------------------------------------------------------- /docs/zh_cn/api/transforms.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | mmcv.transforms 5 | =================================== 6 | 7 | .. currentmodule:: mmcv.transforms 8 | 9 | .. autosummary:: 10 | :toctree: generated 11 | :nosignatures: 12 | :template: classtemplate.rst 13 | 14 | BaseTransform 15 | TestTimeAug 16 | 17 | Loading 18 | ---------------- 19 | 20 | .. autosummary:: 21 | :toctree: generated 22 | :nosignatures: 23 | :template: classtemplate.rst 24 | 25 | LoadAnnotations 26 | LoadImageFromFile 27 | 28 | Processing 29 | ---------------- 30 | 31 | .. autosummary:: 32 | :toctree: generated 33 | :nosignatures: 34 | :template: classtemplate.rst 35 | 36 | CenterCrop 37 | MultiScaleFlipAug 38 | Normalize 39 | Pad 40 | RandomChoiceResize 41 | RandomFlip 42 | RandomGrayscale 43 | RandomResize 44 | Resize 45 | ToTensor 46 | ImageToTensor 47 | 48 | Wrapper 49 | ---------------- 50 | 51 | .. autosummary:: 52 | :toctree: generated 53 | :nosignatures: 54 | :template: classtemplate.rst 55 | 56 | Compose 57 | KeyMapper 58 | RandomApply 59 | RandomChoice 60 | TransformBroadcaster 61 | -------------------------------------------------------------------------------- /docs/zh_cn/api/utils.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | mmcv.utils 5 | =================================== 6 | 7 | .. contents:: mmcv.utils 8 | :depth: 2 9 | :local: 10 | :backlinks: top 11 | 12 | .. currentmodule:: mmcv.utils 13 | 14 | .. autosummary:: 15 | :toctree: generated 16 | :nosignatures: 17 | 18 | IS_CUDA_AVAILABLE 19 | IS_MLU_AVAILABLE 20 | IS_MPS_AVAILABLE 21 | collect_env 22 | jit 23 | skip_no_elena 24 | -------------------------------------------------------------------------------- /docs/zh_cn/api/video.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | mmcv.video 5 | =================================== 6 | 7 | .. contents:: mmcv.video 8 | :depth: 2 9 | :local: 10 | :backlinks: top 11 | 12 | .. currentmodule:: mmcv.video 13 | 14 | IO 15 | ---------------- 16 | 17 | .. autosummary:: 18 | :toctree: generated 19 | :nosignatures: 20 | :template: classtemplate.rst 21 | 22 | VideoReader 23 | Cache 24 | 25 | .. autosummary:: 26 | :toctree: generated 27 | :nosignatures: 28 | 29 | frames2video 30 | 31 | Optical Flow 32 | ---------------- 33 | 34 | .. autosummary:: 35 | :toctree: generated 36 | :nosignatures: 37 | 38 | dequantize_flow 39 | flow_from_bytes 40 | flow_warp 41 | flowread 42 | flowwrite 43 | quantize_flow 44 | sparse_flow_from_bytes 45 | 46 | Video Processing 47 | ---------------- 48 | 49 | .. autosummary:: 50 | :toctree: generated 51 | :nosignatures: 52 | 53 | concat_video 54 | convert_video 55 | cut_video 56 | resize_video 57 | -------------------------------------------------------------------------------- /docs/zh_cn/api/visualization.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | mmcv.visualization 5 | =================================== 6 | 7 | .. contents:: mmcv.visualization 8 | :depth: 2 9 | :local: 10 | :backlinks: top 11 | 12 | .. currentmodule:: mmcv.visualization 13 | 14 | Color 15 | ---------------- 16 | 17 | .. autosummary:: 18 | :toctree: generated 19 | :nosignatures: 20 | :template: classtemplate.rst 21 | 22 | Color 23 | 24 | .. autosummary:: 25 | :toctree: generated 26 | :nosignatures: 27 | 28 | color_val 29 | 30 | Image 31 | ---------------- 32 | 33 | .. autosummary:: 34 | :toctree: generated 35 | :nosignatures: 36 | 37 | imshow 38 | imshow_bboxes 39 | imshow_det_bboxes 40 | 41 | Optical Flow 42 | ---------------- 43 | 44 | .. autosummary:: 45 | :toctree: generated 46 | :nosignatures: 47 | 48 | flow2rgb 49 | flowshow 50 | make_color_wheel 51 | -------------------------------------------------------------------------------- /docs/zh_cn/community/pr.md: -------------------------------------------------------------------------------- 1 | ## 拉取请求 2 | 3 | 本文档的内容已迁移到[贡献指南](contributing.md)。 4 | -------------------------------------------------------------------------------- /docs/zh_cn/docutils.conf: -------------------------------------------------------------------------------- 1 | [html writers] 2 | table_style: colwidths-auto 3 | -------------------------------------------------------------------------------- /docs/zh_cn/get_started/previous_versions.md: -------------------------------------------------------------------------------- 1 | ## 其他版本的 PyTorch 2 | 3 | 我们不再提供在较低的 `PyTorch` 版本下编译的 `mmcv-full` 包,但为了您的方便,您可以在下面找到它们。 4 | 5 | ### PyTorch 1.4 6 | 7 | | 1.0.0 \<= mmcv_version \<= 1.2.1 8 | 9 | #### CUDA 10.1 10 | 11 | ```bash 12 | pip install mmcv-full=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.4.0/index.html 13 | ``` 14 | 15 | #### CUDA 9.2 16 | 17 | ```bash 18 | pip install mmcv-full=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.4.0/index.html 19 | ``` 20 | 21 | #### CPU 22 | 23 | ```bash 24 | pip install mmcv-full=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.4.0/index.html 25 | ``` 26 | 27 | ### PyTorch v1.3 28 | 29 | | 1.0.0 \<= mmcv_version \<= 1.3.16 30 | 31 | #### CUDA 10.1 32 | 33 | ```bash 34 | pip install mmcv-full=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.3.0/index.html 35 | ``` 36 | 37 | #### CUDA 9.2 38 | 39 | ```bash 40 | pip install mmcv-full=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.3.0/index.html 41 | ``` 42 | 43 | #### CPU 44 | 45 | ```bash 46 | pip install mmcv-full=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.3.0/index.html 47 | ``` 48 | -------------------------------------------------------------------------------- /docs/zh_cn/index.rst: -------------------------------------------------------------------------------- 1 | 欢迎来到 MMCV 的中文文档! 2 | ============================= 3 | 4 | 您可以在页面左下角切换中英文文档。 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | :caption: 介绍与安装 9 | 10 | get_started/introduction.md 11 | get_started/installation.md 12 | get_started/build.md 13 | get_started/article.md 14 | get_started/api_reference.md 15 | 16 | .. toctree:: 17 | :maxdepth: 2 18 | :caption: 深入理解 MMCV 19 | 20 | understand_mmcv/data_process.md 21 | understand_mmcv/data_transform.md 22 | understand_mmcv/visualization.md 23 | understand_mmcv/cnn.md 24 | understand_mmcv/ops.md 25 | 26 | .. toctree:: 27 | :caption: 语言切换 28 | 29 | switch_language.md 30 | 31 | .. toctree:: 32 | :maxdepth: 2 33 | :caption: 兼容性 34 | 35 | compatibility.md 36 | 37 | .. toctree:: 38 | 39 | faq.md 40 | 41 | .. toctree:: 42 | :maxdepth: 2 43 | :caption: 社区 44 | 45 | community/contributing.md 46 | community/pr.md 47 | community/code_style.md 48 | 49 | .. toctree:: 50 | :maxdepth: 1 51 | :caption: API 文档 52 | 53 | mmcv.image 54 | mmcv.video 55 | mmcv.visualization 56 | mmcv.cnn 57 | mmcv.ops 58 | mmcv.transforms 59 | mmcv.arraymisc 60 | mmcv.utils 61 | 62 | 63 | Indices and tables 64 | ================== 65 | 66 | * :ref:`genindex` 67 | * :ref:`search` 68 | -------------------------------------------------------------------------------- /docs/zh_cn/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/zh_cn/mmcv-logo.png: -------------------------------------------------------------------------------- 1 | ../docs/mmcv-logo.png -------------------------------------------------------------------------------- /docs/zh_cn/switch_language.md: -------------------------------------------------------------------------------- 1 | ## English 2 | 3 | ## 简体中文 4 | -------------------------------------------------------------------------------- /docs/zh_cn/understand_mmcv/visualization.md: -------------------------------------------------------------------------------- 1 | ## 可视化 2 | 3 | `mmcv` 可以展示图像以及标注(目前只支持标注框) 4 | 5 | ```python 6 | # 展示图像文件 7 | mmcv.imshow('a.jpg') 8 | 9 | # 展示已加载的图像 10 | img = np.random.rand(100, 100, 3) 11 | mmcv.imshow(img) 12 | 13 | # 展示带有标注框的图像 14 | img = np.random.rand(100, 100, 3) 15 | bboxes = np.array([[0, 0, 50, 50], [20, 20, 60, 60]]) 16 | mmcv.imshow_bboxes(img, bboxes) 17 | ``` 18 | 19 | `mmcv` 也可以展示特殊的图像,例如光流 20 | 21 | ```python 22 | flow = mmcv.flowread('test.flo') 23 | mmcv.flowshow(flow) 24 | ``` 25 | -------------------------------------------------------------------------------- /mmcv/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | # flake8: noqa 3 | from .arraymisc import * 4 | from .image import * 5 | from .transforms import * 6 | from .version import * 7 | from .video import * 8 | from .visualization import * 9 | 10 | # The following modules are not imported to this level, so mmcv may be used 11 | # without PyTorch. 12 | # - op 13 | # - utils 14 | -------------------------------------------------------------------------------- /mmcv/arraymisc/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .quantization import dequantize, quantize 3 | 4 | __all__ = ['quantize', 'dequantize'] 5 | -------------------------------------------------------------------------------- /mmcv/cnn/bricks/hswish.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import torch 3 | import torch.nn as nn 4 | from mmengine.registry import MODELS 5 | from mmengine.utils import digit_version 6 | from mmengine.utils.dl_utils import TORCH_VERSION 7 | 8 | 9 | class HSwish(nn.Module): 10 | """Hard Swish Module. 11 | 12 | This module applies the hard swish function: 13 | 14 | .. math:: 15 | Hswish(x) = x * ReLU6(x + 3) / 6 16 | 17 | Args: 18 | inplace (bool): can optionally do the operation in-place. 19 | Default: False. 20 | 21 | Returns: 22 | Tensor: The output tensor. 23 | """ 24 | 25 | def __init__(self, inplace: bool = False): 26 | super().__init__() 27 | self.act = nn.ReLU6(inplace) 28 | 29 | def forward(self, x: torch.Tensor) -> torch.Tensor: 30 | return x * self.act(x + 3) / 6 31 | 32 | 33 | if (TORCH_VERSION == 'parrots' 34 | or digit_version(TORCH_VERSION) < digit_version('1.7')): 35 | # Hardswish is not supported when PyTorch version < 1.6. 36 | # And Hardswish in PyTorch 1.6 does not support inplace. 37 | MODELS.register_module(module=HSwish) 38 | else: 39 | MODELS.register_module(module=nn.Hardswish, name='HSwish') 40 | -------------------------------------------------------------------------------- /mmcv/cnn/bricks/swish.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import torch 3 | import torch.nn as nn 4 | from mmengine.registry import MODELS 5 | 6 | 7 | @MODELS.register_module() 8 | class Swish(nn.Module): 9 | """Swish Module. 10 | 11 | This module applies the swish function: 12 | 13 | .. math:: 14 | Swish(x) = x * Sigmoid(x) 15 | 16 | Returns: 17 | Tensor: The output tensor. 18 | """ 19 | 20 | def __init__(self): 21 | super().__init__() 22 | 23 | def forward(self, x: torch.Tensor) -> torch.Tensor: 24 | return x * torch.sigmoid(x) 25 | -------------------------------------------------------------------------------- /mmcv/cnn/rfsearch/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .operator import BaseConvRFSearchOp, Conv2dRFSearchOp 3 | from .search import RFSearchHook 4 | 5 | __all__ = ['BaseConvRFSearchOp', 'Conv2dRFSearchOp', 'RFSearchHook'] 6 | -------------------------------------------------------------------------------- /mmcv/cnn/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .flops_counter import get_model_complexity_info 3 | from .fuse_conv_bn import fuse_conv_bn 4 | 5 | __all__ = ['get_model_complexity_info', 'fuse_conv_bn'] 6 | -------------------------------------------------------------------------------- /mmcv/ops/csrc/common/pytorch_cpp_helper.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PYTORCH_CPP_HELPER 2 | #define PYTORCH_CPP_HELPER 3 | #include 4 | 5 | #include 6 | 7 | using namespace at; 8 | 9 | #define CHECK_CUDA(x) \ 10 | TORCH_CHECK(x.device().is_cuda(), #x " must be a CUDA tensor") 11 | #define CHECK_MLU(x) \ 12 | TORCH_CHECK(x.device().type() == at::kMLU, #x " must be a MLU tensor") 13 | #define CHECK_MUSA(x) \ 14 | TORCH_CHECK(x.device().is_privateuseone(), #x " must be a MUSA tensor") 15 | #define CHECK_CPU(x) \ 16 | TORCH_CHECK(x.device().type() == at::kCPU, #x " must be a CPU tensor") 17 | #define CHECK_CONTIGUOUS(x) \ 18 | TORCH_CHECK(x.is_contiguous(), #x " must be contiguous") 19 | #define CHECK_CUDA_INPUT(x) \ 20 | CHECK_CUDA(x); \ 21 | CHECK_CONTIGUOUS(x) 22 | #define CHECK_MLU_INPUT(x) \ 23 | CHECK_MLU(x); \ 24 | CHECK_CONTIGUOUS(x) 25 | #define CHECK_MUSA_INPUT(x) \ 26 | CHECK_MUSA(x); \ 27 | CHECK_CONTIGUOUS(x) 28 | #define CHECK_CPU_INPUT(x) \ 29 | CHECK_CPU(x); \ 30 | CHECK_CONTIGUOUS(x) 31 | 32 | #endif // PYTORCH_CPP_HELPER 33 | -------------------------------------------------------------------------------- /mmcv/ops/csrc/common/pytorch_cuda_helper.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PYTORCH_CUDA_HELPER 2 | #define PYTORCH_CUDA_HELPER 3 | 4 | #include 5 | #ifdef MMCV_WITH_MUSA 6 | #include "common_musa_helper.hpp" 7 | #include "torch_musa/csrc/aten/musa/MUSAContext.h" 8 | #include "torch_musa/csrc/core/MUSAGuard.h" 9 | #include "torch_musa/share/generated_cuda_compatible/aten/src/THC/THCAtomics.muh" 10 | #include "torch_musa/share/generated_cuda_compatible/include/ATen/musa/MUSA_PORT_ApplyUtils.muh" 11 | #else 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | #include "common_cuda_helper.hpp" 19 | #endif 20 | 21 | using at::Half; 22 | using at::Tensor; 23 | using phalf = at::Half; 24 | 25 | #define __PHALF(x) (x) 26 | #define DIVUP(m, n) ((m) / (n) + ((m) % (n) > 0)) 27 | 28 | #endif // PYTORCH_CUDA_HELPER 29 | -------------------------------------------------------------------------------- /mmcv/ops/csrc/common/pytorch_musa_helper.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PYTORCH_MUSA_HELPER 2 | #define PYTORCH_MUSA_HELPER 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #include "common_musa_helper.hpp" 10 | #include "torch_musa/csrc/aten/musa/Exceptions.h" 11 | #include "torch_musa/csrc/aten/musa/MUSAContext.h" 12 | #include "torch_musa/csrc/core/MUSAGuard.h" 13 | 14 | using at::Half; 15 | using at::Tensor; 16 | using phalf = at::Half; 17 | 18 | #define __PHALF(x) (x) 19 | #define DIVUP(m, n) ((m) / (n) + ((m) % (n) > 0)) 20 | 21 | #endif // PYTORCH_CUDA_HELPER 22 | -------------------------------------------------------------------------------- /mmcv/ops/csrc/common/utils/spconv/spconv/mp_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef MP_HELPER_H_ 2 | #define MP_HELPER_H_ 3 | #include 4 | #include 5 | 6 | template 7 | struct mp_list {}; 8 | 9 | template 10 | using mp_list_c = mp_list...>; 11 | 12 | namespace detail { 13 | 14 | template 15 | constexpr F mp_for_each_impl(mp_list, F &&f) { 16 | return std::initializer_list{(f(T()), 0)...}, std::forward(f); 17 | } 18 | 19 | template 20 | constexpr F mp_for_each_impl(mp_list<>, F &&f) { 21 | return std::forward(f); 22 | } 23 | 24 | } // namespace detail 25 | 26 | namespace detail { 27 | 28 | template class B> 29 | struct mp_rename_impl { 30 | // An error "no type named 'type'" here means that the first argument to 31 | // mp_rename is not a list 32 | }; 33 | 34 | template