Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Sv translation
languageru

Файл конфигурации image2text_fre.conf

Scroll Table Layout
widths40%, 60%

СодержимоеОписание
{
 
    "DebugBreak": false, 
Посылать ли SIGTRAP (SIGBREAK на Windows) при обработке любого исключения. Служит для отладки
    "FREngine": {
Секция настроек движка OCR Abbyy Fine Reader
         "ImageFormats": {
Ограничения на размеры обрабатываемых изображений
"ColorChecker": {Секция фильтра цветности
"target_image_area_sqrt": 300,Целевая площадь, к которой изображение перед анализом (для ускорения)
"significant_colors_number_threshold" : 30,Порог количества цветов, превысивших порог significance_threshold. Если больше, то изображение считается не сканом и не подаётся на OCR
"significance_threshold" : 0.005,Порог доли цвета в изображении. Если доля цвета в изображении больше, то такой цвет будет учитываться в пороге significant_colors_number_threshold
"dark_border" : 40,Тёмная граница цвета. Определяет, какие цвета в greyscale кодировке будут отброшены и не будут учитываться при вычислении значений для порогов significance_threshold и significant_colors_number_threshold
"light_border" : 220,Светлая граница цвета. Определяет, какие цвета в greyscale кодировке будут отброшены и не будут учитываться при вычислении значений для порогов significance_threshold и significant_colors_number_threshold
"Enabled" : falseАктивация фильтра цветности
                          }
 
               "default": {
Установки по умолчанию
                   "MinHeightInPx": 12,

Минимальная высота изображения в пикселах

                   "MinLengthInPx": 140,
Минимальная длина изображения в пикселах
                   "MinSizeInKb": 200,
Минимальный размер пересылаемой картинки в Кбайт
                   "MaxSizeInKb": 1536
Максимальный размер пересылаемой картинки в Кбайт
                          }
 
               "GIF": {

Переопределение дефолтных значений (секция default) для изображений формата gif

                  "MinSizeInKb": 200
Минимальный размер пересылаемой картинки в Кбайт
                      },
 
               "PNG": {

Переопределение дефолтных значений (секция default) для изображений формата png

                  "MinSizeInKb": 200
Минимальный размер пересылаемой картинки в Кбайт
                      },
 
               "JPEG": {

Переопределение дефолтных значений (секция default) для изображений формата jpeg

                  "MinSizeInKb": 200
 Минимальный размер пересылаемой картинки в Кбайт
                       }
 
                           },
 
        "ABBYYProfile": "etc/FRProfile.ini", 

Путь до настроек движка

        "Pwd": "Type password for serial here.", 
Пароль:hsgsldk3we918nc
        "SerNum": "Type serial number here."
Серийный номер: SWRD-1101-1004-3071-2095-4370
    }, 
 
    "Logging": {...}
см. Общая секция Logging
    "NookDir": "/opt/iw/tm5", 

В секции указывается рабочий каталог модуля. По умолчанию – /opt/iw/tm5.

    "UnsafeSignalHandlers":false
Поддержка работы с необрабатываемыми сигналами. По умолчанию выключена (false). При установке значения true позволяется устанавливать в коде обработчики "небезопасных" сигналов (например, SIGSEVG). Добавлять, включать/выключать данную настройку не рекомендуется без предварительной консультации с разработчиками.
}
 

Unit-файл iw_image2text_fre_batch.service 

Код
Описание

[Unit]

Раздел для определения метаданных демона и настройки его взаимодействия с другими демонами
Description=Image2Text extractor (FineReaderEngine)

Название демона

After=network-online.service iwtm-consul.service  Демоны, которые будут запущены до запуска текущего демона
  
[Service]Раздел настройки запуска демона

Type=simple

Тип запуска демона. simple - демон запускается и переходит в режим ожидания на консоли

PermissionsStartOnly=true

Запуск команд из ExecStartPre под пользователем root

ExecStartPre=/bin/bash /opt/iw/tm5/bin/check_coredumps.sh -d iw_image2text_fre_batch

Полный путь и аргументы команды, которые должны быть выполнены до запуска основного процесса

ExecStart=/opt/iw/tm5/bin/iw_image2text_fre_batch -p /opt/iw/tm5/etc

Полный путь и аргументы команды, которая должна быть выполнена для запуска демона. Запускается от пользователя, указанного в User

ExecStop=/bin/kill -s SIGQUIT $MAINPID

Команда для остановки демона. Если не указано, процесс будет немедленно уничтожен, когда демон будет остановлен. Запускается от пользователя, указанного в User

ExecReload=/bin/kill -s SIGHUP $MAINPID

Команда для перезагрузки конфигурации демона, если она доступна. Запускается от пользователя, указанного в User

Restart=on-failure

Команда для рестарта демона, если он остановится или упадет. Значение on-failure означает, что демон будет перезапускаться, если он остановился с ненулевым кодом возврата или был завершен по сигналу (kill <pid_демона>)

RestartSec=5

Время ожидания перед попыткой перезапуска демона

RestartPreventExitStatus=SIGKILL

Команда, по которой можно принудительно завершить работу демона

TimeoutStopSec=0

Время, в течение которого система будет ждать остановки демона, прежде чем пометить его недоступный или завершенный принудительно

User=iwtm

Имя пользователя, от которого осуществляется запуск демона

Group=iwtm

Имя группы пользователя

LimitNOFILE=32768

Максимальное количество открытых файлов

LimitFSIZE=infinity

Максимальный размер файла (КБ). infinity - без ограничений

LimitNPROC=65536

