Image-to-Text
Transformers
ONNX
Safetensors
vision-encoder-decoder
image-text-to-text
typst
math-ocr
formula-recognition
browser
grayscale
Instructions to use dbcccc/TypLens with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dbcccc/TypLens with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="dbcccc/TypLens")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("dbcccc/TypLens") model = AutoModelForMultimodalLM.from_pretrained("dbcccc/TypLens", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| { | |
| "image_processor_type": "DeiTImageProcessor", | |
| "do_resize": true, | |
| "size": { | |
| "height": 384, | |
| "width": 384 | |
| }, | |
| "resample": 3, | |
| "do_center_crop": false, | |
| "do_rescale": true, | |
| "rescale_factor": 0.00392156862745098, | |
| "do_normalize": true, | |
| "image_mean": [ | |
| 0.5 | |
| ], | |
| "image_std": [ | |
| 0.5 | |
| ], | |
| "requires_custom_preprocessing": true, | |
| "typlens_preprocessing": { | |
| "version": "native-content-box-gray-v2", | |
| "channels": 1, | |
| "width": 384, | |
| "height": 384, | |
| "grayscale_weights": [ | |
| 77, | |
| 150, | |
| 29 | |
| ], | |
| "grayscale_divisor": 256, | |
| "alpha_background": 255, | |
| "foreground_delta": 12, | |
| "margin_ratio": 0.02, | |
| "min_margin": 1, | |
| "polarity": "perimeter-median-below-128", | |
| "resampler": "pillow-bicubic-u8-v1", | |
| "mean": [ | |
| 0.5 | |
| ], | |
| "std": [ | |
| 0.5 | |
| ] | |
| } | |
| } | |