List of commits:
Subject Hash Author Date (UTC)
multiscale loss and final loss only mode c65dd0e74ad28503821e5c8651a3b47b4a0c7c64 Thai Thien 2019-10-05 15:58:19
wip : perspective map eac63f2671dc5b064753acc4f40bf0f9f216ad2a Thai Thien 2019-10-04 16:26:56
shell script f2106e700b6f6174d4dd276f25ec6f3d9ff239bb thient 2019-10-04 07:42:51
WIP 42c7c8e1d772fbbda61a4bdf9e329f74e1efb600 tthien 2019-10-03 17:52:47
add readme 580cf43d1edddd67b1f6a2c57fdd5cee3dba925c Thai Thien 2019-10-02 17:44:49
update script, debug ddb68b95389be1c1d398118677dd227a8bb2b70b Thai Thien 2019-10-02 15:52:31
add d (output density map) to loss function) a0c71bf4bf2ab7393d60b06a84db8dfbbfb1a6c2 tthien 2019-09-30 16:32:39
fix the args, add save interval for model, so we don't save them all 9fdf9daa2ac4bd12b7b62521d81e520db0debd01 tthien 2019-09-30 16:30:00
meow 1ad19a22a310992e27a26471feeb37375124d075 tthien 2019-09-29 18:25:43
fix pacnn perspective map 453ece3ccb818889ba895bfc4285f7905d33cba5 Thai Thien 2019-09-25 17:20:33
apex not work so well da8c0dd57297f972201f31d57e66897177922f48 Thai Thien 2019-09-24 17:25:59
fix data loader pacnn so it will scale up with correct number of people 11d55b50d764511f2491291f0208fee0905dec49 Thai Thien 2019-09-24 15:40:56
add comet ml a9d4b89ce594f5e241168ccafdcdf0f150ea0ebb Thai Thien 2019-09-23 17:07:58
fix pacnn avg schema c2140a96886195782e5689c24aeeb4fe7a2db7ad Thai Thien 2019-09-22 17:35:01
debug number not divisible by 8 a568fd7f294a8bd31b3db78437b4b6b51b5b41b9 Thai Thien 2019-09-22 04:36:06
pacnn 967074890d14ab0eefc277801860270a468e8f9f Thai Thien 2019-09-22 03:54:48
wip: pacnn 2192d7c7b449fecf3868877d9cfbc09bb6f7ae98 Thai Thien 2019-09-22 03:44:56
wip: pacnn 37620e5a9bc0f9516ea964ec58d9bdaa1c40ff36 Thai Thien 2019-09-22 03:14:42
fix training flow 2b87b1b26c7296b64493fdc49fedb421b249dfa3 Thai Thien 2019-09-17 18:00:35
dataset script bc5c052f5f956510ab95ef9a45434fd486c57fae Thai Thien 2019-09-16 17:21:13
Commit c65dd0e74ad28503821e5c8651a3b47b4a0c7c64 - multiscale loss and final loss only mode
Author: Thai Thien
Author date (UTC): 2019-10-05 15:58
Committer name: Thai Thien
Committer date (UTC): 2019-10-05 15:58
Parent(s): eac63f2671dc5b064753acc4f40bf0f9f216ad2a
Signing key:
Tree: 51822798b2c4953ad1f02b3fb45bd2765a04a1b4
File Lines added Lines deleted
args_util.py 3 0
main_pacnn.py 13 6
train_script/train_pacnn_shanghaitechA.sh 24 6
File args_util.py changed (mode: 100644) (index c9c322c..fa52179)
... ... def real_args_parse():
75 75
76 76 # pacnn setting only # pacnn setting only
77 77 parser.add_argument('--PACNN_PERSPECTIVE_AWARE_MODEL', action="store_true", default=False) parser.add_argument('--PACNN_PERSPECTIVE_AWARE_MODEL', action="store_true", default=False)
78 parser.add_argument('--PACNN_MUTILPLE_SCALE_LOSS', action="store", default=True,
79 help="True: compare each of density map/perspective map scale with gt for loss."
80 " False: only compare final density map and final density perspective map")
78 81
79 82 # args.original_lr = 1e-7 # args.original_lr = 1e-7
80 83 # args.lr = 1e-7 # args.lr = 1e-7
File main_pacnn.py changed (mode: 100644) (index fc19585..fc87076)
... ... if __name__ == "__main__":
37 37 DATASET_NAME = "shanghaitech" DATASET_NAME = "shanghaitech"
38 38 TOTAL_EPOCH = args.epochs TOTAL_EPOCH = args.epochs
39 39 PACNN_PERSPECTIVE_AWARE_MODEL = args.PACNN_PERSPECTIVE_AWARE_MODEL PACNN_PERSPECTIVE_AWARE_MODEL = args.PACNN_PERSPECTIVE_AWARE_MODEL
40 PACNN_MUTILPLE_SCALE_LOSS = args.PACNN_MUTILPLE_SCALE_LOSS
40 41
41 42 experiment.set_name(args.task_id) experiment.set_name(args.task_id)
42 43 experiment.log_parameter("DATA_PATH", DATA_PATH) experiment.log_parameter("DATA_PATH", DATA_PATH)
43 44 experiment.log_parameter("PACNN_PERSPECTIVE_AWARE_MODEL", PACNN_PERSPECTIVE_AWARE_MODEL) experiment.log_parameter("PACNN_PERSPECTIVE_AWARE_MODEL", PACNN_PERSPECTIVE_AWARE_MODEL)
45 experiment.log_parameter("PACNN_MUTILPLE_SCALE_LOSS", PACNN_MUTILPLE_SCALE_LOSS)
44 46 experiment.log_parameter("train", "train without p") experiment.log_parameter("train", "train without p")
45 47 experiment.log_parameter("momentum", args.momentum) experiment.log_parameter("momentum", args.momentum)
46 48 experiment.log_parameter("lr", args.lr) experiment.log_parameter("lr", args.lr)
 
