repo
stringlengths
1
99
file
stringlengths
13
215
code
stringlengths
12
59.2M
file_length
int64
12
59.2M
avg_line_length
float64
3.82
1.48M
max_line_length
int64
12
2.51M
extension_type
stringclasses
1 value
fcaf3d
fcaf3d-master/configs/regnet/hv_pointpillars_regnet-400mf_fpn_sbn-all_2x8_2x_lyft-3d.py
_base_ = [ '../_base_/models/hv_pointpillars_fpn_lyft.py', '../_base_/datasets/lyft-3d.py', '../_base_/schedules/schedule_2x.py', '../_base_/default_runtime.py', ] # model settings model = dict( type='MVXFasterRCNN', pretrained=dict(pts='open-mmlab://regnetx_400mf'), pts_backbone=dict( ...
754
30.458333
79
py
fcaf3d
fcaf3d-master/configs/regnet/hv_pointpillars_regnet-400mf_fpn_sbn-all_range100_2x8_2x_lyft-3d.py
_base_ = [ '../_base_/models/hv_pointpillars_fpn_range100_lyft.py', '../_base_/datasets/range100_lyft-3d.py', '../_base_/schedules/schedule_2x.py', '../_base_/default_runtime.py', ] # model settings model = dict( type='MVXFasterRCNN', pretrained=dict(pts='open-mmlab://regnetx_400mf'), pts_ba...
772
31.208333
79
py
fcaf3d
fcaf3d-master/configs/regnet/hv_pointpillars_regnet-1.6gf_fpn_sbn-all_4x8_2x_nus-3d.py
_base_ = [ '../_base_/models/hv_pointpillars_fpn_nus.py', '../_base_/datasets/nus-3d.py', '../_base_/schedules/schedule_2x.py', '../_base_/default_runtime.py', ] # model settings model = dict( type='MVXFasterRCNN', pretrained=dict(pts='open-mmlab://regnetx_1.6gf'), pts_backbone=dict( ...
703
28.333333
69
py
fcaf3d
fcaf3d-master/configs/mvxnet/dv_mvx-fpn_second_secfpn_adamw_2x8_80e_kitti-3d-3class.py
_base_ = ['../_base_/schedules/cosine.py', '../_base_/default_runtime.py'] # model settings voxel_size = [0.05, 0.05, 0.1] point_cloud_range = [0, -40, -3, 70.4, 40, 1] model = dict( type='DynamicMVXFasterRCNN', img_backbone=dict( type='ResNet', depth=50, num_stages=4, out_indi...
8,599
33.126984
193
py
fcaf3d
fcaf3d-master/configs/_base_/models/cascade_mask_rcnn_r50_fpn.py
# model settings model = dict( type='CascadeRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, ...
6,976
33.711443
79
py
fcaf3d
fcaf3d-master/configs/_base_/models/mask_rcnn_r50_fpn.py
# model settings model = dict( type='MaskRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, ...
4,080
31.648
78
py
fcaf3d
fcaf3d-master/configs/_base_/models/fcos3d.py
model = dict( type='FCOSMono3D', pretrained='open-mmlab://detectron2/resnet101_caffe', backbone=dict( type='ResNet', depth=101, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=False), norm_eval=True, ...
2,272
29.306667
77
py
fcaf3d
fcaf3d-master/configs/_base_/models/imvotenet_image.py
model = dict( type='ImVoteNet', img_backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=False), norm_eval=True, style='caffe'), img_neck=dict( type='FPN...
3,531
31.40367
77
py
fcaf3d
fcaf3d-master/configs/_base_/schedules/cyclic_40e.py
# The schedule is usually used by models trained on KITTI dataset # The learning rate set in the cyclic schedule is the initial learning rate # rather than the max learning rate. Since the target_ratio is (10, 1e-4), # the learning rate will change from 0.0018 to 0.018, than go to 0.0018*1e-4 lr = 0.0018 # The optimiz...
1,572
48.15625
150
py
fcaf3d
fcaf3d-master/configs/imvoxelnet/imvoxelnet_kitti-3d-car.py
model = dict( type='ImVoxelNet', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=False), norm_eval=True, init_cfg=dict(type='Pretrained', checkpoint='torchvisio...
5,125
30.838509
78
py
fcaf3d
fcaf3d-master/configs/free_anchor/hv_pointpillars_regnet-1.6gf_fpn_sbn-all_free-anchor_strong-aug_4x8_3x_nus-3d.py
_base_ = './hv_pointpillars_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py' model = dict( pretrained=dict(pts='open-mmlab://regnetx_1.6gf'), pts_backbone=dict( _delete_=True, type='NoStemRegNet', arch='regnetx_1.6gf', out_indices=(1, 2, 3), frozen_stages=-1, strides=(1...
2,453
34.057143
76
py
fcaf3d
fcaf3d-master/configs/free_anchor/hv_pointpillars_regnet-400mf_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py
_base_ = './hv_pointpillars_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py' model = dict( pretrained=dict(pts='open-mmlab://regnetx_400mf'), pts_backbone=dict( _delete_=True, type='NoStemRegNet', arch='regnetx_400mf', out_indices=(1, 2, 3), frozen_stages=-1, strides=(1...
552
29.722222
69
py
fcaf3d
fcaf3d-master/configs/free_anchor/hv_pointpillars_regnet-3.2gf_fpn_sbn-all_free-anchor_strong-aug_4x8_3x_nus-3d.py
_base_ = './hv_pointpillars_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py' model = dict( pretrained=dict(pts='open-mmlab://regnetx_3.2gf'), pts_backbone=dict( _delete_=True, type='NoStemRegNet', arch='regnetx_3.2gf', out_indices=(1, 2, 3), frozen_stages=-1, strides=(1...
2,452
34.042857
76
py
fcaf3d
fcaf3d-master/configs/free_anchor/hv_pointpillars_regnet-1.6gf_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py
_base_ = './hv_pointpillars_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py' model = dict( pretrained=dict(pts='open-mmlab://regnetx_1.6gf'), pts_backbone=dict( _delete_=True, type='NoStemRegNet', arch='regnetx_1.6gf', out_indices=(1, 2, 3), frozen_stages=-1, strides=(1...
553
29.777778
69
py
fcaf3d
fcaf3d-master/configs/free_anchor/hv_pointpillars_regnet-3.2gf_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py
_base_ = './hv_pointpillars_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py' model = dict( pretrained=dict(pts='open-mmlab://regnetx_3.2gf'), pts_backbone=dict( _delete_=True, type='NoStemRegNet', arch='regnetx_3.2gf', out_indices=(1, 2, 3), frozen_stages=-1, strides=(1...
554
29.833333
69
py
fcaf3d
fcaf3d-master/configs/ssn/hv_ssn_regnet-400mf_secfpn_sbn-all_2x16_2x_nus-3d.py
_base_ = './hv_ssn_secfpn_sbn-all_2x16_2x_nus-3d.py' # model settings model = dict( type='MVXFasterRCNN', pretrained=dict(pts='open-mmlab://regnetx_400mf'), pts_backbone=dict( _delete_=True, type='NoStemRegNet', arch=dict(w0=24, wa=24.48, wm=2.54, group_w=16, depth=22, bot_mul=1.0), ...
627
32.052632
79
py
fcaf3d
fcaf3d-master/configs/ssn/hv_ssn_regnet-400mf_secfpn_sbn-all_1x16_2x_lyft-3d.py
_base_ = './hv_ssn_secfpn_sbn-all_2x16_2x_lyft-3d.py' # model settings model = dict( type='MVXFasterRCNN', pretrained=dict(pts='open-mmlab://regnetx_400mf'), pts_backbone=dict( _delete_=True, type='NoStemRegNet', arch=dict(w0=24, wa=24.48, wm=2.54, group_w=16, depth=22, bot_mul=1.0),...
697
32.238095
79
py
fcaf3d
fcaf3d-master/data/s3dis/collect_indoor3d_data.py
import argparse import mmcv from indoor3d_util import export from os import path as osp parser = argparse.ArgumentParser() parser.add_argument( '--output-folder', default='./s3dis_data', help='output folder of the result.') parser.add_argument( '--data-dir', default='Stanford3dDataset_v1.2_Aligned_...
1,732
34.367347
147
py
fcaf3d
fcaf3d-master/mmdet3d/apis/inference.py
import mmcv import numpy as np import re import torch from copy import deepcopy from mmcv.parallel import collate, scatter from mmcv.runner import load_checkpoint from os import path as osp from mmdet3d.core import (Box3DMode, DepthInstance3DBoxes, LiDARInstance3DBoxes, show_multi_modality_re...
16,971
33.217742
79
py
fcaf3d
fcaf3d-master/mmdet3d/apis/test.py
import mmcv import torch from mmcv.image import tensor2imgs from os import path as osp from mmdet3d.models import (Base3DDetector, Base3DSegmentor, SingleStageMono3DDetector) def single_gpu_test(model, data_loader, show=False, ou...
3,052
35.345238
78
py
fcaf3d
fcaf3d-master/mmdet3d/core/evaluation/seg_eval.py
import numpy as np from mmcv.utils import print_log from terminaltables import AsciiTable def fast_hist(preds, labels, num_classes): """Compute the confusion matrix for every batch. Args: preds (np.ndarray): Prediction labels of points with shape of (num_points, ). labels (np.ndarray...
3,695
27.21374
78
py
fcaf3d
fcaf3d-master/mmdet3d/core/evaluation/indoor_eval.py
import numpy as np import torch from mmcv.utils import print_log from terminaltables import AsciiTable def average_precision(recalls, precisions, mode='area'): """Calculate average precision (for single or multiple scales). Args: recalls (np.ndarray): Recalls with shape of (num_scales, num_dets) \ ...
11,037
34.606452
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/evaluation/kitti_utils/rotate_iou.py
##################### # Based on https://github.com/hongzhenwang/RRPN-revise # Licensed under The MIT License # Author: yanyan, scrin@foxmail.com ##################### import math import numba import numpy as np from numba import cuda @numba.jit(nopython=True) def div_up(m, n): return m // n + (m % n > 0) @cuda...
13,267
34.007916
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/post_processing/merge_augs.py
import torch from mmdet3d.ops.iou3d.iou3d_utils import nms_gpu, nms_normal_gpu from ..bbox import bbox3d2result, bbox3d_mapping_back, xywhr2xyxyr def merge_aug_bboxes_3d(aug_results, img_metas, test_cfg): """Merge augmented detection 3D bboxes and scores. Args: aug_results (list[dict]): The dict of ...
3,447
36.478261
78
py
fcaf3d
fcaf3d-master/mmdet3d/core/post_processing/box3d_nms.py
import numba import numpy as np import torch from mmdet3d.ops.iou3d.iou3d_utils import nms_gpu, nms_normal_gpu def box3d_multiclass_nms(mlvl_bboxes, mlvl_bboxes_for_nms, mlvl_scores, score_thr, max_num, ...
7,959
35.181818
77
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/box_np_ops.py
# TODO: clean the functions in this file and move the APIs into box structures # in the future import numba import numpy as np def camera_to_lidar(points, r_rect, velo2cam): """Convert points in camera coordinate to lidar coordinate. Args: points (np.ndarray, shape=[N, 3]): Points in camera coordina...
33,489
36.377232
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/transforms.py
import torch def bbox3d_mapping_back(bboxes, scale_factor, flip_horizontal, flip_vertical): """Map bboxes from testing scale to original image scale. Args: bboxes (:obj:`BaseInstance3DBoxes`): Boxes to be mapped back. scale_factor (float): Scale factor. flip_horizontal (bool): Whether...
2,366
30.144737
78
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/iou_calculators/iou3d_calculator.py
import torch from mmdet.core.bbox import bbox_overlaps from mmdet.core.bbox.iou_calculators.builder import IOU_CALCULATORS from ..structures import get_box_type @IOU_CALCULATORS.register_module() class BboxOverlapsNearest3D(object): """Nearest 3D IoU Calculator. Note: This IoU calculator first finds...
12,463
37.82866
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/samplers/iou_neg_piecewise_sampler.py
import torch from mmdet.core.bbox.builder import BBOX_SAMPLERS from . import RandomSampler, SamplingResult @BBOX_SAMPLERS.register_module() class IoUNegPiecewiseSampler(RandomSampler): """IoU Piece-wise Sampling. Sampling negtive proposals according to a list of IoU thresholds. The negtive proposals are...
6,813
42.126582
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/coders/anchor_free_bbox_coder.py
import numpy as np import torch from mmdet.core.bbox.builder import BBOX_CODERS from .partial_bin_based_bbox_coder import PartialBinBasedBBoxCoder @BBOX_CODERS.register_module() class AnchorFreeBBoxCoder(PartialBinBasedBBoxCoder): """Anchor free bbox coder for 3D boxes. Args: num_dir_bins (int): Num...
4,319
32.230769
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/coders/groupfree3d_bbox_coder.py
import numpy as np import torch from mmdet.core.bbox.builder import BBOX_CODERS from .partial_bin_based_bbox_coder import PartialBinBasedBBoxCoder @BBOX_CODERS.register_module() class GroupFree3DBBoxCoder(PartialBinBasedBBoxCoder): """Modified partial bin based bbox coder for GroupFree3D. Args: num_...
7,154
36.657895
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/coders/delta_xyzwhlr_bbox_coder.py
import torch from mmdet.core.bbox import BaseBBoxCoder from mmdet.core.bbox.builder import BBOX_CODERS @BBOX_CODERS.register_module() class DeltaXYZWLHRBBoxCoder(BaseBBoxCoder): """Bbox Coder for 3D boxes. Args: code_size (int): The dimension of boxes to be encoded. """ def __init__(self, c...
3,074
32.791209
78
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/coders/centerpoint_bbox_coders.py
import torch from mmdet.core.bbox import BaseBBoxCoder from mmdet.core.bbox.builder import BBOX_CODERS @BBOX_CODERS.register_module() class CenterPointBBoxCoder(BaseBBoxCoder): """Bbox coder for CenterPoint. Args: pc_range (list[float]): Range of point cloud. out_size_factor (int): Downsampl...
8,543
36.473684
78
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/coders/partial_bin_based_bbox_coder.py
import numpy as np import torch from mmdet.core.bbox import BaseBBoxCoder from mmdet.core.bbox.builder import BBOX_CODERS @BBOX_CODERS.register_module() class PartialBinBasedBBoxCoder(BaseBBoxCoder): """Partial bin based bbox coder. Args: num_dir_bins (int): Number of bins to encode direction angle....
9,098
36.755187
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/structures/depth_box3d.py
import numpy as np import torch from mmdet3d.core.points import BasePoints from mmdet3d.ops import points_in_boxes_batch from .base_box3d import BaseInstance3DBoxes from .utils import limit_period, rotation_3d_in_axis class DepthInstance3DBoxes(BaseInstance3DBoxes): """3D boxes of instances in Depth coordinates....
13,616
38.699708
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/structures/cam_box3d.py
import numpy as np import torch from mmdet3d.core.points import BasePoints from .base_box3d import BaseInstance3DBoxes from .utils import limit_period, rotation_3d_in_axis class CameraInstance3DBoxes(BaseInstance3DBoxes): """3D boxes of instances in CAM coordinates. Coordinates in camera: .. code-block...
12,666
38.095679
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/structures/base_box3d.py
import numpy as np import torch from abc import abstractmethod from mmdet3d.ops.iou3d import iou3d_cuda from .utils import limit_period, xywhr2xyxyr class BaseInstance3DBoxes(object): """Base class for 3D Boxes. Note: The box is bottom centered, i.e. the relative position of origin in the bo...
16,447
34.678959
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/structures/utils.py
import numpy as np import torch def limit_period(val, offset=0.5, period=np.pi): """Limit the value into a period for periodic function. Args: val (torch.Tensor): The value to be converted. offset (float, optional): Offset to set the value range. \ Defaults to 0.5. period ...
6,881
34.658031
131
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/structures/box_3d_mode.py
import numpy as np import torch from enum import IntEnum, unique from .base_box3d import BaseInstance3DBoxes from .cam_box3d import CameraInstance3DBoxes from .depth_box3d import DepthInstance3DBoxes from .lidar_box3d import LiDARInstance3DBoxes @unique class Box3DMode(IntEnum): r"""Enum of different ways to rep...
5,980
35.03012
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/structures/lidar_box3d.py
import numpy as np import torch from mmdet3d.core.points import BasePoints from mmdet3d.ops.roiaware_pool3d import points_in_boxes_gpu from .base_box3d import BaseInstance3DBoxes from .utils import limit_period, rotation_3d_in_axis class LiDARInstance3DBoxes(BaseInstance3DBoxes): """3D boxes of instances in LIDA...
10,478
37.811111
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/bbox/structures/coord_3d_mode.py
import numpy as np import torch from enum import IntEnum, unique from mmdet3d.core.points import (BasePoints, CameraPoints, DepthPoints, LiDARPoints) from .base_box3d import BaseInstance3DBoxes from .cam_box3d import CameraInstance3DBoxes from .depth_box3d import DepthInstance3DBoxes f...
10,881
37.725979
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/points/cam_points.py
from .base_points import BasePoints class CameraPoints(BasePoints): """Points of instances in CAM coordinates. Args: tensor (torch.Tensor | np.ndarray | list): a N x points_dim matrix. points_dim (int): Number of the dimension of a point. Each row is (x, y, z). Default to 3. ...
2,818
39.271429
76
py
fcaf3d
fcaf3d-master/mmdet3d/core/points/base_points.py
import numpy as np import torch import warnings from abc import abstractmethod class BasePoints(object): """Base class for Points. Args: tensor (torch.Tensor | np.ndarray | list): a N x points_dim matrix. points_dim (int): Number of the dimension of a point. Each row is (x, y, z)....
16,348
37.02093
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/points/lidar_points.py
from .base_points import BasePoints class LiDARPoints(BasePoints): """Points of instances in LIDAR coordinates. Args: tensor (torch.Tensor | np.ndarray | list): a N x points_dim matrix. points_dim (int): Number of the dimension of a point. Each row is (x, y, z). Default to 3. ...
2,820
39.3
76
py
fcaf3d
fcaf3d-master/mmdet3d/core/points/depth_points.py
from .base_points import BasePoints class DepthPoints(BasePoints): """Points of instances in DEPTH coordinates. Args: tensor (torch.Tensor | np.ndarray | list): a N x points_dim matrix. points_dim (int): Number of the dimension of a point. Each row is (x, y, z). Default to 3. ...
2,820
39.3
76
py
fcaf3d
fcaf3d-master/mmdet3d/core/utils/gaussian.py
import numpy as np import torch def gaussian_2d(shape, sigma=1): """Generate gaussian map. Args: shape (list[int]): Shape of the map. sigma (float): Sigma to generate gaussian map. Defaults to 1. Returns: np.ndarray: Generated gaussian map. """ m, n = [(ss - 1...
2,490
27.965116
74
py
fcaf3d
fcaf3d-master/mmdet3d/core/visualizer/open3d_vis.py
import copy import numpy as np import torch try: import open3d as o3d from open3d import geometry except ImportError: raise ImportError( 'Please run "pip install open3d" to install open3d first.') def _draw_points(points, vis, points_size=2, poin...
17,680
38.911964
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/visualizer/image_vis.py
import copy import cv2 import numpy as np import torch from matplotlib import pyplot as plt def project_pts_on_img(points, raw_img, lidar2img_rt, max_distance=70, thickness=-1): """Project the 3D points cloud on 2D image. ...
7,773
38.262626
79
py
fcaf3d
fcaf3d-master/mmdet3d/core/anchor/anchor_3d_generator.py
import mmcv import torch from mmdet.core.anchor import ANCHOR_GENERATORS @ANCHOR_GENERATORS.register_module() class Anchor3DRangeGenerator(object): """3D Anchor Generator by range. This anchor generator generates anchors by the given range in different feature levels. Due the convention in 3D detect...
17,129
41.40099
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/detectors/base.py
import mmcv import torch from mmcv.parallel import DataContainer as DC from mmcv.runner import auto_fp16 from os import path as osp from mmdet3d.core import Box3DMode, Coord3DMode, show_result from mmdet.models.detectors import BaseDetector class Base3DDetector(BaseDetector): """Base class for detectors.""" ...
4,829
43.722222
78
py
fcaf3d
fcaf3d-master/mmdet3d/models/detectors/single_stage.py
from mmdet.models import DETECTORS, build_backbone, build_head, build_neck from .base import Base3DDetector @DETECTORS.register_module() class SingleStage3DDetector(Base3DDetector): """SingleStage3DDetector. This class serves as a base class for single-stage 3D detectors. Args: backbone (dict): ...
1,973
33.034483
78
py
fcaf3d
fcaf3d-master/mmdet3d/models/detectors/voxelnet.py
import torch from mmcv.runner import force_fp32 from torch.nn import functional as F from mmdet3d.core import bbox3d2result, merge_aug_bboxes_3d from mmdet3d.ops import Voxelization from mmdet.models import DETECTORS from .. import builder from .single_stage import SingleStage3DDetector @DETECTORS.register_module() ...
4,872
36.484615
75
py
fcaf3d
fcaf3d-master/mmdet3d/models/detectors/votenet.py
import torch from mmdet3d.core import bbox3d2result, merge_aug_bboxes_3d from mmdet.models import DETECTORS from .single_stage import SingleStage3DDetector @DETECTORS.register_module() class VoteNet(SingleStage3DDetector): r"""`VoteNet <https://arxiv.org/pdf/1904.09664.pdf>`_ for 3D detection.""" def __init...
3,948
35.906542
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/detectors/h3dnet.py
import torch from mmdet3d.core import merge_aug_bboxes_3d from mmdet.models import DETECTORS from .two_stage import TwoStage3DDetector @DETECTORS.register_module() class H3DNet(TwoStage3DDetector): r"""H3DNet model. Please refer to the `paper <https://arxiv.org/abs/2006.05682>`_ """ def __init__(se...
6,732
37.255682
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/detectors/imvoxelnet.py
import torch from mmdet3d.core import bbox3d2result, build_anchor_generator from mmdet3d.models.fusion_layers.point_fusion import point_sample from mmdet.models import DETECTORS, build_backbone, build_head, build_neck from mmdet.models.detectors import BaseDetector @DETECTORS.register_module() class ImVoxelNet(BaseD...
4,871
34.562044
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/detectors/single_stage_mono3d.py
import mmcv import numpy as np import torch from mmcv.parallel import DataContainer as DC from os import path as osp from mmdet3d.core import (CameraInstance3DBoxes, bbox3d2result, mono_cam_box2vis, show_multi_modality_result) from mmdet.models.builder import DETECTORS from mmdet.models.detec...
9,305
40.918919
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/detectors/groupfree3dnet.py
import torch from mmdet3d.core import bbox3d2result, merge_aug_bboxes_3d from mmdet.models import DETECTORS from .single_stage import SingleStage3DDetector @DETECTORS.register_module() class GroupFree3DNet(SingleStage3DDetector): """`Group-Free 3D <https://arxiv.org/abs/2104.00678>`_.""" def __init__(self, ...
3,972
36.838095
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/detectors/dynamic_voxelnet.py
import torch from mmcv.runner import force_fp32 from torch.nn import functional as F from mmdet.models import DETECTORS from .voxelnet import VoxelNet @DETECTORS.register_module() class DynamicVoxelNet(VoxelNet): r"""VoxelNet using `dynamic voxelization <https://arxiv.org/abs/1910.06528>`_. """ def __in...
2,258
30.816901
82
py
fcaf3d
fcaf3d-master/mmdet3d/models/detectors/mvx_two_stage.py
import mmcv import torch import warnings from mmcv.parallel import DataContainer as DC from mmcv.runner import force_fp32 from os import path as osp from torch.nn import functional as F from mmdet3d.core import (Box3DMode, Coord3DMode, bbox3d2result, merge_aug_bboxes_3d, show_result) from mmd...
20,854
40.461233
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/detectors/mvx_faster_rcnn.py
import torch from mmcv.runner import force_fp32 from torch.nn import functional as F from mmdet.models import DETECTORS from .mvx_two_stage import MVXTwoStageDetector @DETECTORS.register_module() class MVXFasterRCNN(MVXTwoStageDetector): """Multi-modality VoxelNet using Faster R-CNN.""" def __init__(self, *...
1,994
31.704918
78
py
fcaf3d
fcaf3d-master/mmdet3d/models/detectors/imvotenet.py
import numpy as np import torch import warnings from mmdet3d.core import bbox3d2result, merge_aug_bboxes_3d from mmdet3d.models.utils import MLP from mmdet.models import DETECTORS from .. import builder from .base import Base3DDetector def sample_valid_seeds(mask, num_sampled_seed=1024): r"""Randomly sample seed...
35,141
41.751825
146
py
fcaf3d
fcaf3d-master/mmdet3d/models/detectors/parta2.py
import torch from torch.nn import functional as F from mmdet3d.ops import Voxelization from mmdet.models import DETECTORS from .. import builder from .two_stage import TwoStage3DDetector @DETECTORS.register_module() class PartA2(TwoStage3DDetector): r"""Part-A2 detector. Please refer to the `paper <https://...
5,783
37.304636
77
py
fcaf3d
fcaf3d-master/mmdet3d/models/detectors/centerpoint.py
import torch from mmdet3d.core import bbox3d2result, merge_aug_bboxes_3d from mmdet.models import DETECTORS from .mvx_two_stage import MVXTwoStageDetector @DETECTORS.register_module() class CenterPoint(MVXTwoStageDetector): """Base class of Multi-modality VoxelNet.""" def __init__(self, pts...
8,267
41.4
78
py
fcaf3d
fcaf3d-master/mmdet3d/models/middle_encoders/pillar_scatter.py
import torch from mmcv.runner import auto_fp16 from torch import nn from ..builder import MIDDLE_ENCODERS @MIDDLE_ENCODERS.register_module() class PointPillarsScatter(nn.Module): """Point Pillar's Scatter. Converts learned features from dense tensor to sparse pseudo image. Args: in_channels (in...
3,696
35.245098
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/middle_encoders/sparse_encoder.py
from mmcv.runner import auto_fp16 from torch import nn as nn from mmdet3d.ops import SparseBasicBlock, make_sparse_convmodule from mmdet3d.ops import spconv as spconv from ..builder import MIDDLE_ENCODERS @MIDDLE_ENCODERS.register_module() class SparseEncoder(nn.Module): r"""Sparse encoder for SECOND and Part-A2...
8,210
39.25
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/middle_encoders/sparse_unet.py
import torch from mmcv.runner import BaseModule, auto_fp16 from mmdet3d.ops import SparseBasicBlock, make_sparse_convmodule from mmdet3d.ops import spconv as spconv from ..builder import MIDDLE_ENCODERS @MIDDLE_ENCODERS.register_module() class SparseUNet(BaseModule): r"""SparseUNet for PartA^2. See the `pap...
11,665
38.8157
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/voxel_encoders/pillar_encoder.py
import torch from mmcv.cnn import build_norm_layer from mmcv.runner import force_fp32 from torch import nn from mmdet3d.ops import DynamicScatter from ..builder import VOXEL_ENCODERS from .utils import PFNLayer, get_paddings_indicator @VOXEL_ENCODERS.register_module() class PillarFeatureNet(nn.Module): """Pillar...
13,108
41.423948
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/voxel_encoders/utils.py
import torch from mmcv.cnn import build_norm_layer from mmcv.runner import auto_fp16 from torch import nn from torch.nn import functional as F def get_paddings_indicator(actual_num, max_num, axis=0): """Create boolean mask by actually number of a padded tensor. Args: actual_num (torch.Tensor): Actual...
6,747
36.281768
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/voxel_encoders/voxel_encoder.py
import torch from mmcv.cnn import build_norm_layer from mmcv.runner import force_fp32 from torch import nn from mmdet3d.ops import DynamicScatter from .. import builder from ..builder import VOXEL_ENCODERS from .utils import VFELayer, get_paddings_indicator @VOXEL_ENCODERS.register_module() class HardSimpleVFE(nn.Mo...
20,477
41.135802
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/necks/me_fpn.py
import torch from torch import nn import MinkowskiEngine as ME from mmdet.models import NECKS, build_loss @NECKS.register_module() class MEFPN3D(nn.Module): def __init__(self, in_channels, out_channels, voxel_size, n_outs=4, pts...
5,219
39.153846
110
py
fcaf3d
fcaf3d-master/mmdet3d/models/necks/imvoxel_neck.py
from mmcv.cnn import ConvModule from torch import nn from mmdet.models import NECKS @NECKS.register_module() class OutdoorImVoxelNeck(nn.Module): """Neck for ImVoxelNet outdoor scenario. Args: in_channels (int): Input channels of multi-scale feature map. out_channels (int): Output channels o...
3,255
28.6
71
py
fcaf3d
fcaf3d-master/mmdet3d/models/necks/second_fpn.py
import numpy as np import torch from mmcv.cnn import build_conv_layer, build_norm_layer, build_upsample_layer from mmcv.runner import BaseModule, auto_fp16 from torch import nn as nn from mmdet.models import NECKS @NECKS.register_module() class SECONDFPN(BaseModule): """FPN used in SECOND/PointPillars/PartA2/MVX...
3,409
36.472527
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/fusion_layers/coord_transform.py
import torch from functools import partial from mmdet3d.core.points import get_points_type def apply_3d_transformation(pcd, coords_type, img_meta, reverse=False): """Apply transformation to input point cloud. Args: pcd (torch.Tensor): The point cloud to be transformed. coords_type (str): 'DE...
7,607
34.386047
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/fusion_layers/point_fusion.py
import torch from mmcv.cnn import ConvModule from mmcv.runner import BaseModule from torch import nn as nn from torch.nn import functional as F from ..builder import FUSION_LAYERS from . import apply_3d_transformation def point_sample( img_meta, img_features, points, lidar2img_rt, img_scale_facto...
11,891
37.862745
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/fusion_layers/vote_fusion.py
import torch from torch import nn as nn from mmdet3d.core.bbox import points_cam2img from ..builder import FUSION_LAYERS from . import apply_3d_transformation, bbox_2d_transform, coord_2d_transform EPS = 1e-6 @FUSION_LAYERS.register_module() class VoteFusion(nn.Module): """Fuse 2d features from 3d seeds. A...
8,897
43.49
78
py
fcaf3d
fcaf3d-master/mmdet3d/models/decode_heads/decode_head.py
from abc import ABCMeta, abstractmethod from mmcv.cnn import normal_init from mmcv.runner import BaseModule, auto_fp16, force_fp32 from torch import nn as nn from mmseg.models.builder import build_loss class Base3DDecodeHead(BaseModule, metaclass=ABCMeta): """Base class for BaseDecodeHead. Args: cha...
4,329
34.785124
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/decode_heads/pointnet2_head.py
from mmcv.cnn.bricks import ConvModule from torch import nn as nn from mmdet3d.ops import PointFPModule from mmdet.models import HEADS from .decode_head import Base3DDecodeHead @HEADS.register_module() class PointNet2Head(Base3DDecodeHead): r"""PointNet2 decoder head. Decoder head used in `PointNet++ <https...
2,644
31.654321
93
py
fcaf3d
fcaf3d-master/mmdet3d/models/dense_heads/anchor_free_mono3d_head.py
import torch from abc import abstractmethod from mmcv.cnn import ConvModule, bias_init_with_prob, normal_init from mmcv.runner import force_fp32 from torch import nn as nn from mmdet.core import multi_apply from mmdet.models.builder import HEADS, build_loss from .base_mono3d_dense_head import BaseMono3DDenseHead @HE...
22,149
42.093385
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/dense_heads/ssd_3d_head.py
import numpy as np import torch from mmcv.ops.nms import batched_nms from mmcv.runner import force_fp32 from torch.nn import functional as F from mmdet3d.core.bbox.structures import (DepthInstance3DBoxes, LiDARInstance3DBoxes, rotation...
24,862
41.941278
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/dense_heads/vote_head_v2.py
import torch from mmcv.runner import BaseModule, force_fp32 from torch.nn import functional as F from mmdet3d.core.post_processing import aligned_3d_nms from mmdet3d.models.builder import build_loss from mmdet3d.models.losses import chamfer_distance from mmdet3d.models.model_utils import VoteModule from mmdet3d.ops im...
25,898
41.527094
107
py
fcaf3d
fcaf3d-master/mmdet3d/models/dense_heads/fcos_mono3d_head.py
import numpy as np import torch from mmcv.cnn import Scale, normal_init from mmcv.runner import force_fp32 from torch import nn as nn from mmdet3d.core import box3d_multiclass_nms, limit_period, xywhr2xyxyr from mmdet.core import multi_apply from mmdet.models.builder import HEADS, build_loss from .anchor_free_mono3d_h...
42,278
43.598101
113
py
fcaf3d
fcaf3d-master/mmdet3d/models/dense_heads/shape_aware_head.py
import numpy as np import torch import warnings from mmcv.cnn import ConvModule from mmcv.runner import BaseModule from torch import nn as nn from mmdet3d.core import box3d_multiclass_nms, limit_period, xywhr2xyxyr from mmdet.core import multi_apply from mmdet.models import HEADS from ..builder import build_head from ...
21,128
40.187135
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/dense_heads/centerpoint_head.py
import copy import numpy as np import torch from mmcv.cnn import ConvModule, build_conv_layer from mmcv.runner import BaseModule, force_fp32 from torch import nn from mmdet3d.core import (circle_nms, draw_heatmap_gaussian, gaussian_radius, xywhr2xyxyr) from mmdet3d.models import builder from ...
32,307
38.4
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/dense_heads/free_anchor3d_head.py
import torch from mmcv.runner import force_fp32 from torch.nn import functional as F from mmdet3d.core.bbox import bbox_overlaps_nearest_3d from mmdet.models import HEADS from .anchor3d_head import Anchor3DHead from .train_mixins import get_direction_target @HEADS.register_module() class FreeAnchor3DHead(Anchor3DHea...
11,471
39.394366
125
py
fcaf3d
fcaf3d-master/mmdet3d/models/dense_heads/base_conv_bbox_head.py
from mmcv.cnn import ConvModule from mmcv.cnn.bricks import build_conv_layer from mmcv.runner import BaseModule from torch import nn as nn from mmdet.models.builder import HEADS @HEADS.register_module() class BaseConvBboxHead(BaseModule): r"""More general bbox head, with shared conv layers and two optional s...
4,358
32.274809
74
py
fcaf3d
fcaf3d-master/mmdet3d/models/dense_heads/anchor3d_head.py
import numpy as np import torch from mmcv.runner import BaseModule, force_fp32 from torch import nn as nn from mmdet3d.core import (PseudoSampler, box3d_multiclass_nms, limit_period, xywhr2xyxyr) from mmdet.core import (build_anchor_generator, build_assigner, build_bbo...
21,536
40.982456
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/dense_heads/train_mixins.py
import numpy as np import torch from mmdet3d.core import limit_period from mmdet.core import images_to_levels, multi_apply class AnchorTrainMixin(object): """Mixin class for target assigning of dense heads.""" def anchor_target_3d(self, anchor_list, gt_bboxe...
16,690
47.100865
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/dense_heads/parta2_rpn_head.py
from __future__ import division import numpy as np import torch from mmcv.runner import force_fp32 from mmdet3d.core import limit_period, xywhr2xyxyr from mmdet3d.ops.iou3d.iou3d_utils import nms_gpu, nms_normal_gpu from mmdet.models import HEADS from .anchor3d_head import Anchor3DHead @HEADS.register_module() clas...
13,804
43.105431
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/dense_heads/groupfree3d_head.py
import copy import numpy as np import torch from mmcv import ConfigDict from mmcv.cnn import ConvModule from mmcv.cnn.bricks.transformer import (build_positional_encoding, build_transformer_layer) from mmcv.runner import force_fp32 from torch import nn as nn from torch.nn import...
42,018
41.315206
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/dense_heads/vote_head.py
import numpy as np import torch from mmcv.runner import BaseModule, force_fp32 from torch.nn import functional as F from mmdet3d.core.post_processing import aligned_3d_nms from mmdet3d.models.builder import build_loss from mmdet3d.models.losses import chamfer_distance from mmdet3d.models.model_utils import VoteModule ...
28,302
41.689291
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/dense_heads/fcaf3d_neck_with_head.py
import torch from torch import nn import MinkowskiEngine as ME from mmdet.core import BaseAssigner, reduce_mean, build_assigner from mmdet.models.builder import HEADS, build_loss from mmdet.core.bbox.builder import BBOX_ASSIGNERS from mmcv.cnn import Scale, bias_init_with_prob from mmdet3d.core.bbox.structures import ...
19,608
40.989293
111
py
fcaf3d
fcaf3d-master/mmdet3d/models/utils/mlp.py
from mmcv.cnn import ConvModule from mmcv.runner import BaseModule from torch import nn as nn class MLP(BaseModule): """A simple MLP module. Pass features (B, C, N) through an MLP. Args: in_channels (int): Number of channels of input features. Default: 18. conv_channels (tupl...
1,627
30.921569
68
py
fcaf3d
fcaf3d-master/mmdet3d/models/utils/clip_sigmoid.py
import torch def clip_sigmoid(x, eps=1e-4): """Sigmoid function for input feature. Args: x (torch.Tensor): Input feature map with the shape of [B, N, H, W]. eps (float): Lower bound of the range to be clamped to. Defaults to 1e-4. Returns: torch.Tensor: Feature map af...
410
23.176471
75
py
fcaf3d
fcaf3d-master/mmdet3d/models/roi_heads/part_aggregation_roi_head.py
import warnings from torch.nn import functional as F from mmdet3d.core import AssignResult from mmdet3d.core.bbox import bbox3d2result, bbox3d2roi from mmdet.core import build_assigner, build_sampler from mmdet.models import HEADS from ..builder import build_head, build_roi_extractor from .base_3droi_head import Base3...
13,874
41.692308
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/roi_heads/base_3droi_head.py
from abc import ABCMeta, abstractmethod from mmcv.runner import BaseModule class Base3DRoIHead(BaseModule, metaclass=ABCMeta): """Base class for 3d RoIHeads.""" def __init__(self, bbox_head=None, mask_roi_extractor=None, mask_head=None, trai...
2,938
29.298969
78
py
fcaf3d
fcaf3d-master/mmdet3d/models/roi_heads/h3d_roi_head.py
from mmdet3d.core.bbox import bbox3d2result from mmdet.models import HEADS from ..builder import build_head from .base_3droi_head import Base3DRoIHead @HEADS.register_module() class H3DRoIHead(Base3DRoIHead): """H3D roi head for H3DNet. Args: primitive_list (List): Configs of primitive heads. ...
5,603
34.025
78
py
fcaf3d
fcaf3d-master/mmdet3d/models/roi_heads/roi_extractors/single_roiaware_extractor.py
import torch from mmcv.runner import BaseModule from mmdet3d import ops from mmdet.models.builder import ROI_EXTRACTORS @ROI_EXTRACTORS.register_module() class Single3DRoIAwareExtractor(BaseModule): """Point-wise roi-aware Extractor. Extract Point-wise roi features. Args: roi_layer (dict): The ...
1,935
34.851852
76
py
fcaf3d
fcaf3d-master/mmdet3d/models/roi_heads/bbox_heads/parta2_bbox_head.py
import numpy as np import torch from mmcv.cnn import ConvModule, normal_init from mmcv.runner import BaseModule from torch import nn as nn from mmdet3d.core.bbox.structures import (LiDARInstance3DBoxes, rotation_3d_in_axis, xywhr2xyxyr) from mmdet3d.models.builder import build...
24,984
38.976
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/roi_heads/bbox_heads/h3d_bbox_head.py
import torch from mmcv.cnn import ConvModule from mmcv.runner import BaseModule from torch import nn as nn from torch.nn import functional as F from mmdet3d.core.bbox import DepthInstance3DBoxes from mmdet3d.core.post_processing import aligned_3d_nms from mmdet3d.models.builder import build_loss from mmdet3d.models.lo...
40,105
42.311015
79
py
fcaf3d
fcaf3d-master/mmdet3d/models/roi_heads/mask_heads/primitive_head.py
import torch from mmcv.cnn import ConvModule from mmcv.runner import BaseModule from torch import nn as nn from torch.nn import functional as F from mmdet3d.models.builder import build_loss from mmdet3d.models.model_utils import VoteModule from mmdet3d.ops import build_sa_module, furthest_point_sample from mmdet.core ...
42,305
42.795031
79
py