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

feat: integrate got-ocr2.0 as image reader #355

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

phv2312
Copy link
Contributor

@phv2312 phv2312 commented Oct 2, 2024

Description

  • Integrate the got-ocr2.0 OCR as image reader
  • New extension manager for easily switch between different supported loaders
  • Also, thanks @cin-jimmy for his suggestion on github stale (issue)

Type of change

  • New features (non-breaking change).
  • Bug fix (non-breaking change).
  • Breaking change (fix or feature that would cause existing functionality not to work as expected).

Checklist

  • I have performed a self-review of my code.
  • I have added thorough tests if it is a core feature.
  • There is a reference to the original bug report and related work.
  • I have commented on my code, particularly in hard-to-understand areas.
  • The feature is well documented.

@phv2312 phv2312 changed the title Feat/integrate 3rd feat: integrate 3rd Oct 2, 2024
@phv2312 phv2312 changed the title feat: integrate 3rd feat: integrate got-ocr2.0 Oct 2, 2024
@phv2312 phv2312 changed the title feat: integrate got-ocr2.0 feat: integrate got-ocr2.0 as image reader Oct 2, 2024
@phv2312 phv2312 requested a review from taprosoft October 2, 2024 15:43
@cin-niko
Copy link
Contributor

cin-niko commented Oct 4, 2024

@phv2312, can you add a docker-compose file (allow choose the docker image for OCR service)? I think it will help people test more easily.

@phv2312
Copy link
Contributor Author

phv2312 commented Oct 26, 2024

Hi @taprosoft @cin-niko. Sorry for no update for long time. Can you help to review this PR again

docker-compose.dev.yml Show resolved Hide resolved
docker-compose.yml Show resolved Hide resolved
- We provide the docker image, with fastapi for serving the GOT-OCR2.0. Pull the image from:

```bash
docker run -d --gpus all -p 8881:8881 ghcr.io/phv2312/got-ocr2.0:main
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move the docker to Kotaemon ghcr if we use GOCR as the main OCR loader?

UnstructuredReader,
)

unstructured = UnstructuredReader()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for consistent naming (same as in files.py): unstructured_reader

credential=str(config("AZURE_DI_CREDENTIAL", default="")),
cache_dir=getattr(flowsettings, "KH_MARKDOWN_OUTPUT_DIR", None),
)
adobe_reader.vlm_endpoint = azure_reader.vlm_endpoint = getattr(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we pass vlm_endpoint in __init__ (same as in files.py)


raise Exception(f"can not find the selected loader for extension: {extension}")

def generate_gradio_settings(self) -> dict[str, Any]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, the logic related to gradio UI should be implemented in ktem.

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

Successfully merging this pull request may close these issues.

4 participants