... ... if __name__ == "__main__":
128 130 # forward pass # forward pass
129 131
130 132 d1, d2, d3, p_s, p, d = net(train_img.to(device)) d1, d2, d3, p_s, p, d = net(train_img.to(device))
131 loss_1 = criterion_mse(d1, d1_label) + criterion_ssim(d1, d1_label)
132 loss_2 = criterion_mse(d2, d2_label) + criterion_ssim(d2, d2_label)
133 loss_3 = criterion_mse(d3, d3_label) + criterion_ssim(d3, d3_label)
134 133 loss_d = criterion_mse(d, d1_label) + criterion_ssim(d, d1_label) loss_d = criterion_mse(d, d1_label) + criterion_ssim(d, d1_label)
135 loss = loss_d + loss_1 + loss_2 + loss_3
134 loss = loss_d
135
136 if PACNN_MUTILPLE_SCALE_LOSS:
137 loss_1 = criterion_mse(d1, d1_label) + criterion_ssim(d1, d1_label)
138 loss_2 = criterion_mse(d2, d2_label) + criterion_ssim(d2, d2_label)
139 loss_3 = criterion_mse(d3, d3_label) + criterion_ssim(d3, d3_label)
140 loss += loss_1 + loss_2 + loss_3
141
136 142
137 143 if PACNN_PERSPECTIVE_AWARE_MODEL: if PACNN_PERSPECTIVE_AWARE_MODEL:
138 144 # TODO: loss for perspective map here # TODO: loss for perspective map here
139 145 pass pass
140 loss_d = criterion_mse(d, d1_label) + criterion_ssim(d, d1_label)
141 loss += loss_d
146 # what is this, loss_d count 2 ?
147 ## loss_d = criterion_mse(d, d1_label) + criterion_ssim(d, d1_label)
148 ## loss += loss_d
142 149
143 150 # with amp.scale_loss(loss, optimizer) as scaled_loss: # with amp.scale_loss(loss, optimizer) as scaled_loss:
144 151 # scaled_loss.backward() # scaled_loss.backward()
File train_script/train_pacnn_shanghaitechA.sh changed (mode: 100644) (index 72ae080..9f2955d)
22 22 #--task_id train_state1_attemp4 #--task_id train_state1_attemp4
23 23
24 24
25 python main_pacnn.py \
26 --input data/ShanghaiTech/part_A \
27 --load_model saved_model/train_state1_attemp4_35_checkpoint.pth.tar \
28 --epochs 151 \
29 --lr 1e-8 \
30 --task_id train_state1_attemp5
25 #python main_pacnn.py \
26 #--input data/ShanghaiTech/part_A \
27 #--load_model saved_model/train_state1_attemp4_35_checkpoint.pth.tar \
28 #--epochs 151 \
29 #--lr 1e-8 \
30 #--task_id train_state1_attemp5
31
32 ################3
33
34 ## TODO: train this
35 #python main_pacnn.py \
36 #--input data/ShanghaiTech/part_A \
37 #--load_model saved_model/train_state1_attemp5_40_checkpoint.pth.tar \
38 #--epochs 300 \
39 #--lr 1e-8 \
40 #--task_id train_state1_attemp6
41
42
43 #python main_pacnn.py \
44 #--input data/ShanghaiTech/part_A \
45 #--load_model saved_model/train_state1_attemp6_120_checkpoint.pth.tar \
46 #--epochs 300 \
47 #--lr 1e-9 \
48 #--task_id train_state1_attemp7
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/hahattpro/crowd_counting_framework

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/hahattpro/crowd_counting_framework

Clone this repository using git:
git clone git://git.rocketgit.com/user/hahattpro/crowd_counting_framework

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main