-
Notifications
You must be signed in to change notification settings - Fork 1
/
train_phase.sh
executable file
·62 lines (50 loc) · 2.12 KB
/
train_phase.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# 此处开始我们真正考虑模型训练,此前都是进行数据集生成
dataset_path=$1
set -e
# 只要有 process 不成功,shell将会自动结束进程,不会继续执行
# 首先,训练1/8分辨率的位姿配准结果并渲染
echo "Outer dataset path: $1"
echo "[INFO] Training 1/8 resolution models for pose optimization."
# ./train_all_no_skew.sh $1
echo "[INFO] Training 1/8 resolution models completed."
# 训练完渲染,结果暂存在 renders 文件夹中
# no_skew dataparser_transforms.json 需要处理
# 生成 output_no_skew.json
# 最后一个参数为 process_daya, 设为 false
echo "[INFO] Generating output.json for no_skew"
# ./output_json_gen.sh $1 _no_skew 0.125 0
echo "[INFO] Generating output_no_skew.json generated."
echo "[INFO] Rendering 1/8 resolution models..."
# ./render_all_no_skew.sh $1
echo "[INFO] Rendering 1/8 resolution models completed."
# 训练实际的 model,此model训练完后其实已经有结果的模型以供 ns-viewer 进行查看了
echo "[INFO] Traning model..."
./train_all.sh $1
# pid_model=$!
./train_all2.sh $1
# wait $pid_model
echo "[INFO] Traning model completed."
# TODO: 生成位姿配准数据集,此时dayatemple需要处理,故设为 1
# 1. 生成 output_xxxx.json
echo "[INFO] Generating output.json for all models"
./output_json_gen.sh $1 _colmap 1.0 1
echo "[INFO] Generating output.json completed."
# 2. 生成完整的测试位姿优化数据集,包括 transforms_xxx_opt.json
echo "[INFO] Camera test view optimization dataset started."
./create_cam_opt.sh $1
echo "[INFO] Camera test view optimization dataset completed."
# 3. 测试位姿优化的训练
echo "[INFO] Pose optimization started."
./pose_opt_all.sh $1
# pid_pose=$!
./pose_opt_all2.sh $1
# wait $pid_pose
echo "[INFO] Pose optimization completed."
# 4. pose_replacer 得到 output_xxxx_opt.json
# 注意,此中需要进行处理: DayaTemple 与 PeonyGarden 有需要替换的部分
echo "[INFO] Pose placing started."
./opt_pose_replacer.sh $1
python3 ./pose_viz/peony_poser.py --input_path ${1}PeonyGarden/
echo "[INFO] Pose placing completed."
echo "[INFO] Training completed."