功能由一个自动R选择图像文件中的一个

问题描述 投票:0回答:1

我有100多个图像的文件夹。我想在同一时间,我想创建将由一个访问每个图像之一,并运行分析功能运行的一个图像的分析,而不是运行R.他们每个人的谷歌视觉分析。

使用下面的代码:

getGooglevisionResponse(file.choose(),feature = 'text_detection')

我使用file.choose()选择一次一个文件,但我想创建一个循环,这将动态地选择每个图像和对它们运行分析..二手list.files()但得到以下错误the following condition has length >1 and only the first element will be used

找到一个职位,但也就是在Python无法复制它R中

https://github.com/andrikosrikos/Google-Cloud-Support/blob/master/Google%20Vision/multiple_features_request_single_API_call.py

r loops functor google-vision
1个回答
0
投票

在没有看到更多的代码,你只需要使用lapplylist.files

fil <- list.files("<myImgDir>", full.names = T)
out <- lapply(fil, getGoogleVisionResponse, feature = 'text_detection'))
© www.soinside.com 2019 - 2024. All rights reserved.