← Back to the animated process

scripts/collect_process/README.md

Implementation snapshot supporting the published lesson. Workflow guide. Configuration and recorded examples describe this project snapshot.

1# Collection process23Run one script at a time from this folder. With no arguments, all scripts use4the existing `my_object_20260925_r2` session and `my_object` category. Each also accepts5`[SESSION] [CATEGORY]`; a different session uses its own name as the default6category. `COLLECT_SESSION` and `COLLECT_CATEGORY` can set these defaults in the7environment. Additional arguments are passed to the underlying Python command8(or ROS launch in step 7). Nothing starts automatically.910Gemini 305 is now the default camera. The existing L515 capture calibration11cannot be resumed with Gemini. For new captures, specify a new session, for12example `01_capture.sh my_object_gemini305 my_object --camera-backend orbbec`,13and use that session/category for subsequent collection steps. The original14session and pinned models/reference remain available for step 7 live tracking15with the new camera intrinsics. See [Gemini 305 migration](../../docs/GEMINI305_CAMERA.md).1617```bash18scripts/collect_process/01_capture.sh19scripts/collect_process/02_generate_masks.sh20scripts/collect_process/03_export_yolo.sh21scripts/collect_process/04_build_reference.sh22scripts/collect_process/05_train_segmentation.sh23scripts/collect_process/06_train_pose.sh24scripts/collect_process/07_run_live.sh25```2627Step 1 is interactive: set the box, remove setup tags, and capture RGB-D views.28Keep the object and table tags fixed after calibration. `P` optionally records a29moving-camera TSDF scan for diagnostics; that scan is not the production GICP30reference. It defaults to CUDA, full RGB-D resolution, and a 60-second stall31watchdog. `01b_edit_reference.sh SESSION CATEGORY` reopens its diagnostic crop32UI without starting the camera.3334Step 2 writes mask previews; inspect every image in35`datasets/SESSION/centerpose_masks/review/` before continuing. Step 3 exports36paired segmentation and eight-keypoint labels. Step 4 fuses the masked RGB-D37captures using each saved `T_camera_object` into a TSDF reference directly in38the calibrated `box_center` frame. It crops automatically to the metric box39plus 3 mm and needs no manual axis or crop adjustment. It refuses to replace an40existing reference directory; archive an older export before rerunning it.41`04_align_reference.sh` remains as an alias for this new step.42If the fused PLY has isolated defect points, run `04b_crop_reference.sh` to43crop only its geometry in the browser. It locks the calibrated frame, saves a44timestamped backup of the original bundle, and updates the reference point45count and bundle metadata when you save. Review the retained point count46before saving; the crop keeps points inside its box.4748Steps 5 and 6 train the separate YOLO models. Before either training starts,49the scripts save `calibration.json` and `object_keypoints.yaml` under50`datasets/SESSION/training_pnp/`, with hashes in `manifest.json`. An existing51snapshot is reused only when the current inputs still match; a changed box52requires a new session. Step 7 launches the live camera and tracking using53the saved PnP keypoints. It checks the snapshot hashes and verifies that its54eight corners and the production reference share `box_center` before starting55ROS. Reconfiguring the collection later cannot change the live PnP geometry.56Step 7 publishes the camera image with the projected 3D wireframe at57`/object_pose/box_image`. Its default camera publication cap is 20 Hz; pass58`camera_rate:=15` after the category to choose another cap. Camera capture59prefers 30 FPS; output rate depends on inference and tracking. Pass60`camera_backend:=orbbec camera_serial:=SERIAL` to select Gemini explicitly, or61`camera_backend:=realsense` for the legacy L515.6263Step 6 starts from the previously successful pose checkpoint. To use another64checkpoint, set `POSE_START_WEIGHTS=/absolute/path/to/best.pt` for that command.65Training commands create new run directories by default, so choose a new66session name for a new collection. For a headless live run, append67`rviz:=false` to step 7.6869The capture script uses the current 14 mm setup tags, 28 mm permanent tags,70and `tagStandard41h12` IDs. Pass different collector options after the category71when your printed tags differ. See `docs/TURNTABLE_POSE_DATASET.md` for the72physical layout and controls.73