Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
.ipynb_checkpoints
__pycache__/
20 changes: 12 additions & 8 deletions 3D_projection/projection.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
from transforms import affine_matrix_from_points
from argoverse.data_loading.argoverse_tracking_loader import ArgoverseTrackingLoader
from scipy.spatial import transform
import os

#flags that determine which ring cameras to use
use_fc, use_fl, use_sl, use_rl, use_rr, use_sr, use_fr = [1, 1, 0, 0, 0, 0, 0]

#path to the argoverse dataset
tracking_dataset_dir = '../argoverse-tracking/sample/'

tracking_dataset_dir = '~/argoverse-tracking/sample/'
tracking_dataset_dir = os.path.expanduser(tracking_dataset_dir)
#log_index determines which log in the argoverse dataset directory to use
#index 0 is the first log in $tracking_dataset_dir, and index 1 is the second log
log_index = 2
log_index = 0
argoverse_loader = ArgoverseTrackingLoader(tracking_dataset_dir)
log_id = argoverse_loader.log_list[log_index]
argoverse_data = argoverse_loader[log_index]

#colmap_output_dir points to the results from COLMAP
colmap_output_dir = 'reconstruction/sparse/' + log_id + '/'
colmap_output_dir = '~/argoverse-tracking/sample/output/'
colmap_output_dir = os.path.expanduser(colmap_output_dir)

#detection results directory
detection_output_dir = './'
detection_output_dir = '~/argoverse-tracking/sample/detector_output/'
detection_output_dir = os.path.expanduser(detection_output_dir)

#where to save computed traffic sign locations
location_output_dir = './'
location_output_dir = '~/argoverse-tracking/sample/projection_output/'
location_output_dir = os.path.expanduser(location_output_dir)




#loading argoverse HD map
import matplotlib
import matplotlib.pyplot as plt
from visualize_30hz_benchmark_data_on_map import DatasetOnMapVisualizer
from argoverse.map_representation.map_api import ArgoverseMap
am = ArgoverseMap()
city_name = argoverse_data.city_name
Expand All @@ -40,7 +43,6 @@
import logging
logger = logging.getLogger()
logger.setLevel(logging.CRITICAL)
domv = DatasetOnMapVisualizer(dataset_dir, experiment_prefix, use_existing_files=use_existing_files, log_id=argoverse_data.current_log)



Expand Down Expand Up @@ -334,6 +336,8 @@ def bbox2argoverse(x1,y1,x2,y2,points_colmap,points3D,M,image_name):
colmap_camera_poses = points_3d_colmap
argo_camera_poses = points_3d_argo

if not os.path.exists(location_output_dir):
os.makedirs(location_output_dir)
np.savez(location_output_dir + log_id+'_projected.npz',
argo_mark_poses=argo_mark_poses,
colmap_mark_poses=colmap_mark_poses,
Expand Down
Loading