Максимальное количество процессов

LimitCORE=infinity

Ограничение на размер coredump-файла (КБ)

LimitMEMLOCK=infinity

Максимальное заблокированное в памяти адресное пространство (КБ)

 

 
  

[Install]

Определение поведения демона, если он включен или отключен

WantedBy=multi-user.target

Запускать этот демон, когда система грузится в multi-user режиме
Sv translation
languageen

The image2text_fre.conf configuration file:

ContentDescription
{
 
    "DebugBreak": false, 
If SIGTRAP should be sent (SIGBREAK to Windows) while any exception handling. Used for debugging purposes.
    "FREngine": {
OCR Abbyy Fine Reader engine settings.
 "ImageFormats": {
Size limits for images to be processed.
"ColorChecker": {Filter of colour section
"target_image_area_sqrt": 300,Target area, to which the image is to be adjusted before proceeding to analysis (to speed up the analysis) 
"significant_colors_number_threshold" : 30,Threshhold of number of colours, that overcame the threshhold significance_threshold. If the number is bigger than this threshold, then image is considered scan copy and will not be processed by OCR.
"significance_threshold" : 0.005,Threshold of fraction of colour in image. If the fraction of colour is bigger than this threshold, such colour will be considered in the threshhold significant_colors_number_threshold.
"dark_border" : 40,Dark border of colour. The border defines which colours from greyscale will be outcasted from consideration when calculating values for the thresholds significance_threshold and significant_colors_number_threshold.
"light_border" : 220,Light border of colour. The border defines which colours from greyscale will be outcasted from consideration when calculating values for the thresholds significance_threshold and significant_colors_number_threshold 
"Enabled" : falseActivation of colour filter
                       }
 
               "default": {
Default values
               "MinHeightInPx": 12,
Minimum height of image (pixels).
               "MinLengthInPx": 140,
Minimum length of image to be sent.
               "MinSizeInKb": 200,
Minimum size of image to be sent (Kb).
               "MaxSizeInKb": 1536
Maximum size of image to be sent (Kb).
                   }
 
"GIF": { Redefining of default values (section default) for gif format images.
              "MinSizeInKb": 200
 Minimum size of image to be sent (Kb).
  }, 
 
                "PNG": {
 Redefining of default values (section default) for png format images.
 
           "MinSizeInKb": 200
Minimum size of image to be sent (Kb).
                   },
 
              "JPEG": {
Redefining of default values (section default) for jpeg format images.
            "MinSizeInKb": 200
Minimum size of image to be sent (Kb).
                 }
 
                   },
 
        "ABBYYProfile": "etc/FRProfile.ini", 

Path to engine settings.

        "Pwd": "Type password for serial here.", 
Password:hsgsldk3we918nc
        "SerNum": "Type serial number here."
Serial number: SWRD-1101-1004-3071-2095-4370
    }, 
 
    "Logging": {...}
see General section Logging
    "NookDir": "/opt/iw/tm5", 

In this section the module working directory is specified. By default –  /opt/iw/tm5

"UnsafeSignalHandlers":false
Unhandled signals support. Disabled by default (false). Once true is set, it is allowed to use unsafe handlers in code (e.g. SIGSEVG). Adding, enabling/disabling this parameter is not recommended without consultation with developers.
}
 

The iw_image2text_fre_batch.service  unit file:

Start the daemon when the system is loaded in multi-user mode
CodeDescription

[Unit]

A section where the daemon metadata is determined and interaction settings with other daemons are specified
Description=Image2Text extractor (FineReaderEngine)

Daemon name

After=network-online.service iwtm-consul.service Daemons that will be started before the current one
  
[Service]A section where the daemon start settings are specified

Type=simple

Daemon start type. simple - the daemon is started and goes into standby on the console

PermissionsStartOnly=true

Running commands from ExecStartPre under root

ExecStartPre=/bin/bash /opt/iw/tm5/bin/check_coredumps.sh -d iw_image2text_fre_batch

The full path and arguments of the command that should be executed before the main process is started

ExecStart=/opt/iw/tm5/bin/iw_image2text_fre_batch -p /opt/iw/tm5/etc

The full path and command arguments that should be executed before starting the daemon. The command is run under user specified in the User field

ExecStop=/bin/kill -s SIGQUIT $MAINPID

A command to stop the daemon. If the command is not specified, the process will be killed once the daemon is stopped. The command is run under user specified in the User field

ExecReload=/bin/kill -s SIGHUP $MAINPID

A command that reloads the daemon configuration if it is available. The command is run under user specified in the User field

Restart=on-failure

A command that restarts the daemon when it stops or crashes. The on-failure value indicates that the daemon will be restarted if it has stopped with a non-zero return code or was ended by signal (kill <daemon_pid>)

RestartSec=5

A timeout before attempting to restart the daemon

RestartPreventExitStatus=SIGKILL

A command that forcibly ends the daemon operation

TimeoutStopSec=0

The time during which the system waits for the signal to stop before marking the process as unavailable or terminated

User=iwtm

The name of the user under whose account the daemon is started

Group=iwtm

Name of the user group

LimitNOFILE=32768

The maximum number of open files

LimitFSIZE=infinity

The maximum size of a file (KB). The infinity value means that the size is unlimited

LimitNPROC=65536

The maximum number of processes

LimitCORE=infinity

Restriction for the core file size (KB)

LimitMEMLOCK=infinity

The maximum size of memory locked address space (KB)

 

 
  

[Install]

Defines the behavior of a daemon when it is enabled/disabled

WantedBy=multi-user.target