@@ -162,8 +162,8 @@ def process_detections(self, cloud_path, feature_path, calib_path, hypothesis_na
162
162
full_pcd = cloud_path
163
163
feat = feature_path
164
164
caminfo = calib_path
165
- js = self .detector .process (img , mask , pcd , full_pcd , feat , caminfo , '' , '' ,
166
- str (',' .join (hypothesis_names )))
165
+ js = self .detector .process_apc (img , mask , pcd , full_pcd , feat , caminfo , '' , '' ,
166
+ str (',' .join (hypothesis_names )))
167
167
168
168
# check_call(['rm', pcd])
169
169
# check_call(['rm', pcd.replace('.pcd', '.jpg')])
@@ -234,8 +234,8 @@ def detect_scene(self, image_path, depth_map_path, cloud_path, segment_base, det
234
234
obj_ids .append (obj_id )
235
235
poses .append (d ['zz_pose_map' ][obj_id ])
236
236
237
- viz_img = APCDetector .viz_detections (image_path , obj_ids , poses , rgb_K )
238
- imsave ('detections.png' , viz_img )
237
+ # viz_img = APCDetector.viz_detections(image_path, obj_ids, poses, rgb_K)
238
+ # imsave('detections.png', viz_img)
239
239
240
240
return obj_ids , poses
241
241
@@ -287,7 +287,10 @@ def run_pipeline(self, image_file, depth_file, transform_file, cubbyhole, hypoth
287
287
poses = [self .get_pose_matrix (pose ) for pose in poses ]
288
288
289
289
# Remove data
290
- check_call (['rm' , 'cloud.pcd' , 'features.h5' , 'detection_out.json' , 'detections.png' ])
290
+ check_call (['rm' ,
291
+ # 'cloud.pcd',
292
+ 'features.h5' ,
293
+ 'detection_out.json' ])
291
294
292
295
return obj_ids , poses
293
296
@@ -359,10 +362,14 @@ def process_cubbyhole(self, event):
359
362
print e
360
363
return
361
364
362
- object_poses_json = {obj_id : pose for obj_id , pose in zip (obj_ids , poses )}
363
- object_poses_file = os .path .join (self .object_poses_directory , '{}.json' .format (cubbyhole_name ))
365
+ object_poses_json = {obj_id : np .array (pose ).tolist () for obj_id , pose in zip (obj_ids , poses )}
366
+ object_poses_file = os .path .join (self .object_poses_directory ,
367
+ os .path .basename (event .src_path ))
364
368
with open (object_poses_file , 'w' ) as f :
365
- json .dump (object_poses_json , f )
369
+ json .dump ({
370
+ 'bin_name' : cubbyhole_name ,
371
+ 'object_poses' : object_poses_json
372
+ }, f )
366
373
if self .ssh_object_poses_directory is not None :
367
374
check_call (['scp' , object_poses_file , self .ssh_object_poses_directory ])
368
375
0 commit comments