Closed aurichje closed 3 years ago
This may be triggered by -P curved_line true
, could you try it without?
Sure. Without the curved_line parameter set to true I don't seem to get any textlines at all, just regions.
Workflow:
ocrd process \
"sbb-binarize -I OCR-D-IMG -O OCR-D-BIN -P model default" \
"eynollah-segment -I OCR-D-BIN -O OCR-D-SEG -P models default" \
"calamari-recognize -I OCR-D-SEG -O OCR-D-OCR -P checkpoint_dir qurator-gt4histocr-1.0"
That's even weirder 😄 Especially because that's seems to be the exact workflow I use a lot in my work and have personally tested on >250 documents. I'll do some test myself tomorrow to see if I can spot anything special about this.
Sure. Without the curved_line parameter set to true I don't seem to get any textlines at all, just regions.
Workflow:
ocrd process \ "sbb-binarize -I OCR-D-IMG -O OCR-D-BIN -P model default" \ "eynollah-segment -I OCR-D-BIN -O OCR-D-SEG -P models default" \ "calamari-recognize -I OCR-D-SEG -O OCR-D-OCR -P checkpoint_dir qurator-gt4histocr-1.0"
part of XML ( SEG)
Could you please install opencv-python == 4.2.0.34 . This should solve the issue.
Could you please install opencv-python == 4.2.0.34 . This should solve the issue.
Thanks for weighing in on this @vahidrezanezhad. I uninstalled opencv-python-headless (4.5.2.54) and installed opencv-python (4.2.0.34) using pip in the venv, but this did not solve the issue.
I also tried the docker version with:
docker run --rm -u $(id -u):$(id -g) -v $PWD:/data -w /data -- ocrd/all:maximum ocrd-eynollah-segment -I OCR-D-BIN -O OCR-D-SEG -P models models_eynollah
Which produced the same results.
I figured this must be a local issue, so I set up OCR-D on a server running ubuntu 18.04 (I'm running elementary OS on my machine) this morning. Again, same issue (for both of the opencv versions).
Could you please install opencv-python == 4.2.0.34 . This should solve the issue.
Thanks for weighing in on this @vahidrezanezhad. I uninstalled opencv-python-headless (4.5.2.54) and installed opencv-python (4.2.0.34) using pip in the venv, but this did not solve the issue.
I also tried the docker version with:
docker run --rm -u $(id -u):$(id -g) -v $PWD:/data -w /data -- ocrd/all:maximum ocrd-eynollah-segment -I OCR-D-BIN -O OCR-D-SEG -P models models_eynollah
Which produced the same results.
I figured this must be a local issue, so I set up OCR-D on a server running ubuntu 18.04 (I'm running elementary OS on my machine) this morning. Again, same issue (for both of the opencv versions).
I think uninstalling opencv-python-headless is not a good idea. The point is that when you install eynollah by "pip install .", opencv-python-headless is installed but the opencv-python is not installed. The other point is we need opencv-python <= 4.2.0.34. So again try it with both opencv-python-headless === 4.5.1.48 and opencv-python == 4.2.0.34 installed. This should solve the problem. I have reproduced this error and by changing the requirements I've solved it.
You can also share your output of "pip list ". This is going to help us to resolve your problem too.
@aurichje please just check that at the end you have opencv-python-headless === 4.5.1.48 and opencv-python == 4.2.0.34 installed .
I think uninstalling opencv-python-headless is not a good idea. The point is that when you install eynollah by "pip install .", opencv-python-headless is installed but the opencv-python is not installed. The other point is we need opencv-python <= 4.2.0.34. So again try it with both opencv-python-headless === 4.5.1.48 and opencv-python == 4.2.0.34 installed. This should solve the problem. I have reproduced this error and by changing the requirements I've solved it.
I reinstalled opencv-python-headless==4.5.1.48 (and not 4.5.2.54, what I had before) and that fixed it when using curved_line false
. For curved_line true
I still get the reversed order -- however that's not a problem for me as I don't need to use the curved_line option.
Thank you so much for your help!
I think uninstalling opencv-python-headless is not a good idea. The point is that when you install eynollah by "pip install .", opencv-python-headless is installed but the opencv-python is not installed. The other point is we need opencv-python <= 4.2.0.34. So again try it with both opencv-python-headless === 4.5.1.48 and opencv-python == 4.2.0.34 installed. This should solve the problem. I have reproduced this error and by changing the requirements I've solved it.
I reinstalled opencv-python-headless==4.5.1.48 (and not 4.5.2.54, what I had before) and that fixed it when using
curved_line false
. Forcurved_line true
I still get the reversed order -- however that's not a problem for me as I don't need to use the curved_line option.Thank you so much for your help!
If still relevant, here's the output of
pip list
the order of textlines with curved_lines on is another issue. I will resolve it too
So the workaround is having to install an old version of opencv-python
and(!) an old version of opencv-python-headless
?
So the workaround is having to install an old version of
opencv-python
and(!) an old version ofopencv-python-headless
?
At this moment, yes but I will try to resolve this within the code in order to make it compatible with the latest OpenCV-python-headless version.
The problem was a combination of an oversight on our side (https://github.com/vahidrezanezhad/eynollah/commit/d1330ffb805b117fe324e9c0dc90eba06633dbb2) and an API change in OpenCV. Fixed in v0.0.6.
Hi, using eynollah in a OCR-D workflow produced a reverse text line order within each region, so that the last actual line is line_001 in the PAGE XML.
I'm new to eynollah and OCR-D, so I might have made a mistake somewhere. Any ideas anyone? Thanks!
I used this workflow:
Used image
PageView screenshot
![PageView screenshot](https://user-images.githubusercontent.com/56193556/122393610-56d73600-cf75-11eb-829e-bac8b5e373f6.png)And here's the xml section corresponding to the first news paragraph:
XML
```xml