ImageResizer.py 文件源码

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

项目:main 作者: templerobotics 项目源码 文件源码
def pos_images():

        #Edit this for new path of positive imges

        pos_path = '/path/folder'

        files = [f for f in listdir(pos_path) if isfile(join(pos_path,f)) ]

        #empty array with the size of the amount of files we have
        images = numpy.empty(len(files), dtype=object)

        pos_num = 1


        #cycle throw positives
        for n in range(0, len(files)):
          img[n] = cv2.imread( join(pos_path,files[n]),cv2.IMREAD_GRAYSCALE)
          img_resize = cv2.resize(img[n], (45, 45))
          cv2.imwrite("pos/"+str(pos_num)+".jpg",img_resize)
          pos_num+=1


    #Use to pull and resize negative images from image-net
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号