Skip to content

Commit

Permalink
Tidy up for project submission
Browse files Browse the repository at this point in the history
  • Loading branch information
holylovenia committed Nov 27, 2022
1 parent 0f5f545 commit c1b3a82
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ The demand for multimodal dialogue system has been rising in various domains, em
```
pip install -r requirements.txt
```
- To obtain the preprocessed dialogue data, run `./run_data_preprocessing.sh`
- To obtain the preprocessed visual embeddings from DETR, run `./run_object_detection_finetuning.sh` and `./run_object_detection_prediction.sh`
- To obtain the preprocessed visual embeddings from ResNet-50 for the SIMMC 2.1 baselines, download from the [Google Drive](https://drive.google.com/file/d/1jr7r5Yaca80W5n0hizOakTG-F1ns6BGv/view?usp=sharing) provided by the organizers, then place the file under `./preprocessed_data/visual_features/`

## File Structure
- git submodules
Expand Down
2 changes: 1 addition & 1 deletion object_detection_prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def collate_fn(example_batch):
pred_last_hidden_state = torch.index_select(outputs.last_hidden_state.squeeze(), 0, sorted_pred_indices)
pred_boxes = torch.index_select(outputs.pred_boxes.squeeze(), 0, sorted_pred_indices)
pred_results[MAPPING["id2scene"][batch["image_id"]] + ".png"] = torch.cat([
pred_last_hidden_state.detach().cpu(), pred_boxes.detach().cpu()
pred_last_hidden_state.detach().cpu() #, pred_boxes.detach().cpu()
], dim=1)
if not os.path.exists(data_args.preprocessed_data_dir):
os.makedirs(data_args.preprocessed_data_dir)
Expand Down
16 changes: 8 additions & 8 deletions run_data_preprocessing.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
DATA_FOLDER="/home/holy/datasets/simmc2.1/"

# python simmc2/model/ambiguous_candidates/format_ambiguous_candidates_data.py \
# --simmc_train_json "/home/holy/datasets/simmc2.1/simmc2.1_dials_dstc11_train.json" \
# --simmc_dev_json "/home/holy/datasets/simmc2.1/simmc2.1_dials_dstc11_dev.json" \
# --simmc_devtest_json "/home/holy/datasets/simmc2.1/simmc2.1_dials_dstc11_devtest.json" \
# --scene_json_folder "/home/holy/datasets/simmc2.1/public/" \
# --ambiguous_candidates_save_path "./preprocessed_data/ambiguous_candidates/"
python simmc2/model/ambiguous_candidates/format_ambiguous_candidates_data.py \
--simmc_train_json "/home/holy/datasets/simmc2.1/simmc2.1_dials_dstc11_train.json" \
--simmc_dev_json "/home/holy/datasets/simmc2.1/simmc2.1_dials_dstc11_dev.json" \
--simmc_devtest_json "/home/holy/datasets/simmc2.1/simmc2.1_dials_dstc11_devtest.json" \
--scene_json_folder "/home/holy/datasets/simmc2.1/public/" \
--ambiguous_candidates_save_path "./preprocessed_data/ambiguous_candidates/"

# python simmc2/model/ambiguous_candidates/format_coref_candidates_data.py \
# --simmc_train_json "/home/holy/datasets/simmc2.1/simmc2.1_dials_dstc11_train.json" \
Expand All @@ -14,6 +14,6 @@ DATA_FOLDER="/home/holy/datasets/simmc2.1/"
# --scene_json_folder "/home/holy/datasets/simmc2.1/public/" \
# --coref_candidates_save_path "./preprocessed_data/coref_candidates|no_mm/"

cd simmc2/model/mm_dst
./run_preprocess_gpt2.sh "/home/holy/projects/ambiguous-mm-dialogue/preprocessed_data/coref_candidates|no_mm" /home/holy/datasets/simmc2.1
# cd simmc2/model/mm_dst
# ./run_preprocess_gpt2.sh "/home/holy/projects/ambiguous-mm-dialogue/preprocessed_data/coref_candidates|no_mm" /home/holy/datasets/simmc2.1
# ./run_preprocess_gpt2.sh "/home/holy/projects/ambiguous-mm-dialogue/preprocessed_data/coref_candidates|mm" /home/holy/datasets/simmc2.1
10 changes: 5 additions & 5 deletions run_object_detection_finetuning.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
CUDA_VISIBLE_DEVICES=1 python object_detection_finetuning.py \
--output_dir="./save/test/obj-det" \
--cache_dir="./cache/test/obj-det" \
--output_dir="./save/obj-det" \
--cache_dir="./cache/obj-det" \
--model_name_or_path="facebook/detr-resnet-50" \
--train_dataset_path="./preprocessed_data/coref_candidates/simmc2.1_coref_candidates_dstc11_train.json" \
--dev_dataset_path="./preprocessed_data/coref_candidates/simmc2.1_coref_candidates_dstc11_dev.json" \
--devtest_dataset_path="./preprocessed_data/coref_candidates/simmc2.1_coref_candidates_dstc11_devtest.json" \
--train_dataset_path="./preprocessed_data/ambiguous_candidates/simmc2.1_ambiguous_candidates_dstc11_train.json" \
--dev_dataset_path="./preprocessed_data/ambiguous_candidates/simmc2.1_ambiguous_candidates_dstc11_dev.json" \
--devtest_dataset_path="./preprocessed_data/ambiguous_candidates/simmc2.1_ambiguous_candidates_dstc11_devtest.json" \
--per_device_train_batch_size=16 \
--per_device_eval_batch_size=16 \
--num_train_epochs=200 \
Expand Down
2 changes: 1 addition & 1 deletion run_object_detection_prediction.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CUDA_VISIBLE_DEVICES=0 python object_detection_prediction.py \
--dev_dataset_path='./preprocessed_data/ambiguous_candidates/simmc2.1_ambiguous_candidates_dstc11_dev.json' \
--devtest_dataset_path='./preprocessed_data/ambiguous_candidates/simmc2.1_ambiguous_candidates_dstc11_devtest.json' \
--cache_dir="./cache/obj-det" \
--model_name_or_path="./save/obj-det/facebook/detr-resnet-50/checkpoint-1160" \
--model_name_or_path="./save/obj-det/facebook/detr-resnet-50" \
--per_device_train_batch_size=1 \
--per_device_eval_batch_size=1 \
--num_train_epochs=200 \
Expand Down

0 comments on commit c1b3a82

Please sign in to comment.