genericDataSetLoader.py 文件源码

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

项目:Melanoma-Cancer-Detection-V1 作者: vgupta-ai 项目源码 文件源码
def _createBatchAndStandardize(self,imageDataArray,batchSize):
        i = 0
        standardizedImagesBatch = None
        standardizedImages = None
        totalNumImages = imageDataArray.shape[0]
        print "Total Number of images:"+str(totalNumImages)
        while i<totalNumImages:
            minIndx = i
            maxIndx = min(imageDataArray.shape[0],i+batchSize)
            print str(i)+"/"+str(imageDataArray.shape[0])
            i = i + batchSize
            print i
            standardizedImagesBatch = tf.map_fn(lambda img:tf.image.per_image_standardization(img), imageDataArray[minIndx:maxIndx], dtype=tf.float32)
            if standardizedImages is None:
                standardizedImages = standardizedImagesBatch.eval()
            else:
                standardizedImages = np.vstack((standardizedImages,standardizedImagesBatch.eval()))
        return standardizedImages
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号