List of commits:
Subject Hash Author Date (UTC)
add load_data_shanghaitech_keepfull_and_crop 5af55c5b483263683db80bcf4b870bfbb241d668 Thai Thien 2020-03-12 16:19:19
change on how it log epoch adcb2aa917f02d4b5d567a9b70f08ec519f896d1 Thai Thien 2020-03-11 17:32:35
fix the milestone 4e8c048ff8db59cbedc819e4df2a48094568fc2c Thai Thien 2020-03-11 17:10:03
add COMET_ML_API 7fbec715d751544bcdafb34a686602839a2696de Thai Thien 2020-03-11 17:04:19
fix script name 631c37c068377706ae2cad4513baeea7e62ae0b5 Thai Thien 2020-03-11 16:59:24
intergrate comet ml into compact cnn 058e90a617acb76a7788e6a5d44f52563342490b Thai Thien 2020-03-11 16:57:17
something ?! fff52ff87af2a90452384a01bd6d6e6c4b91654e Thai Thien 2020-03-11 15:55:04
DilatedCCNNv2 75d2989232a8a68eba9b4920ab2374ac28438e0e Thai Thien 2020-03-10 05:11:12
fix script for ccnn_v2_t1_c2 57928056d13bc9b1f9b11e14dd305005a3a5aeea Thai Thien 2020-03-10 04:56:33
fix trash code 33c406b13b5d45527b05dfb7f4281c3966c6471e Thai Thien 2020-03-10 04:49:52
repair dir in config baf522825f906a3d1fc5524f42a80da33d059640 Thai Thien 2020-03-10 04:45:11
v3 t1 c2 2d4727f47f4262833dca2087fb9e48f0d117e334 Thai Thien 2020-03-10 04:29:23
dilated ccnn v1 t1 7807d7a979353fa84d0b7319820386e93dbe5cc4 Thai Thien 2020-03-09 17:20:58
new ccnn 44a669c1f918be9d74313f29a5dbbc876c29f2fc Thai Thien 2020-03-09 17:16:49
fix script aa331331b12e5b454d372a550524b30a4bebe706 Thai Thien 2020-03-07 18:32:06
try reproduct ccnn with keepfull and lr 1e-5 814c520cbd1bb2d7fd50d2a8d3579d43da79fe60 Thai Thien 2020-03-07 18:30:42
my simple v4 with addition deform cnn at the end 5392aaf6c14fdd910f52096dbb921bed7470c4f7 Thai Thien 2020-03-07 18:15:22
fix the scheduler 77e6737a040f5aa5745b8a8830f5bec12322b10f Thai Thien 2020-03-07 17:46:02
t4 lr 1e-5 acd41ed30c95f63e01a05a6d9929410637852d9e Thai Thien 2020-03-06 19:41:49
no more lr scheduler 7289adb41de7807258eb8c29e6108fa65f59525a Thai Thien 2020-03-06 19:35:49
Commit 5af55c5b483263683db80bcf4b870bfbb241d668 - add load_data_shanghaitech_keepfull_and_crop
Author: Thai Thien
Author date (UTC): 2020-03-12 16:19
Committer name: Thai Thien
Committer date (UTC): 2020-03-12 16:19
Parent(s): adcb2aa917f02d4b5d567a9b70f08ec519f896d1
Signing key:
Tree: 75c05b5720a392e129e7dbdaaf7756871c4edc00
File Lines added Lines deleted
data_flow.py 44 2
File data_flow.py changed (mode: 100644) (index 7763ae4..1260368)
... ... def load_data_shanghaitech_keepfull(img_path, train=True):
147 147 return img, target1 return img, target1
148 148
149 149
150 def load_data_shanghaitech_keepfull_and_crop(img_path, train=True):
151 """
152 loader might give full image, or crop
153 :param img_path:
154 :param train:
155 :return:
156 """
157 gt_path = img_path.replace('.jpg', '.h5').replace('images', 'ground-truth-h5')
158 img = Image.open(img_path).convert('RGB')
159 gt_file = h5py.File(gt_path, 'r')
160 target = np.asarray(gt_file['density'])
161
162 if train:
163
164 if random.random() > 0.5: # 50% chance crop
165 crop_size = (int(img.size[0] / 2), int(img.size[1] / 2))
166 if random.randint(0, 9) <= -1:
167
168 dx = int(random.randint(0, 1) * img.size[0] * 1. / 2)
169 dy = int(random.randint(0, 1) * img.size[1] * 1. / 2)
170 else:
171 dx = int(random.random() * img.size[0] * 1. / 2)
172 dy = int(random.random() * img.size[1] * 1. / 2)
173
174 img = img.crop((dx, dy, crop_size[0] + dx, crop_size[1] + dy))
175 target = target[dy:crop_size[1] + dy, dx:crop_size[0] + dx]
176
177 if random.random() > 0.8: # 20 % chance flip
178 target = np.fliplr(target)
179 img = img.transpose(Image.FLIP_LEFT_RIGHT)
180
181 target1 = cv2.resize(target, (int(target.shape[1] / 8), int(target.shape[0] / 8)),
182 interpolation=cv2.INTER_CUBIC) * 64
183
184 target1 = np.expand_dims(target1, axis=0) # make dim (batch size, channel size, x, y) to make model output
185 # np.expand_dims(target1, axis=0) # again
186 return img, target1
187
188
189
150 190 def load_data_ucf_cc50(img_path, train=True): def load_data_ucf_cc50(img_path, train=True):
151 191 gt_path = img_path.replace('.jpg', '.h5') gt_path = img_path.replace('.jpg', '.h5')
152 192 img = Image.open(img_path).convert('RGB') img = Image.open(img_path).convert('RGB')
 
... ... class ListDataset(Dataset):
346 386 # load data fn # load data fn
347 387 if dataset_name == "shanghaitech": if dataset_name == "shanghaitech":
348 388 self.load_data_fn = load_data_shanghaitech self.load_data_fn = load_data_shanghaitech
349 if dataset_name == "shanghaitech_same_size_density_map":
389 elif dataset_name == "shanghaitech_same_size_density_map":
350 390 self.load_data_fn = load_data_shanghaitech_same_size_density_map self.load_data_fn = load_data_shanghaitech_same_size_density_map
351 if dataset_name == "shanghaitech_keepfull":
391 elif dataset_name == "shanghaitech_keepfull":
352 392 self.load_data_fn = load_data_shanghaitech_keepfull self.load_data_fn = load_data_shanghaitech_keepfull
393 elif dataset_name == "shanghaitech_keepfull_and_crop":
394 self.load_data_fn = load_data_shanghaitech_keepfull_and_crop
353 395 elif dataset_name == "ucf_cc_50": elif dataset_name == "ucf_cc_50":
354 396 self.load_data_fn = load_data_ucf_cc50 self.load_data_fn = load_data_ucf_cc50
355 397 elif dataset_name == "ucf_cc_50_pacnn": elif dataset_name == "ucf_cc_50_pacnn":
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