Month: September 2024

  • SpringBootTest单元测试关闭日志

    添加logback配置 <?xml version="1.0" encoding="UTF-8"?> <configuration> <include resource="org/springframework/boot/logging/logback/base.xml"/> <logger name="org.springframework" level="OFF"/> <logger name="org.apache.flink" level="ERROR"/> <logger name="akka.event.slf4j" level="ERROR"/> <!– 如果还有其他日志,则可以负责上一行,将相关的包名写在name中 –> </configuration> 修改application.properties配置 #banner下面的日志 logging.level.org.springframework=off #去除banner下面的日志 logging.level.root=off #去除springboot启动的banner spring.main.banner-mode=off

  • tess4j 常用语言包下载 中文语言包下载

    Tess4j中文语言包chi-sim.traineddata 点击下载 简单示例 引入依赖 获取依赖 https://mvnrepository.com/search?q=tess4j <dependency> <groupId>net.sourceforge.tess4j</groupId> <artifactId>tess4j</artifactId> <version>5.13.0</version> </dependency> 测试图片 测试代码 public class OcrTest { public static void main(String[] args) throws TesseractException { File file = new File("C:/ocr-test/nihao123.jpg"); Tesseract tesseract = new Tesseract(); tesseract.setDatapath("C:/ocr-test/data"); tesseract.setLanguage("chi_sim"); String s = tesseract.doOCR(file); System.out.println(s); } } 输出结果 你好世界123456 深度学习 深度学习推荐文章 https://blog.51cto.com/u_14344/9796178