Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during execution #1

Closed
cesalo opened this issue Nov 27, 2019 · 8 comments
Closed

Error during execution #1

cesalo opened this issue Nov 27, 2019 · 8 comments

Comments

@cesalo
Copy link

cesalo commented Nov 27, 2019

Hi - Trying to use your script and got the following error:
PgsToSrt 1.0.0.0

2019/11/26 19:57:26.699|INFO|Detected tesseract language data for language 'spa'.
2019/11/26 19:57:26.783|INFO|Detected tesseract language data for language 'eng'.
2019/11/26 19:57:27.011|INFO|Starting OCR for 606 items...
2019/11/26 19:57:27.114|ERROR|Error: Exception has been thrown by the target of an invocation. Exception has been thrown by the target of an invocation.

Not sure how to generate more debug info. Any assistance is appreciated .. Thanks.

@Tentacule
Copy link
Owner

If you are running under linux be sure to have libgdiplus and libtiff installed.

I'll probably update the code in the future to have clearer error message.

@cesalo
Copy link
Author

cesalo commented Nov 30, 2019

Thanks for the reply. I installed: libgdiplus-2.10-10.el7.x86_64 and libtiff-4.0.3-32.el7.x86_64 .. but still is throwing the same error:

PgsToSrt 1.0.0.0
2019/11/30 11:34:27.203|INFO|Detected tesseract language data for language 'eng'.
2019/11/30 11:34:27.440|INFO|Starting OCR for 606 items...
2019/11/30 11:34:27.550|ERROR|Error: Exception has been thrown by the target of an invocation. Exception has been thrown by the target of an invocation.
Done.

Any other lib that is needed? I'm in Centos 7.

@segator
Copy link
Contributor

segator commented Dec 1, 2019

I'm trying to do a docker image using dotnet sdk 2.1 but same error I tried to install from ubuntu package libgdiplus libtiff-dev, any help? if I get this working I will PR a docker image that also download tessdata

@Tentacule
Copy link
Owner

The tesseract nuget package which does the ocr used in this project will also need liblept 1.7.53 and libtesseract 3.05.2

It must be the specified version, I'll probably rework this part to because those versions may not be available as packages for all linux flavor. In that case you'll have to compile them from source, which is not very convinient.

@sdelrio
Copy link

sdelrio commented Dec 7, 2019

Trying with a dotnetcore sdk image (ubuntu bionic):

$ docker pull microsoft-dotnet-core-sdk:2.2-bionic
$ docker run --rm -v /diretorywithsub:/mnt -ti mcr.microsoft.com/dotnet/core/sdk:2.2-bionic /bin/bash

And then folowing the steps to use that version requirements (liblept 1.75.3 and tesseract 3.05):


apt-get update
apt install -y libgdiplus libtiff-dev liblept5=1.75.3-3

# https://github.com/tesseract-ocr/tesseract/wiki/Compiling-%E2%80%93-GitInstallation
apt-get install -y automake ca-certificates g++ git libtool libleptonica-dev=1.75.3-3 make pkg-config
# Optionnal training tools: apt-get install -y libpango1.0-dev

# Tesseeract 3.05
git clone https://github.com/tesseract-ocr/tesseract.git  --depth 1 --branch 3.05 --single-branch
cd tesseract
./autogen.sh
./configure
make
make install
ldconfig

# PGTOSTR
cd
git clone --depth 1 --single-branch https://github.com/Tentacule/PgsToSrt
cd PgsToSrt


dotnet restore
dotnet publish -c Release -o out

# download dicts
git clone --depth 1 --branch 3.05 --single-branch https://github.com/tesseract-ocr/tessdata 

# Execute dotnet app
dotnet /root/PgsToSrt/PgsToSrt/bin/Release/netcoreapp2.1/PgsToSrt.dll --tesseractdata ./tessdata --input /root/b.sup --output /root/b.srt --tesseractlanguage eng

(...)
2019/12/07 11:54:49.679|INFO|Detected tesseract language data for language 'tgk'.
2019/12/07 11:54:49.679|INFO|Detected tesseract language data for language 'ben'.
2019/12/07 11:54:49.679|INFO|Detected tesseract language data for language 'chi_sim'.
2019/12/07 11:54:49.679|INFO|Detected tesseract language data for language 'tir'.
2019/12/07 11:54:49.679|INFO|Detected tesseract language data for language 'deu'.
2019/12/07 11:54:49.679|INFO|Detected tesseract language data for language 'kat'.
2019/12/07 11:54:49.861|INFO|Starting OCR for 1800 items...
2019/12/07 11:54:49.905|ERROR|Error: Exception has been thrown by the target of an invocation. Exception has been thrown by the target of an invocation.

@cesalo
Copy link
Author

cesalo commented Dec 7, 2019 via email

@Tentacule
Copy link
Owner

Ok, I found the issue.

I don't have time to fix it in the code right now, but as a work-around you can copy liblept.so.5.0.2 and libtesseract.so.3.0.5 in the x64 folder (or x86 depending on your platform) and rename them to liblept1753.so and libtesseract3052.so

@Tentacule
Copy link
Owner

This issue should be fixed in release v1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants