danieladebi commited on
Commit
98dd9e1
·
verified ·
1 Parent(s): 08dfce6

Update README.md

Browse files

updated model info and path directory material. Github has most info you need.

Files changed (1) hide show
  1. README.md +46 -40
README.md CHANGED
@@ -1,11 +1,11 @@
1
  ---
 
2
  tags:
3
  - computer-vision
4
  - robotics
5
  - articulated-objects
6
  language:
7
  - en
8
- license: mit
9
  ---
10
 
11
  # L-CAMP: Language-Conditioned Axis and Motion Prediction for Articulated Object Manipulation
@@ -24,28 +24,45 @@ To use it, download `lcamp_model.pt` from the Files tab and place it in a `check
24
 
25
  ## Setup
26
 
27
- 1. Clone the [GitHub repo](https://github.com/UTNuclearRobotics/l_camp) and create the conda/micromamba environment from `environment_lcamp.yml`:
28
  ```bash
29
- micromamba create -f environment_lcamp.yml # or: conda env create -f environment_lcamp.yml
30
- micromamba activate lcamp
31
  ```
32
  2. Build the LCAMP dataset (only needed once per dataset version), see
33
- `process_lcamp_dataset.py` / `process_lcamp_dataset.slurm`. This produces a
34
- dataset directory containing `train_dataset.json`, `test_dataset.json`,
35
- and `intrinsics.npy`, referenced below as `--data_root`/`--data_dir`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  All commands below (`train.py`, `eval.py`) assume the `lcamp` environment is
38
  active.
39
 
40
  ## Training
41
 
42
- If you'd rather train your own checkpoint instead of using this one, training is done with `train.py` via `torchrun` (DDP). The dataset must already be built (see `process_lcamp_dataset.py` / `process_lcamp_dataset.slurm`) as a directory containing `train_dataset.json`, `test_dataset.json`, and `intrinsics.npy`.
43
 
44
- Single-GPU / local run:
 
45
  ```bash
46
- torchrun --nproc_per_node=1 train.py \
47
  --save_path checkpoints/my_lcamp_model \
48
- --data_root ./lcamp_dataset_limited_dataset \
49
  --model_type resnet \
50
  --epochs 50 \
51
  --batch_size 64 \
@@ -55,36 +72,13 @@ torchrun --nproc_per_node=1 train.py \
55
  --use_depth \
56
  --use_text_instructions \
57
  --emphasize_part_mask \
 
 
58
  --lambda_axis 8 \
59
- --lambda_anchor 2 \
60
  --lambda_joint 1
61
  ```
62
 
63
- Multi-GPU (cluster) example:
64
- ```bash
65
- torchrun --nproc_per_node=8 train.py \
66
- --save_path "$SCRATCH/lcamp_model_RGB_log_norm_DEPTH_NO_AXIS_SYMMETRY" \
67
- --data_root "$SCRATCH/lcamp_dataset_off_target_depth_LANGUAGE_EXPLICIT_OBJ_CMDS" \
68
- --model_type resnet \
69
- --epochs 50 \
70
- --warmup_epochs 5 \
71
- --batch_size 256 \
72
- --lr 1e-3 \
73
- --min_lr 1e-5 \
74
- --use_camera_frame \
75
- --use_depth \
76
- --use_text_instructions \
77
- --emphasize_part_mask \
78
- --randomize_background \
79
- --lambda_axis 8 \
80
- --lambda_anchor 4 \
81
- --lambda_joint 1 \
82
- --lambda_plucker 0 \
83
- --log_dir "$SCRATCH/train_logs" \
84
- --cluster_loc "stampede3"
85
- ```
86
- See `train.slurm` / `train_h100.slurm` in the GitHub repo for full Slurm submission scripts (note: those scripts currently hold older `--lr`/`--lambda_anchor`/`--lambda_joint` values, update them if you want the Slurm jobs to match the above).
87
-
88
  Notable flags (`train.py --help` for the complete list):
89
  - `--model_type`: `resnet` (default LCAMP backbone) or `dino`.
90
  - `--use_text_instructions`: enables the language-conditioned model
@@ -94,10 +88,20 @@ Notable flags (`train.py --help` for the complete list):
94
  - `--bbox_loc`: predict axis location as `(u,v,z)` decoded via the part
95
  bounding box instead of raw XYZ, must match `--bbox_loc` in `eval.py` and
96
  `use_bbox_loc` in `lcamp_service_node.py`/`lcamp.launch.py` for the same
97
- checkpoint.
 
98
  - `--resume` / `--resume_from <path>`: resume from `checkpoint_best.pt` in
99
  `--save_path`, or from an explicit checkpoint path.
100
  - `--save_freq`, `--eval_freq`: checkpoint/eval cadence in epochs.
 
 
 
 
 
 
 
 
 
101
 
102
  Checkpoints are written to `--save_path` as `checkpoint_best.pt`,
103
  `checkpoint_last.pt`, and periodic `checkpoint_{epoch}.pt` files.
@@ -108,12 +112,14 @@ Evaluation is done with `eval.py` (single process, no DDP). To evaluate this che
108
  ```bash
109
  python eval.py \
110
  --model_path checkpoints/lcamp_model.pt \
111
- --data_dir ./lcamp_dataset_limited_dataset \
112
  --split test \
113
  --model_type resnet \
114
  --use_camera_frame \
115
  --use_depth \
116
  --use_text_instructions \
 
 
117
  --visualize
118
  ```
119
 
@@ -144,4 +150,4 @@ launch file for details on `use_bbox_loc` and other runtime flags).
144
 
145
  Running predictions on a real Boston Dynamics Spot (via the ROS2 service node
146
  in `scripts/lcamp_service_node.py`) is outside the scope of this model card,
147
- see [ros2_setup/ROS2_SETUP.md](https://github.com/UTNuclearRobotics/l_camp/blob/main/ros2_setup/ROS2_SETUP.md) in the GitHub repo for that setup.
 
1
  ---
2
+ license: apache-2.0
3
  tags:
4
  - computer-vision
5
  - robotics
6
  - articulated-objects
7
  language:
8
  - en
 
9
  ---
10
 
11
  # L-CAMP: Language-Conditioned Axis and Motion Prediction for Articulated Object Manipulation
 
24
 
25
  ## Setup
26
 
27
+ 1. Clone the [GitHub repo](https://github.com/UTNuclearRobotics/l_camp) and create the conda environment from `environment_lcamp.yml`:
28
  ```bash
29
+ conda create -f environment_lcamp.yml
30
+ conda activate lcamp
31
  ```
32
  2. Build the LCAMP dataset (only needed once per dataset version), see
33
+ `process_lcamp_dataset.py`. Whatever path you pass as its `--data_dir` is
34
+ the dataset directory (containing `train_dataset.json`, `test_dataset.json`,
35
+ and `intrinsics.npy`) referenced below as `<DATASET_DIR>`
36
+ (`--data_root`/`--data_dir` in `train.py`/`eval.py`).
37
+ 3. Get the background images: `LCAMPDataset` (in `lcamp_dataset.py`)
38
+ unconditionally loads a background image list on init (used for the
39
+ `--randomize_background`/`--random_backgrounds` augmentation, but read
40
+ regardless), sourced from the
41
+ [MIT Indoor 67](http://web.mit.edu/torralba/www/indoor.html) scene dataset.
42
+ From that page, download the images archive and the `TrainImages.txt` /
43
+ `TestImages.txt` split files, then lay them out as:
44
+ ```
45
+ backgrounds/mit_indoor_67/TrainImages.txt
46
+ backgrounds/mit_indoor_67/TestImages.txt
47
+ backgrounds/mit_indoor_67/raw/Images/<category>/<image>.jpg
48
+ ```
49
+ relative to wherever you run `train.py`/`eval.py` from (or under
50
+ `$SCRATCH/backgrounds/mit_indoor_67/...` if using `--cluster_loc
51
+ stampede3` — see the `--cluster_loc` note below).
52
 
53
  All commands below (`train.py`, `eval.py`) assume the `lcamp` environment is
54
  active.
55
 
56
  ## Training
57
 
58
+ If you'd rather train your own checkpoint instead of using this one, training is done with `train.py` via `torchrun` (DDP). The dataset must already be built (see `process_lcamp_dataset.py`) as a directory containing `train_dataset.json`, `test_dataset.json`, and `intrinsics.npy`.
59
 
60
+ Set `--nproc_per_node` to the number of GPUs on your machine (use `1` for a
61
+ single-GPU/local run):
62
  ```bash
