Skip to main content

Installation

Before starting the installation of Capybara, please ensure your system meets the following requirements:

Prerequisites

Install the necessary system packages according to your operating system:

  • Ubuntu

    sudo apt install libturbojpeg exiftool ffmpeg libheif-dev
  • MacOS

    brew install jpeg-turbo exiftool ffmpeg
    • Important Note: There are some known issues when using libheif on macOS, including:

      1. HEIC files generated cannot be opened: On macOS, HEIC files generated by libheif may not open in certain programs. This could be related to image dimensions, especially when the width or height of the image is odd, leading to compatibility issues.

      2. Compilation errors: While compiling libheif on macOS, you may encounter undefined symbol errors related to the ffmpeg decoder. This could be due to incorrect compile options or dependency settings.

      3. Example programs fail to run: On macOS Sonoma, example programs for libheif may fail to run, displaying dynamic linking errors stating that libheif.1.dylib cannot be found. This could be related to incorrect dynamic library path settings.

      Due to these issues, we currently run libheif only on Ubuntu, and macOS support will be considered in future versions.

pdf2image

pdf2image is a Python module for converting PDF files to images. Ensure the following tools are installed:

  • MacOS: Install poppler

    brew install poppler
  • Linux: Most distributions include pdftoppm and pdftocairo by default. If not, install them with:

    sudo apt install poppler-utils

ONNXRuntime

If you wish to use ONNXRuntime for GPU-accelerated inference, ensure you have the compatible version of CUDA installed, as shown below:

sudo apt install cuda-12-4
# To add to .bashrc
echo 'export PATH=/usr/local/cuda-12.4/bin${PATH:+:${PATH}}' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}' >> ~/.bashrc

Install via PyPI

  1. Install the package via PyPI:

    pip install capybara-docsaid
  2. Verify the installation:

    python -c "import capybara; print(capybara.__version__)"
  3. If the version number is displayed, the installation was successful.

Install via git clone

  1. Download the project:

    git clone https://github.com/DocsaidLab/Capybara.git
  2. Install the wheel package:

    pip install wheel
  3. Build the wheel file:

    cd Capybara
    python setup.py bdist_wheel
  4. Install the built wheel file:

    pip install dist/capybara_docsaid-*-py3-none-any.whl

Frequently Asked Questions

  1. Why is there no support for Windows installation?

    Love your life, stay away from Windows.


  1. I just want to use Windows, and I advise you to mind your own business!

    Fine, we recommend you install Docker and use the above methods to run your program inside Docker.

    Please refer to the next section: Advanced Installation.


  1. How do I install Docker?

    It's not hard, but there are quite a few steps.

    Please refer to the Docker Official Documentation for installation.