TianzhongSong / C3D-keras

train C3D with keras for action recognition
http://www.tianzsong.xyz/2018/04/08/c3d-keras/
MIT License
119 stars 60 forks source link

what is this part doing #19

Open handsomedavid123 opened 2 years ago

handsomedavid123 commented 2 years ago

what is this part in the def process_batch means? i'm new in this feild could you explain it? thank you!!

if train: crop_x = random.randint(0, 15) crop_y = random.randint(0, 58) is_flip = random.randint(0, 1) for j in range(16): img = imgs[symbol + j] image = cv2.imread(img_path + path + '/' + img) image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) image = cv2.resize(image, (171, 128)) if is_flip == 1: image = cv2.flip(image, 1) batch[i][j][:][:][:] = image[crop_x:crop_x + 112, crop_y:crop_y + 112, :] labels[i] = label else: for j in range(16): img = imgs[symbol + j] image = cv2.imread(img_path + path + '/' + img) image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) image = cv2.resize(image, (171, 128)) batch[i][j][:][:][:] = image[8:120, 30:142, :] labels[i] = label