input_data_v1.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:C3D-tensorflow 作者: hx173149 项目源码 文件源码
def RandomCrop(rand_seed,img, top,left,height=224, width=224,u=0.5,aug_factor=9/8):
    #first zoom in by a factor of aug_factor of input img,then random crop by(height,width)
    # if rand_seed < u:
    if 1:
        # h,w,c = img.shape
        # img = cv2.resize(img, (round(aug_factor*w), round(aug_factor*h)), interpolation=cv2.INTER_LINEAR)
        # h, w, c = img.shape

        new_h, new_w = height,width

        # top = np.random.randint(0, h - new_h)
        # left = np.random.randint(0, w - new_w)

        img = img[top: top + new_h,
              left: left + new_w]
    return img
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号