Nougat:科学文档的OCR 使用记录

https://github.com/facebookresearch/nougat

python环境需要在3.8以上

安装:pip install nougat-ocr

模型默认下载地址:/home/****/.cache/torch/hub/nougat-0.1.0-small

环境安装好之后默认使用cpu

UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 11080). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver. (Triggered internally at ../c10/cuda/CUDAFunctions.cpp:108.)
  return torch._C._cuda_getDeviceCount() > 0
WARNING:root:No GPU found. Conversion on CPU is very slow.

如果需要使用GPU,则需要重新安装和自己cuda版本对应的torch等,我这边是cuda11.8

conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia

环境配置好之后即可进行PDF识别

在output目录下会生成.mmd格式的文件

vscode中使用如下插件可以查看mmd格式中的内容,文字可直接复制

3090GPU上

显存占用17368 / 24576M  显存占用17G,16页的PDF  耗时30秒 

自己随便写的文字可能识别不了,图片中的文字无法识别

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-05 14:18:04       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-05 14:18:04       106 阅读
  3. 在Django里面运行非项目文件

    2024-01-05 14:18:04       87 阅读
  4. Python语言-面向对象

    2024-01-05 14:18:04       96 阅读

热门阅读

  1. SLAM学习入门--编程语言

    2024-01-05 14:18:04       59 阅读
  2. 自动驾驶货车编队行驶系统功能规范

    2024-01-05 14:18:04       65 阅读
  3. 51单片机点灯入门教程——2. 呼吸灯效果

    2024-01-05 14:18:04       58 阅读
  4. 14.9-时序和组合的混合逻辑——使用非阻塞赋值

    2024-01-05 14:18:04       57 阅读
  5. 【.NET Core】记录(Record)详解

    2024-01-05 14:18:04       51 阅读
  6. Android.bp 常用模块类型

    2024-01-05 14:18:04       46 阅读
  7. redis的springboot配置

    2024-01-05 14:18:04       55 阅读
  8. ROS发布消息与接受消息的机制

    2024-01-05 14:18:04       64 阅读
  9. ROS订阅和发布的点云保存为.pcd文件

    2024-01-05 14:18:04       61 阅读
  10. C++类成员的访问控制

    2024-01-05 14:18:04       60 阅读