Skip to content

Commit

Permalink
1. fix cdn integrity problem
Browse files Browse the repository at this point in the history
2. add screenshot for web kitti viewer
3. add other config, this can get 88.20 AP on bev moderate.
  • Loading branch information
traveller59 committed Feb 20, 2019
1 parent 9f7fce4 commit f892b5c
Show file tree
Hide file tree
Showing 6 changed files with 244 additions and 6 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ bev AP:90.12, 87.87, 86.77
3d AP:88.62, 78.31, 76.62
```

```car.fhd.onestage.config``` + 50 epochs + super converge (6.5 hours) + (25 fps in 1080Ti):

```
Car [email protected], 0.70, 0.70:
bbox AP:97.65, 89.59, 88.72
bev AP:90.38, 88.20, 86.98
3d AP:89.16, 78.78, 77.41
```

## Install

Expand Down
190 changes: 190 additions & 0 deletions second/configs/car.fhd.onestage.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
model: {
second: {
voxel_generator {
point_cloud_range : [0, -40, -3, 70.4, 40, 1]
# point_cloud_range : [0, -32.0, -3, 52.8, 32.0, 1]
voxel_size : [0.05, 0.05, 0.1]
max_number_of_points_per_voxel : 5
}

voxel_feature_extractor: {
module_class_name: "VoxelFeatureExtractorV3"
num_filters: [16]
with_distance: false
num_input_features: 4
}
middle_feature_extractor: {
module_class_name: "SpMiddleFHD"
# num_filters_down1: [] # protobuf don't support empty list.
# num_filters_down2: []
downsample_factor: 8
num_input_features: 4
}
rpn: {
module_class_name: "RPNV2"
layer_nums: [5]
layer_strides: [1]
num_filters: [128]
upsample_strides: [1]
num_upsample_filters: [128]
use_groupnorm: false
num_groups: 32
num_input_features: 128
}
loss: {
classification_loss: {
weighted_sigmoid_focal: {
alpha: 0.25
gamma: 2.0
anchorwise_output: true
}
}
localization_loss: {
weighted_smooth_l1: {
sigma: 3.0
code_weight: [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
}
}
classification_weight: 1.0
localization_weight: 2.0
}
# Outputs
use_sigmoid_score: true
encode_background_as_zeros: true
encode_rad_error_by_sin: true

use_direction_classifier: true # this can help for orientation benchmark
direction_loss_weight: 0.2 # enough.
use_aux_classifier: false
# Loss
pos_class_weight: 1.0
neg_class_weight: 1.0

loss_norm_type: NormByNumPositives
# Postprocess
post_center_limit_range: [0, -40, -3.0, 70.4, 40, 0.0]
use_rotate_nms: true
use_multi_class_nms: false
nms_pre_max_size: 1000
nms_post_max_size: 100
nms_score_threshold: 0.3
nms_iou_threshold: 0.01

use_bev: false
num_point_features: 4
without_reflectivity: false
box_coder: {
ground_box3d_coder: {
linear_dim: false
encode_angle_vector: false
}
}
target_assigner: {
anchor_generators: {
anchor_generator_range: {
sizes: [1.6, 3.9, 1.56] # wlh
anchor_ranges: [0, -40.0, -1.78, 70.4, 40.0, -1.78] # carefully set z center
rotations: [0, 1.57] # DON'T modify this unless you are very familiar with my code.
matched_threshold : 0.6
unmatched_threshold : 0.45
class_name: "Car"
}
}
sample_positive_fraction : -1
sample_size : 512
region_similarity_calculator: {
nearest_iou_similarity: {
}
}
}
}
}


train_input_reader: {
max_num_epochs : 160
batch_size: 6
prefetch_size : 25
max_number_of_voxels: 16000 # to support batchsize=2 in 1080Ti
shuffle_points: true
num_workers: 3
groundtruth_localization_noise_std: [1.0, 1.0, 0.5]
# groundtruth_rotation_uniform_noise: [-0.3141592654, 0.3141592654]
# groundtruth_rotation_uniform_noise: [-1.57, 1.57]
groundtruth_rotation_uniform_noise: [-0.78539816, 0.78539816]
global_rotation_uniform_noise: [-0.78539816, 0.78539816]
global_scaling_uniform_noise: [0.95, 1.05]
global_random_rotation_range_per_object: [0, 0] # pi/4 ~ 3pi/4
anchor_area_threshold: -1
remove_points_after_sample: true
groundtruth_points_drop_percentage: 0.0
groundtruth_drop_max_keep_points: 15
database_sampler {
database_info_path: "/media/yy/My Passport/datasets/kitti/kitti_dbinfos_train.pkl"
sample_groups {
name_to_max_num {
key: "Car"
value: 15
}
}
database_prep_steps {
filter_by_min_num_points {
min_num_point_pairs {
key: "Car"
value: 5
}
}
}
database_prep_steps {
filter_by_difficulty {
removed_difficulties: [-1]
}
}
global_random_rotation_range_per_object: [0, 0]
rate: 1.0
}

remove_unknown_examples: false
remove_environment: false
kitti_info_path: "/media/yy/My Passport/datasets/kitti/kitti_infos_train.pkl"
kitti_root_path: "/media/yy/My Passport/datasets/kitti"
}

train_config: {
optimizer: {
adam_optimizer: {
learning_rate: {
one_cycle: {
lr_max: 3e-3
moms: [0.95, 0.85]
div_factor: 10.0
pct_start: 0.4
}
}
weight_decay: 0.01 # super converge. decrease this when you increase steps.
}
fixed_weight_decay: true
use_moving_average: false
}
steps: 30950 # 619 * 50, super converge. increase this to achieve slightly better results
steps_per_eval: 3095 # 619 * 5
save_checkpoints_secs : 1800 # half hour
save_summary_steps : 10
enable_mixed_precision: false # for fp16 training, don't use this.
loss_scale_factor : 512.0
clear_metrics_every_epoch: true
}

eval_input_reader: {
batch_size: 6
max_num_epochs : 160
prefetch_size : 25
max_number_of_voxels: 40000
shuffle_points: false
num_workers: 3
anchor_area_threshold: -1
remove_environment: false
kitti_info_path: "/media/yy/My Passport/datasets/kitti/kitti_infos_val.pkl"
# kitti_info_path: "/media/yy/My Passport/datasets/kitti/kitti_infos_test.pkl"
kitti_root_path: "/media/yy/My Passport/datasets/kitti"
}
15 changes: 10 additions & 5 deletions second/kittiviewer/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@
<title>SECOND Kitti Viewer</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT"
crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-3.3.1.min.js">\x3C/script>');</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/98/three.js" integrity="sha384-BMOR44t8p+yL7NVevEC9pO2y26JB6lv1mKFhit2zvzWq5jZo6RpIcTdg6MUxKQRP"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.7.3/dat.gui.js" integrity="sha384-S7m8CpjFEEXwHzEDZ8XdeFSO0rLzdK8x1e7pLuc2hx5Xr23XnaWvb0p/kIez3mxy"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/5.3.0/math.js" integrity="sha384-YILGCrKtrx9ucVIp2iNy85HZcWysS6pXa+tAW+Jbgxoi3TJJSCrg0fJG5C0AJzJO"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/stats.js/r16/Stats.min.js" integrity="sha384-JIMCcCVEupQBEb9e6o4OAccqY004Vm2uYnOzOlJCyyy/Tl3fVxU/nq2gUimNdloP"
crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/jspanel.css" rel="stylesheet" />
<!-- jsPanel JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jspanel.js" integrity="sha384-2F3fGv9PeamJMmqDMSollVdfQqFsLLru6E0ed+AOHOq3tB2IyUDSyllqrQJqx2vp"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js" integrity="sha384-8kKqrPvADL3/ZYJGtcqeG+fveXaJxTaI7LF1/a9QGZpkRVZSurP858KKE6rtnLLs"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js" integrity="sha384-R4v5onSW2o3yhiPYUPN9ssGd9OmZdGRIdLmZgGst3fp0NhJDxYSSErv0YzWdeC/l" crossorigin="anonymous"></script>
<script>window.Cookies || document.write('<script src="js/libs/js.cookie.min.js">\x3C/script>');</script>

<script src="js/MapControls.js"></script>
<script src="js/SimplePlot.js"></script>
Expand Down Expand Up @@ -79,7 +79,8 @@


var renderer = new THREE.WebGLRenderer({
antialias: true
antialias: true,
preserveDrawingBuffer: true
});
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
Expand Down Expand Up @@ -319,6 +320,10 @@
kittiGui.add(viewer, "prev");
*/
kittiGui.add(viewer, "inference");
viewer.screenshot = function(){
viewer.saveAsImage(renderer);
};
kittiGui.add(viewer, "screenshot");
kittiGui.open();
var postGui = gui.addFolder("effect");
postGui.add(postParams, "exposure", 0.1, 2).onChange(function (value) {
Expand Down
27 changes: 26 additions & 1 deletion second/kittiviewer/frontend/js/KittiViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var KittiViewer = function (pointCloud, logger, imageCanvas) {
this.rootPath = "/path/to/kitti";
this.infoPath = "/path/to/infos.pkl";
this.detPath = "/path/to/results.pkl";
this.backend = "http://127.0.0.1:7000";
this.backend = "http://127.0.0.1:16666";
this.checkpointPath = "/path/to/tckpt";
this.configPath = "/path/to/config";
this.drawDet = false;
Expand Down Expand Up @@ -340,5 +340,30 @@ KittiViewer.prototype = {
};
image.src = this.image;

},
saveAsImage: function(renderer) {
var imgData, imgNode;
try {
var strMime = "image/jpeg";
var strDownloadMime = "image/octet-stream";
imgData = renderer.domElement.toDataURL(strMime);
this.saveFile(imgData.replace(strMime, strDownloadMime), `pc_${this.imageIndex}.jpg`);
} catch (e) {
console.log(e);
return;
}
},
saveFile : function (strData, filename) {
var link = document.createElement('a');
if (typeof link.download === 'string') {
document.body.appendChild(link); //Firefox requires the link to be in the body
link.download = filename;
link.href = strData;
link.click();
document.body.removeChild(link); //remove the link when done
} else {
location.replace(uri);
}
}

}
2 changes: 2 additions & 0 deletions second/kittiviewer/frontend/js/libs/jquery-3.3.1.min.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions second/kittiviewer/frontend/js/libs/js.cookie.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f892b5c

Please sign in to comment.