Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ut-amrl/coda-models
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur K Zhang committed Sep 14, 2023
2 parents e661420 + 6671734 commit c7e4df0
Show file tree
Hide file tree
Showing 3 changed files with 236 additions and 4 deletions.
27 changes: 27 additions & 0 deletions docs/GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,33 @@ python -m pcdet.datasets.waymo.waymo_dataset --func create_waymo_infos \

Note that you do not need to install `waymo-open-dataset` if you have already processed the data before and do not need to evaluate with official Waymo Metrics.

# Using Pretrained Models

## Visualize Detector Performance on CODa

Before visualizing object detections on CODa, you will first need to download the pre-trained model weights. Then, run the following command, specifying the path to the model weights.

```
python demo.py --ckpt ../output/da-coda-coda_models/waymocenterhead/pvrcnn_allclass128full_finetune_headfull/coda128bestwaymoLR0.010000OPTadam_onecycle/ckpt/checkpoint_epoch_30.pth
```

## Visualize Detector Performance on Custom Dataset

To visualize the pre-trained model predictions on your dataset. Create a directory named `velodyne` and place the `.bin` files that you would like to use in this directory. Then set the `--data_path` cli argument to the parent directory for your `velodyne` directory. The file structure should look as follows:

```
PARENT_DIRECTORY
├── velodyne
│ ├── "000000.bin"
│ ├── ...
```

Then, run the set the `--ckpt` argument to your model weights path and run the command below to visualize the predictions on Open3D.

```
python demo.py --ckpt ../output/da-coda-coda_models/waymocenterhead/pvrcnn_allclass128full_finetune_headfull/coda128bestwaymoLR0.010000OPTadam_onecycle/ckpt/checkpoint_epoch_30.pth --dataset_name demo --data_path {PARENT_DIRECTORY} --ext .bin
```

## Training & Testing