63
+ torchrun --nproc_per_node=<NUM_GPUS> train.py \
64
  --save_path checkpoints/my_lcamp_model \
65
+ --data_root <DATASET_DIR> \
66
  --model_type resnet \
67
  --epochs 50 \
68
  --batch_size 64 \
 
72
  --use_depth \
73
  --use_text_instructions \
74
  --emphasize_part_mask \
75
+ --bbox_loc \
76
+ --cluster_loc <CLUSTER_LOC> \
77
  --lambda_axis 8 \
78
+ --lambda_anchor 8 \
79
  --lambda_joint 1
80
  ```
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  Notable flags (`train.py --help` for the complete list):
83
  - `--model_type`: `resnet` (default LCAMP backbone) or `dino`.
84
  - `--use_text_instructions`: enables the language-conditioned model
 
88
  - `--bbox_loc`: predict axis location as `(u,v,z)` decoded via the part
89
  bounding box instead of raw XYZ, must match `--bbox_loc` in `eval.py` and
90
  `use_bbox_loc` in `lcamp_service_node.py`/`lcamp.launch.py` for the same
91
+ checkpoint. Whenever this is active, pass `--bbox_loc` explicitly so the
92
+ flag stays consistent across `train.py`/`eval.py`/deployment.
93
  - `--resume` / `--resume_from <path>`: resume from `checkpoint_best.pt` in
94
  `--save_path`, or from an explicit checkpoint path.
95
  - `--save_freq`, `--eval_freq`: checkpoint/eval cadence in epochs.
96
+ - `--cluster_loc`: the dataset JSON (from `process_lcamp_dataset.py`) stores
97
+ absolute file paths for the rgb/depth/mask files, so if you're loading the
98
+ dataset on a different machine/path layout than where it was built, those
99
+ paths won't resolve. `nrg` (default) uses the JSON paths as-is, `stampede3`
100
+ is a legacy alias for `$SCRATCH`. For anything else, just pass your own
101
+ dataset root directory as `--cluster_loc /path/to/your/root` — `lcamp_
102
+ dataset.py` will swap it in for the legacy `/storage/danieladebi` prefix in
103
+ the rgb/depth/mask paths, and root the background images (see above) under
104
+ it too. No code changes needed.
105
 
106
  Checkpoints are written to `--save_path` as `checkpoint_best.pt`,
107
  `checkpoint_last.pt`, and periodic `checkpoint_{epoch}.pt` files.
 
112
  ```bash
113
  python eval.py \
114
  --model_path checkpoints/lcamp_model.pt \
115
+ --data_dir <DATASET_DIR> \
116
  --split test \
117
  --model_type resnet \
118
  --use_camera_frame \
119
  --use_depth \
120
  --use_text_instructions \
121
+ --bbox_loc \
122
+ --cluster_loc <CLUSTER_LOC> \
123
  --visualize
124
  ```
125
 
 
150
 
151
  Running predictions on a real Boston Dynamics Spot (via the ROS2 service node
152
  in `scripts/lcamp_service_node.py`) is outside the scope of this model card,
153
+ see [ros2_setup/ROS2_SETUP.md](https://github.com/UTNuclearRobotics/l_camp/blob/main/ros2_setup/ROS2_SETUP.md) in the GitHub repo for that setup.