Subject | Hash | Author | Date (UTC) |
---|---|---|---|
make video code | d0737d7abec4abc900dc7e7981ca46e61f0d4153 | Thai Thien | 2020-12-23 16:30:04 |
create success | 99951e32fedfcdb2ebc272d1678c094998c499f8 | Thai Thien | 2020-12-18 17:17:34 |
bike_video_frame_404_dccnn_t3 | bbbd4ad319ac87586afc6ce6675adcf9d5f41fef | Thai Thien | 2020-12-18 15:53:26 |
fix load model stuff | 8c5c9c985fb747dc6392c86aa5f49282f8d12297 | Thai Thien | 2020-12-18 15:44:21 |
import comet first | dd4426221a95d0916c8cc7c02c7587ada1d910b5 | Thai Thien | 2020-12-18 15:41:59 |
predict on frame from video | ec39a97372a15ad75811fdb3417d2e48078a30b2 | Thai Thien | 2020-12-18 15:40:36 |
fix normalize in data loader | 56a64c14dc62c96aba532d233ff2782414738d05 | Thai Thien | 2020-12-17 15:36:22 |
change gpu 5 | 46d32b3fc05909b61f56389b01c2e50e52937d9b | Thai Thien | 2020-12-16 16:40:47 |
eval_dccnn_bike_video_VID_20201204_133931_404_model_adamw1_bigtail13i_t4_bike20 | 95bb636a0b544b7a72fc4c65acb47472da468766 | Thai Thien | 2020-12-16 16:35:14 |
eval_dccnn_bike_video_VID_20201204_133931_404_model_adamw1_bigtail13i_t3_bike20 | 27740a0e21ca42490f5cfe516b2453f7be3a2483 | Thai Thien | 2020-12-16 16:17:12 |
batch 2 | 85433ffd51070572d7e743a2b4ef53f340b658d4 | Thai Thien | 2020-12-15 16:57:56 |
reduce batch size 3 | d2f145009c06f5e6e6e1e0270878ae275b611c2f | Thai Thien | 2020-12-15 16:55:46 |
t3 and t4 | 70e09414713ea22800d8e87a0dd984f18406c375 | Thai Thien | 2020-12-15 16:50:32 |
prepare bike 20s q100 | 556a4d8f695ca154a5db42b363a276d7ab233434 | Thai Thien | 2020-12-15 16:46:08 |
VID_20201204_133931_404 | 8264dcb4d5389ed8ef2920eb3419cfc505b6a09c | Thai Thien | 2020-12-13 11:31:10 |
add VID_20201204_133931_404 | a36ba35ca7c54dcf552d17a08fa8c87720ce1c69 | Thai Thien | 2020-12-13 11:30:24 |
print total length on console | 6a956d93489926e99909d234bf4a7b13d39aad56 | Thai Thien | 2020-12-13 11:24:56 |
fix input of save_density_map | dc2f014fdd570909b811ac77629f0c8c0ca156da | Thai Thien | 2020-12-13 11:21:37 |
detach cpu for save_density_map | f41362501a0bc3578de0a48e6cbe97966a66677c | Thai Thien | 2020-12-13 11:19:45 |
predict_video_server pred.detach().cpu().numpy() | 3c23cd51890f8b791be91ad8eb74bdba9ace905a | Thai Thien | 2020-12-13 11:14:51 |
File | Lines added | Lines deleted |
---|---|---|
dataset_script/combine_img_into_video.py | 37 | 0 |
dataset_script/generate_frame_from_video.py | 1 | 0 |
playground/check_fps.py | 1 | 12 |
File dataset_script/combine_img_into_video.py added (mode: 100644) (index 0000000..a7c28c7) | |||
1 | from torchvision.io import write_jpeg, read_image | ||
2 | import torch | ||
3 | import cv2 | ||
4 | import os | ||
5 | from tqdm import tqdm | ||
6 | import glob | ||
7 | |||
8 | def explore(): | ||
9 | img = read_image("/data/my_crowd_image/video_bike_q100/IMG_697.jpg") | ||
10 | img2 = read_image("/data/my_crowd_image/video_bike_q100/IMG_697.jpg") | ||
11 | print(img.shape) | ||
12 | |||
13 | c = torch.cat([img.unsqueeze(0), img2.unsqueeze(0)]) | ||
14 | print(c.shape) | ||
15 | |||
16 | def create_video(): | ||
17 | |||
18 | # TODO | ||
19 | img_prefix = '/data/my_crowd_image/overlay_bike_video_frame_404_dccnn_t4/PRED_OVERLAY_IMG_' | ||
20 | video_name = '/data/my_crowd_image/overlay_bike_video_frame_404_dccnn_t4_video_29_99512746811621fps.avi' # save as .avi | ||
21 | # is changeable but maintain same h&w over all frames | ||
22 | width = 1920 | ||
23 | height = 1080 | ||
24 | # this fourcc best compatible for avi | ||
25 | fourcc = cv2.VideoWriter_fourcc('M', 'J', 'P', 'G') | ||
26 | video = cv2.VideoWriter(video_name, fourcc, 29.99512746811621, (width, height)) | ||
27 | |||
28 | for i in tqdm(range(2013)): | ||
29 | img_dir = img_prefix + str(i) + ".jpg" | ||
30 | x = cv2.imread(img_dir) | ||
31 | video.write(x) | ||
32 | |||
33 | # cv2.destroyAllWindows() | ||
34 | video.release() | ||
35 | |||
36 | if __name__ == "__main__": | ||
37 | create_video() |
File dataset_script/generate_frame_from_video.py changed (mode: 100644) (index 169b28d..ad5f857) | |||
... | ... | from visualize_util import save_density_map_normalize, save_density_map | |
10 | 10 | VIDEO_PATH = "/home/tt/Videos/VID_20201204_133931_404.mp4" | VIDEO_PATH = "/home/tt/Videos/VID_20201204_133931_404.mp4" |
11 | 11 | OUTPUT_PATH = "/data/my_crowd_image/video_bike_q100" | OUTPUT_PATH = "/data/my_crowd_image/video_bike_q100" |
12 | 12 | v, a, info = read_video(VIDEO_PATH, pts_unit='sec') | v, a, info = read_video(VIDEO_PATH, pts_unit='sec') |
13 | print(info) | ||
13 | 14 | print(v.shape) | print(v.shape) |
14 | 15 | length = v.shape[0] | length = v.shape[0] |
15 | 16 | print(length) | print(length) |
File playground/check_fps.py copied from file dataset_script/generate_frame_from_video.py (similarity 60%) (mode: 100644) (index 169b28d..b8c7490) | |||
... | ... | from visualize_util import save_density_map_normalize, save_density_map | |
10 | 10 | VIDEO_PATH = "/home/tt/Videos/VID_20201204_133931_404.mp4" | VIDEO_PATH = "/home/tt/Videos/VID_20201204_133931_404.mp4" |
11 | 11 | OUTPUT_PATH = "/data/my_crowd_image/video_bike_q100" | OUTPUT_PATH = "/data/my_crowd_image/video_bike_q100" |
12 | 12 | v, a, info = read_video(VIDEO_PATH, pts_unit='sec') | v, a, info = read_video(VIDEO_PATH, pts_unit='sec') |
13 | print(v.shape) | ||
14 | length = v.shape[0] | ||
15 | print(length) | ||
16 | |||
17 | count = 0 | ||
18 | for i in range(length): | ||
19 | # if (i% 20 == 0): | ||
20 | frame = v[i] | ||
21 | frame = frame.permute(2, 0, 1) | ||
22 | file_out_path = os.path.join(OUTPUT_PATH, "IMG_" + str(i) + ".jpg") | ||
23 | write_jpeg(frame, file_out_path, quality=100) | ||
24 | print(file_out_path) | ||
13 | print(info) |