Expand Down
202 changes: 202 additions & 0 deletions rviz/codaros.rviz
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
Panels:
- Class: rviz/Displays
Help Height: 85
Name: Displays
Property Tree Widget:
Expanded:
- /Global Options1
- /Status1
- /PointCloud21
- /MarkerArray1
Splitter Ratio: 0.5
Tree Height: 1417
- Class: rviz/Selection
Name: Selection
- Class: rviz/Tool Properties
Expanded:
- /2D Pose Estimate1
- /2D Nav Goal1
- /Publish Point1
Name: Tool Properties
Splitter Ratio: 0.5886790156364441
- Class: rviz/Views
Expanded:
- /Current View1
Name: Views
Splitter Ratio: 0.5
- Class: rviz/Time
Name: Time
SyncMode: 0
SyncSource: PointCloud2
Preferences:
PromptSaveOnExit: true
Toolbars:
toolButtonStyle: 2
Visualization Manager:
Class: ""
Displays:
- Alpha: 0.5
Cell Size: 1
Class: rviz/Grid
Color: 160; 160; 164
Enabled: false
Line Style:
Line Width: 0.029999999329447746
Value: Lines
Name: Grid
Normal Cell Count: 0
Offset:
X: 0
Y: 0
Z: 0
Plane: XY
Plane Cell Count: 10
Reference Frame: <Fixed Frame>
Value: false
- Alpha: 0.5
Autocompute Intensity Bounds: true
Autocompute Value Bounds:
Max Value: 6.886433124542236
Min Value: -3.171941041946411
Value: true
Axis: Z
Channel Name: intensity
Class: rviz/PointCloud2
Color: 255; 255; 255
Color Transformer: Intensity
Decay Time: 0
Enabled: true
Invert Rainbow: false
Max Color: 255; 255; 255
Min Color: 0; 0; 0
Name: PointCloud2
Position Transformer: XYZ
Queue Size: 10
Selectable: true
Size (Pixels): 3
Size (m): 0.07000000029802322
Style: Squares
Topic: /coda/ouster/points
Unreliable: false
Use Fixed Frame: true
Use rainbow: true
Value: true
- Class: rviz/MarkerArray
Enabled: true
Marker Topic: /coda/bbox_3d
Name: MarkerArray
Namespaces:
0: true
1: true
10: true
11: true
12: true
13: true
14: true
15: true
16: true
17: true
18: true
19: true
2: true
20: true
21: true
22: true
23: true
24: true
25: true
26: true
27: true
28: true
29: true
3: true
30: true
31: true
32: true
33: true
34: true
35: true
36: true
37: true
38: true
39: true
4: true
40: true
41: true
42: true
43: true
44: true
45: true
5: true
6: true
7: true
8: true
9: true
Queue Size: 100
Value: true
Enabled: true
Global Options:
Background Color: 255; 255; 255
Default Light: true
Fixed Frame: os_sensor
Frame Rate: 30
Name: root
Tools:
- Class: rviz/Interact
Hide Inactive Objects: true
- Class: rviz/MoveCamera
- Class: rviz/Select
- Class: rviz/FocusCamera
- Class: rviz/Measure
- Class: rviz/SetInitialPose
Theta std deviation: 0.2617993950843811
Topic: /initialpose
X std deviation: 0.5
Y std deviation: 0.5
- Class: rviz/SetGoal
Topic: /move_base_simple/goal
- Class: rviz/PublishPoint
Single click: true
Topic: /clicked_point
Value: true
Views:
Current:
Class: rviz/Orbit
Distance: 20.628646850585938
Enable Stereo Rendering:
Stereo Eye Separation: 0.05999999865889549
Stereo Focal Distance: 1
Swap Stereo Eyes: false
Value: false
Field of View: 0.7853981852531433
Focal Point:
X: 2.0638067722320557
Y: -4.552268028259277
Z: 2.7838072776794434
Focal Shape Fixed Size: true
Focal Shape Size: 0.05000000074505806
Invert Z Axis: false
Name: Current View
Near Clip Distance: 0.009999999776482582
Pitch: 0.7197972536087036
Target Frame: <Fixed Frame>
Yaw: 2.2985265254974365
Saved: ~
Window Geometry:
Displays:
collapsed: false
Height: 1748
Hide Left Dock: false
Hide Right Dock: true
QMainWindow State: 000000ff00000000fd00000004000000000000016100000625fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006e00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000004700000625000000f100fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f0000050efc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a0056006900650077007300000000470000050e000000c200fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e1000001970000000300000aa600000040fc0100000002fb0000000800540069006d0065010000000000000aa60000045a00fffffffb0000000800540069006d006501000000000000045000000000000000000000093e0000062500000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
Selection:
collapsed: false
Time:
collapsed: false
Tool Properties:
collapsed: false
Views:
collapsed: true
Width: 2726
X: 72
Y: 34
11 changes: 7 additions & 4 deletions tools/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def __init__(self, dataset_cfg, class_names, training=True, root_path=None, logg
gtbbox_list = glob.glob(str(root_path / "label_all" / f'*.txt'))
# data_file_list = glob.glob(str(root_path / f'*{self.ext}')) if self.root_path.is_dir() else [self.root_path]


data_file_list.sort()
gtbbox_list.sort()
self.sample_file_list = data_file_list
Expand Down Expand Up @@ -96,6 +95,9 @@ def parse_config():
parser.add_argument('--data_path', type=str, default='../data/coda128_allclass_full',
help='specify the point cloud data file or directory')
parser.add_argument('--ckpt', type=str, default=None, help='specify the pretrained model')
parser.add_argument('--show_gt', type=str, default=False, help='Visualize ground truth annotations')
parser.add_argument('--show_preds', type=str, default=True, help='Predict and visualize bounding boxes')
parser.add_argument('--dataset_name', type=str, default="coda", help='Dataloader to use for demo Options: [coda, jrdb, demo]')
parser.add_argument('--ext', type=str, default='.bin', help='specify the extension of your point cloud data file')
parser.add_argument('--stat_path', type=str, default=None, help='specify the root path to each frame true positive, false positive, and false negative results')

Expand All @@ -110,11 +112,11 @@ def main():
logger = common_utils.create_logger()
logger.info('-----------------Quick Demo of OpenPCDet-------------------------')

use_dataset = "coda"
use_dataset = args.dataset_name
gen_video = True
do_preds = True # Set to true to do inference, otherwise just views ground truth
show_preds = True
show_gt = False
show_preds = args.show_preds
show_gt = args.show_gt

if use_dataset=="coda":
demo_dataset = CODataset(
Expand All @@ -131,6 +133,7 @@ def main():
dataset_cfg=cfg.DATA_CONFIG, class_names=cfg.CLASS_NAMES, training=False,
root_path=Path(args.data_path), ext=args.ext, logger=logger
)
color_map = normalize_color(coda_utils.BBOX_ID_TO_COLOR)

model=None
if do_preds:
Expand Down

0 comments on commit c7e4df0

Please sign in to comment.