我刚刚测试了Google Cloud Vision API,以便在图片中读取文本(如果存在).
到目前为止,我安装了Maven服务器和Redis服务器.我只是按照本页中的说明操作.
https://github.com/GoogleCloudPlatform/cloud-vision/tree/master/java/text
到目前为止,我能够使用.jpg文件进行测试,是否可以使用tiff文件或pdf进行测试?
我使用以下命令:
java -cp target/text-1.0-SNAPSHOT-jar-with-dependencies.jar com.google.cloud.vision.samples.text.TextApp ../../data/text/
Run Code Online (Sandbox Code Playgroud)
在文本目录中,我有jpg格式的文件.
然后要读取转换后的文件,我不知道该怎么做,只是运行以下命令
java -cp target/text-1.0-SNAPSHOT-jar-with-dependencies.jar com.google.cloud.vision.samples.text.TextApp
Run Code Online (Sandbox Code Playgroud)
我收到消息,输入一个单词或短语来搜索转换后的文件.有没有办法看到整个文件转变?
谢谢!
我正在阅读Office 365邮件帐户的收件箱,并下载它的附件(txt文件)。对于小于2 MB的小文件,它可以正常工作,但是当我尝试使用20 MB的文件时,它确实很慢。我在两个不同的机器(Linux和Windows)上测试了代码,速度是一样的,真的很慢。
String user = "mail@mail.com";
String password = "mypassword";
try{
boolean foundSites = false;
// Get a Properties object
Properties properties = new Properties();
properties.put("mail.imaps.host", host);
properties.put("mail.imaps.port", port);
properties.put("mail.imaps.starttls.enable", SSL);
//properties.put("mail.imap.fetchsize", "1000000");
Session emailSession = Session.getDefaultInstance(properties);
//create the POP3 store object and connect with the pop server
Store store = emailSession.getStore("imaps");
store.connect(host, user, password);
//create the folder object and open it
Folder emailFolder = store.getFolder("INBOX");
emailFolder.open(Folder.READ_ONLY);
// retrieve the messages from the folder in an array and …Run Code Online (Sandbox Code Playgroud)